3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PlotWrapper Class Reference

#include <plot.h>

Collaboration diagram for PlotWrapper:
Collaboration graph
[legend]

Public Member Functions

 PlotWrapper ()
 Constructor. More...
 
 ~PlotWrapper ()
 Destructor must delete target plots. More...
 
const PlotWrapperoperator= (const PlotWrapper &oth)
 
size_t numPlots () const
 
void getPlotIDs (std::vector< unsigned int > &ids) const
 
std::string getTitle (size_t plotId) const
 
void setEnableHighlightOverlap (bool enable=true)
 
size_t getParentType (size_t plotId) const
 
bool isInteractionLocked () const
 
void lockInteraction (bool lock=true)
 
bool hasChanged () const
 Has the contents of the plot changed since the last call to resetChange? More...
 
void resetChange ()
 
void clear (bool preserveVisibility=false)
 Erase all the plot data. More...
 
void hideAll ()
 Hide all plots (sets all visibility to false) More...
 
void setVisible (unsigned int uniqueID, bool isVisible=true)
 Set the visibilty of a plot, based upon its uniqueID. More...
 
void scanBounds (float &xMin, float &xMax, float &yMin, float &yMax) const
 Get the bounds for the plot. More...
 
void drawPlot (mglGraph *graph, bool &usingLogMode) const
 
void setStrings (unsigned int plotID, const char *x, const char *y, const char *t)
 Set the X Y and title strings. More...
 
void setStrings (unsigned int plotID, const std::string &x, const std::string &y, const std::string &t)
 
const void * getParent (unsigned int plotID)
 Get the parent object fo rthis plot. More...
 
unsigned int getParentIndex (unsigned int plotId) const
 
void setTraceStyle (unsigned int plotID, unsigned int mode)
 Set the plotting mode. More...
 
void setColours (unsigned int plotID, float rN, float gN, float bN)
 Set the plot colours. More...
 
void setBounds (float xMin, float xMax, float yMin, float yMax)
 Set the bounds on the plot. More...
 
void getBounds (float &xMin, float &xMax, float &yMin, float &yMax) const
 Get the bounds for the plot. More...
 
void resetBounds ()
 Automatically use the data limits to compute bounds. More...
 
unsigned int getNumVisible () const
 Get the number of visible plots. More...
 
unsigned int getNumTotal () const
 Get the number of visible plots. More...
 
bool isPlotVisible (unsigned int plotID) const
 Returns true if plot is visible, based upon its uniqueID. More...
 
void getVisibleIDs (std::vector< unsigned int > &plotID) const
 
void disableUserBounds ()
 Disable user bounds. More...
 
void disableUserAxisBounds (bool xAxis)
 Disable user axis bounds along one axis only. More...
 
void bestEffortRestoreVisibility ()
 Do our best to restore the visibility of the plot to what it was. More...
 
void setLegendVisible (bool vis)
 Set whether to enable the legend or not. More...
 
bool getLegendVisible () const
 
unsigned int addPlot (PlotBase *plot)
 Add a plot to the list of available plots. Control of the pointer becomes. More...
 
bool getRegionIdAtPosition (float px, float py, unsigned int &plotId, unsigned int &regionID) const
 Get the ID (return value) and the contents of the plot region at the given position. More...
 
void getRegion (unsigned int plotId, unsigned int regionId, PlotRegion &r) const
 
void getRegions (std::vector< std::pair< size_t, std::vector< PlotRegion > > > &regions, bool visibleOnly=true) const
 
void getRegionOverlaps (std::vector< std::pair< size_t, size_t > > &ids, std::vector< std::pair< float, float > > &coords) const
 
void getRawData (std::vector< std::vector< std::vector< float > > > &data, std::vector< std::vector< std::string > > &labels) const
 Retrieve the raw data associated with the selected plots. More...
 
unsigned int getPlotMode (unsigned int plotId) const
 obtain the type of a plot, given the plot's uniqueID More...
 
unsigned int getVisibleMode () const
 
void findRegionLimit (unsigned int plotId, unsigned int regionId, unsigned int movementType, float &maxX, float &maxY) const
 Obtain limit of motion for a given region movement type. More...
 
void moveRegion (unsigned int plotID, unsigned int regionId, bool regionSelfUp, unsigned int movementType, float newX, float newY) const
 Pass the region movement information to the parent filter object. More...
 
void switchOutRegionParent (std::map< const RangeFileFilter *, RangeFile > &switchMap)
 
void setRegionGroup (size_t plotId, RegionGroup &r)
 
void overrideLastVisible (std::vector< std::pair< const void *, unsigned int > > &overridden)
 

Public Attributes

PlotOverlays overlays
 

Protected Member Functions

void getAppliedBounds (mglPoint &min, mglPoint &max) const
 

Protected Attributes

bool plotChanged
 Has the plot changed since we last rendered it? More...
 
std::vector< PlotBase * > plottingData
 Elements of the plot. More...
 
std::vector< std::pair< const void *, unsigned int > > lastVisiblePlots
 Data regarding plots were visible previously. More...
 
UniqueIDHandler plotIDHandler
 
bool applyUserBounds
 Use user-specified bounding values? More...
 
float xUserMin
 User mininum bounds. More...
 
float yUserMin
 
float xUserMax
 User maximum bounds. More...
 
float yUserMax
 
bool drawLegend
 Switch to enable or disable drawing of the plot legend. More...
 
bool interactionLocked
 is user interaction with the plot supposed to be locked? More...
 
bool highlightRegionOverlaps
 Do we want to highlight positions where regions overlap? More...
 

Constructor & Destructor Documentation

◆ PlotWrapper()

PlotWrapper::PlotWrapper ( )

Constructor.

◆ ~PlotWrapper()

PlotWrapper::~PlotWrapper ( )

Destructor must delete target plots.

Member Function Documentation

◆ addPlot()

unsigned int PlotWrapper::addPlot ( PlotBase plot)

Add a plot to the list of available plots. Control of the pointer becomes.

◆ bestEffortRestoreVisibility()

void PlotWrapper::bestEffortRestoreVisibility ( )

Do our best to restore the visibility of the plot to what it was.

◆ clear()

void PlotWrapper::clear ( bool  preserveVisibility = false)

Erase all the plot data.

◆ disableUserAxisBounds()

void PlotWrapper::disableUserAxisBounds ( bool  xAxis)

Disable user axis bounds along one axis only.

References ASSERT.

Referenced by MathGLPane::mouseDoubleLeftClick().

Here is the caller graph for this function:

◆ disableUserBounds()

void PlotWrapper::disableUserBounds ( )
inline

Disable user bounds.

Referenced by MathGLPane::mouseDoubleLeftClick().

Here is the caller graph for this function:

◆ drawPlot()

void PlotWrapper::drawPlot ( mglGraph *  graph,
bool &  usingLogMode 
) const

◆ findRegionLimit()

void PlotWrapper::findRegionLimit ( unsigned int  plotId,
unsigned int  regionId,
unsigned int  movementType,
float &  maxX,
float &  maxY 
) const

Obtain limit of motion for a given region movement type.

Referenced by MathGLPane::getErrString().

Here is the caller graph for this function:

◆ getAppliedBounds()

void PlotWrapper::getAppliedBounds ( mglPoint &  min,
mglPoint &  max 
) const
protected

References ASSERT, and mglFloatTooClose().

◆ getBounds()

void PlotWrapper::getBounds ( float &  xMin,
float &  xMax,
float &  yMin,
float &  yMax 
) const

Get the bounds for the plot.

References ASSERT.

Referenced by MathGLPane::mouseDoubleMiddleClick(), MathGLPane::mouseWheelMoved(), MathGLPane::resized(), and MathGLPane::~MathGLPane().

Here is the caller graph for this function:

◆ getLegendVisible()

bool PlotWrapper::getLegendVisible ( ) const
inline

References PlotRegion::r.

◆ getNumTotal()

unsigned int PlotWrapper::getNumTotal ( ) const
inline

Get the number of visible plots.

Referenced by MathGLPane::~MathGLPane().

Here is the caller graph for this function:

◆ getNumVisible()

unsigned int PlotWrapper::getNumVisible ( ) const

Get the number of visible plots.

Referenced by MathGLPane::getNumVisible(), MathGLPane::mouseDoubleMiddleClick(), and MathGLPane::render().

Here is the caller graph for this function:

◆ getParent()

const void* PlotWrapper::getParent ( unsigned int  plotID)
inline

Get the parent object fo rthis plot.

References ASSERT, and plotID().

◆ getParentIndex()

unsigned int PlotWrapper::getParentIndex ( unsigned int  plotId) const
inline

References ASSERT.

◆ getParentType()

size_t PlotWrapper::getParentType ( size_t  plotId) const

Referenced by RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ getPlotIDs()

void PlotWrapper::getPlotIDs ( std::vector< unsigned int > &  ids) const

Referenced by RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ getPlotMode()

unsigned int PlotWrapper::getPlotMode ( unsigned int  plotId) const

obtain the type of a plot, given the plot's uniqueID

References ASSERT.

Referenced by MathGLPane::getErrString(), and MathGLPane::mouseDoubleMiddleClick().

Here is the caller graph for this function:

◆ getRawData()

void PlotWrapper::getRawData ( std::vector< std::vector< std::vector< float > > > &  data,
std::vector< std::vector< std::string > > &  labels 
) const

Retrieve the raw data associated with the selected plots.

References ASSERT, PLOT_MODE_1D, PLOT_MODE_2D, PLOT_MODE_ENUM_END, and PLOT_MODE_MIXED.

◆ getRegion()

void PlotWrapper::getRegion ( unsigned int  plotId,
unsigned int  regionId,
PlotRegion r 
) const

Referenced by MathGLPane::getErrString(), and MathGLPane::mouseDoubleMiddleClick().

Here is the caller graph for this function:

◆ getRegionIdAtPosition()

bool PlotWrapper::getRegionIdAtPosition ( float  px,
float  py,
unsigned int &  plotId,
unsigned int &  regionID 
) const

Get the ID (return value) and the contents of the plot region at the given position.

Referenced by MathGLPane::getRegionUnderCursor().

Here is the caller graph for this function:

◆ getRegionOverlaps()

void PlotWrapper::getRegionOverlaps ( std::vector< std::pair< size_t, size_t > > &  ids,
std::vector< std::pair< float, float > > &  coords 
) const

◆ getRegions()

void PlotWrapper::getRegions ( std::vector< std::pair< size_t, std::vector< PlotRegion > > > &  regions,
bool  visibleOnly = true 
) const

References PlotBase::regionGroup, RegionGroup::regions, and PlotBase::visible.

Referenced by RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ getTitle()

std::string PlotWrapper::getTitle ( size_t  plotId) const

Referenced by RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ getVisibleIDs()

void PlotWrapper::getVisibleIDs ( std::vector< unsigned int > &  plotID) const

◆ getVisibleMode()

unsigned int PlotWrapper::getVisibleMode ( ) const

References ASSERT, PLOT_MODE_ENUM_END, and PLOT_MODE_MIXED.

Referenced by MathGLPane::leftMouseDown(), and MathGLPane::middleMouseDown().

Here is the caller graph for this function:

◆ hasChanged()

bool PlotWrapper::hasChanged ( ) const
inline

Has the contents of the plot changed since the last call to resetChange?

Referenced by MathGLPane::render().

Here is the caller graph for this function:

◆ hideAll()

void PlotWrapper::hideAll ( )

Hide all plots (sets all visibility to false)

Referenced by RangeEditorDialog::OnListPlots().

Here is the caller graph for this function:

◆ isInteractionLocked()

bool PlotWrapper::isInteractionLocked ( ) const
inline

Referenced by MathGLPane::render(), and MathGLPane::~MathGLPane().

Here is the caller graph for this function:

◆ isPlotVisible()

bool PlotWrapper::isPlotVisible ( unsigned int  plotID) const

Returns true if plot is visible, based upon its uniqueID.

◆ lockInteraction()

void PlotWrapper::lockInteraction ( bool  lock = true)
inline

◆ moveRegion()

void PlotWrapper::moveRegion ( unsigned int  plotID,
unsigned int  regionId,
bool  regionSelfUp,
unsigned int  movementType,
float  newX,
float  newY 
) const

Pass the region movement information to the parent filter object.

Referenced by MathGLPane::leftMouseReleased().

Here is the caller graph for this function:

◆ numPlots()

size_t PlotWrapper::numPlots ( ) const
inline

◆ operator=()

const PlotWrapper & PlotWrapper::operator= ( const PlotWrapper oth)

◆ overrideLastVisible()

void PlotWrapper::overrideLastVisible ( std::vector< std::pair< const void *, unsigned int > > &  overridden)

◆ resetBounds()

void PlotWrapper::resetBounds ( )

Automatically use the data limits to compute bounds.

◆ resetChange()

void PlotWrapper::resetChange ( )
inline

References plotID().

Referenced by MathGLPane::render().

Here is the caller graph for this function:

◆ scanBounds()

void PlotWrapper::scanBounds ( float &  xMin,
float &  xMax,
float &  yMin,
float &  yMax 
) const

Get the bounds for the plot.

References ASSERT.

Referenced by MathGLPane::mouseWheelMoved().

Here is the caller graph for this function:

◆ setBounds()

void PlotWrapper::setBounds ( float  xMin,
float  xMax,
float  yMin,
float  yMax 
)

Set the bounds on the plot.

References ASSERT.

Referenced by MathGLPane::middleMouseReleased(), MathGLPane::mouseWheelMoved(), and MathGLPane::~MathGLPane().

Here is the caller graph for this function:

◆ setColours()

void PlotWrapper::setColours ( unsigned int  plotID,
float  rN,
float  gN,
float  bN 
)

Set the plot colours.

◆ setEnableHighlightOverlap()

void PlotWrapper::setEnableHighlightOverlap ( bool  enable = true)
inline

Referenced by RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ setLegendVisible()

void PlotWrapper::setLegendVisible ( bool  vis)
inline

Set whether to enable the legend or not.

Referenced by MathGLPane::setLegendVisible().

Here is the caller graph for this function:

◆ setRegionGroup()

void PlotWrapper::setRegionGroup ( size_t  plotId,
RegionGroup r 
)

Referenced by RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ setStrings() [1/2]

void PlotWrapper::setStrings ( unsigned int  plotID,
const char *  x,
const char *  y,
const char *  t 
)

Set the X Y and title strings.

◆ setStrings() [2/2]

void PlotWrapper::setStrings ( unsigned int  plotID,
const std::string &  x,
const std::string &  y,
const std::string &  t 
)

◆ setTraceStyle()

void PlotWrapper::setTraceStyle ( unsigned int  plotID,
unsigned int  mode 
)

Set the plotting mode.

References ASSERT, and PLOT_TYPE_ENUM_END.

◆ setVisible()

void PlotWrapper::setVisible ( unsigned int  uniqueID,
bool  isVisible = true 
)

Set the visibilty of a plot, based upon its uniqueID.

Referenced by RangeEditorDialog::OnListPlots(), MathGLPane::setPlotVisible(), and RangeEditorDialog::setPlotWrapper().

Here is the caller graph for this function:

◆ switchOutRegionParent()

void PlotWrapper::switchOutRegionParent ( std::map< const RangeFileFilter *, RangeFile > &  switchMap)

Member Data Documentation

◆ applyUserBounds

bool PlotWrapper::applyUserBounds
protected

Use user-specified bounding values?

Referenced by operator=().

◆ drawLegend

bool PlotWrapper::drawLegend
protected

Switch to enable or disable drawing of the plot legend.

Referenced by operator=().

◆ highlightRegionOverlaps

bool PlotWrapper::highlightRegionOverlaps
protected

Do we want to highlight positions where regions overlap?

Referenced by operator=().

◆ interactionLocked

bool PlotWrapper::interactionLocked
protected

is user interaction with the plot supposed to be locked?

Referenced by operator=().

◆ lastVisiblePlots

std::vector<std::pair< const void *, unsigned int> > PlotWrapper::lastVisiblePlots
protected

Data regarding plots were visible previously.

Referenced by operator=().

◆ overlays

PlotOverlays PlotWrapper::overlays

◆ plotChanged

bool PlotWrapper::plotChanged
protected

Has the plot changed since we last rendered it?

Referenced by operator=().

◆ plotIDHandler

UniqueIDHandler PlotWrapper::plotIDHandler
protected

Referenced by operator=().

◆ plottingData

std::vector<PlotBase *> PlotWrapper::plottingData
protected

Elements of the plot.

Referenced by operator=().

◆ xUserMax

float PlotWrapper::xUserMax
protected

User maximum bounds.

Referenced by operator=().

◆ xUserMin

float PlotWrapper::xUserMin
protected

User mininum bounds.

Referenced by operator=().

◆ yUserMax

float PlotWrapper::yUserMax
protected

Referenced by operator=().

◆ yUserMin

float PlotWrapper::yUserMin
protected

Referenced by operator=().


The documentation for this class was generated from the following files: