casa::PlotMSPlot Class Reference

Class for a single "plot" concept. More...

#include <PlotMSPlot.h>

Inheritance diagram for casa::PlotMSPlot:
casa::PlotMSParametersWatcher

List of all members.

Classes

class  TCLParams
 Simple class to hold parameter to resume updating after a threaded cache loading. More...

Public Member Functions

void customizeAutoSymbol (const PlotSymbolPtr &baseSymbol, uInt dataSize)
 PlotMSPlot (PlotMSApp *parent)
 Non-Static //.
 ~PlotMSPlot ()
 Destructor.
void resize (PlotMSPages &, uInt rows, uInt cols)
String name () const
 Returns a human-readable name for this plot.
String spectype () const
 Returns specialization Id for this plot.
vector< MaskedScatterPlotPtrplots () const
 Returns the plots assigned to this plot.
vector< PlotCanvasPtrcanvases () const
 Returns the canvases that have been assigned to this plot.
void attachToCanvases ()
 Attaches/Detaches internal plot objects to their assigned canvases.
void detachFromCanvases ()
Int iter ()
void dataMissing ()
 The cache load did not succeed so clear the plot and the cache.
void waitForDrawing (bool holdDrawing)
 This method was written because in scripting mode, there was a segfault when the grid size was changed (for example 2 x 3 to 1x1).
const PlotMSPlotParametersparameters () const
 Returns a reference to the plot's parameters.
PlotMSPlotParametersparameters ()
vector< PlotCanvasPtrvisibleCanvases () const
 Returns the visible canvases (accessible via PlotMSPlotter::currentCanvases()) associated with this plot.
virtual PlotMSRegions selectedRegions () const
 Returns all selected regions on all canvases associated with this plot.
PlotMSRegions visibleSelectedRegions () const
 PlotMSPlotter::currentCanvases()) associated with this plot.
bool initializePlot (PlotMSPages &pages)
 Initializes the plot with the given canvases.
PlotMSCacheBasecache ()
 Gets the plot's data source.
const PlotMSCacheBasecache () const
PlotMSAppparent ()
 Gets the plot's parent.
bool firstIter ()
 Steps the iteration.
bool prevIter ()
bool nextIter ()
bool lastIter ()
bool setIter (int index)
bool resetIter ()
void recalculateIteration ()
Int nIter ()
void parametersHaveChanged (const PlotMSWatchedParameters &params, int updateFlag)
 Implements PlotMSParametersWatcher::parametersHaveChanged().
void plotDataChanged ()
 Calls the dataChanged() method on the MaskedScatterPlots.
bool isIteration () const
 Returns true if the plot is an iteration plot.
bool exportToFormat (const PlotExportFormat &format)
 Exports canvases associated with this plot to the given format.
void exportToFormatCancel ()
void cacheLoaded_ (bool wasCanceled)
void canvasWasDisowned (PlotCanvasPtr canvas)
 This method should be called when the given canvas (which was owned by this plot) was disowned.
vector< PMS::Axis > getCachedAxes ()
vector< PMS::DataColumn > getCachedData ()
Record locateInfo (int plotIterIndex, const Vector< PlotRegion > &regions, bool showUnflagged, bool showFlagged, bool selectAll) const
PlotLogMessagelocateRange (int plotIterIndex, const Vector< PlotRegion > &regions, bool showUnflagged, bool showFlagged)
PlotLogMessageflagRange (int canvasIndex, casa::PlotMSFlagging &flagging, const Vector< PlotRegion > &regions, bool showFlagged)
bool assignCanvases (PlotMSPages &pages)
 Generates and assigns canvases that this plot will be using, with the given PlotMSPages object.
void updateLocation ()
void clearCanvases ()
 Clear the title and axes from all this plots canvases.
bool isCacheUpdating () const
 Whether a thread is currently updating the cache.
void setCacheUpdating (bool updating)
void updatePlots ()
bool updateIndexing ()
void logPoints ()
void logIter (Int iter, Int nIter)
void setRelease (bool b)
 This was added so that in 'mixed mode', cacheloaded will trigger a redraw of the plot.

Static Public Member Functions

static PlotMSPlotParameters makeParameters (PlotMSApp *plotms)
 Static //.
static void makeParameters (PlotMSPlotParameters &params, PlotMSApp *plotms)
 Updates the given PlotMSPlotParameters to be suitable for use with this class, using the given PlotMS parent.
static void cacheLoaded (void *obj, bool wasCanceled)

Protected Member Functions

bool initializePlot ()
 Initializes any internal plot objects, but does NOT set parameters or attach to canvases.
bool parametersHaveChanged_ (const PlotMSWatchedParameters &params, int updateFlag, bool releaseWhenDone)
 Updates plot members for parameters specific to the child plot type.
PlotMSRegions selectedRegions (const vector< PlotCanvasPtr > &canvases) const
 Helper method for selectedRegions() and visibleSelectedRegions() that returns the selected regions for plots in the given canvases.
void constructorSetup ()
void updatePages ()
bool updateCache ()
bool updateCanvas ()
bool updateDisplay ()
void setColors ()
bool updateData ()
 Force data update by clearing the cache.
bool allDrawingHeld ()
 Returns true if drawing is currently being held on all plot canvases, false otherwise.
void holdDrawing ()
 Holds drawing on all plot canvases.
void releaseDrawing ()
 Releases drawing on all plot canvases, which will also cause a redraw.
int getPageIterationCount (const PlotMSPage &page)
void waitOnCanvases ()

Protected Attributes

PlotMSAppitsParent_
 MEMBERS //.
PlotFactoryPtr itsFactory_
 Plot factory for generating plot objects as needed.
PlotMSPlotParameters itsParams_
 Parameters.
PlotMSCacheBaseitsCache_
 Cache.
volatile bool cacheUpdating
 Used to determine if a thread is running to update the cache.

Private Member Functions

void waitOnCanvas (const PlotCanvasPtr &canvas)
 PlotMSPlot (const PlotMSPlot &copy)
 Disable copy constructor and operator for now.
PlotMSPlotoperator= (const PlotMSPlot &copy)
void resizePlots (int rows, int cols)
 Adjust the amount of plot data that this plot is holding.
void clearPlotData ()
 Clear data when deleting cache to prevent seg fault in other thread.
void getPlotSize (Int &rows, Int &cols)
 Return the dimensions of the plot data that this plot should hold.
int getIterationIndex (int r, int c, const PlotMSPage &page)
 Returns the iteration for the canvas located at row, r, and column, c.
void logMessage (const QString &msg) const
 Post a plot message to the logger.
void clearCanvasProperties (int row, int col)
void setCanvasProperties (int row, int col, PMS_PP_Cache *, PMS_PP_Axes *axes, bool set, PMS_PP_Canvas *canv, uInt rows, uInt cols, PMS_PP_Iteration *iter, uInt iteration, PlotMSAveraging averaging)
bool axisIsAveraged (PMS::Axis axis, PlotMSAveraging averaging)
 To modify axis label if needed:.
String addFreqFrame (String freqLabel)
PMS::Axis getCalAxis (String calType, PMS::Axis axis)
PMS::Axis getDefaultXAxis (String calType)

Private Attributes

vector< vector
< MaskedScatterPlotPtr > > 
itsPlots_
 Note: First index for a plot is the dataCount, second index is the number of iteration.
vector< vector< PlotCanvasPtr > > itsCanvases_
 Note: First index for a canvas is the number of rows, second index is the column withen a grid.
vector< vector< ColoredPlotPtr > > itsColoredPlots_
TCLParams itsTCLParams_
int gridRow
int gridCol
Int iter_
Int iterStep_

Static Private Attributes

static const uInt PIXEL_THRESHOLD
static const uInt MEDIUM_THRESHOLD
static const uInt LARGE_THRESHOLD

Detailed Description

Class for a single "plot" concept.

Generally speaking this one plot handles one data source across potentially many scatter plots and canvases, separated by whatever criteria the subclasses decide on. The class PlotMSPlot handles interfacing with the rest of PlotMS and MS file and selection, and provides some useful members and methods for subclasses.

Definition at line 54 of file PlotMSPlot.h.


Constructor & Destructor Documentation

casa::PlotMSPlot::PlotMSPlot ( PlotMSApp parent  ) 

Non-Static //.

Constructor which takes the parent PlotMS object. Starts out with default data parameters.

casa::PlotMSPlot::~PlotMSPlot (  ) 

Destructor.

casa::PlotMSPlot::PlotMSPlot ( const PlotMSPlot copy  )  [private]

Disable copy constructor and operator for now.


Member Function Documentation

String casa::PlotMSPlot::addFreqFrame ( String  freqLabel  )  [private]
bool casa::PlotMSPlot::allDrawingHeld (  )  [protected]

Returns true if drawing is currently being held on all plot canvases, false otherwise.

bool casa::PlotMSPlot::assignCanvases ( PlotMSPages pages  ) 

Generates and assigns canvases that this plot will be using, with the given PlotMSPages object.

This is called when the plot is first created, and can be called by the plot itself if its canvas layout has changed (in which case this method should check for the canvases that have already been assigned to it in the page).

void casa::PlotMSPlot::attachToCanvases (  ) 

Attaches/Detaches internal plot objects to their assigned canvases.

bool casa::PlotMSPlot::axisIsAveraged ( PMS::Axis  axis,
PlotMSAveraging  averaging 
) [private]

To modify axis label if needed:.

const PlotMSCacheBase& casa::PlotMSPlot::cache (  )  const [inline]

Definition at line 160 of file PlotMSPlot.h.

References itsCache_.

PlotMSCacheBase& casa::PlotMSPlot::cache (  )  [inline]

Gets the plot's data source.

Definition at line 159 of file PlotMSPlot.h.

References itsCache_.

static void casa::PlotMSPlot::cacheLoaded ( void *  obj,
bool  wasCanceled 
) [inline, static]
void casa::PlotMSPlot::cacheLoaded_ ( bool  wasCanceled  ) 

Referenced by cacheLoaded().

vector<PlotCanvasPtr> casa::PlotMSPlot::canvases (  )  const

Returns the canvases that have been assigned to this plot.

void casa::PlotMSPlot::canvasWasDisowned ( PlotCanvasPtr  canvas  ) 

This method should be called when the given canvas (which was owned by this plot) was disowned.

void casa::PlotMSPlot::clearCanvases (  ) 

Clear the title and axes from all this plots canvases.

void casa::PlotMSPlot::clearCanvasProperties ( int  row,
int  col 
) [private]
void casa::PlotMSPlot::clearPlotData (  )  [private]

Clear data when deleting cache to prevent seg fault in other thread.

void casa::PlotMSPlot::constructorSetup (  )  [protected]
void casa::PlotMSPlot::customizeAutoSymbol ( const PlotSymbolPtr baseSymbol,
uInt  dataSize 
)
void casa::PlotMSPlot::dataMissing (  ) 

The cache load did not succeed so clear the plot and the cache.

void casa::PlotMSPlot::detachFromCanvases (  ) 
bool casa::PlotMSPlot::exportToFormat ( const PlotExportFormat format  ) 

Exports canvases associated with this plot to the given format.

Exports to multiple files if the plot has more than one canvas.

void casa::PlotMSPlot::exportToFormatCancel (  ) 
bool casa::PlotMSPlot::firstIter (  ) 

Steps the iteration.

PlotLogMessage* casa::PlotMSPlot::flagRange ( int  canvasIndex,
casa::PlotMSFlagging flagging,
const Vector< PlotRegion > &  regions,
bool  showFlagged 
)
vector<PMS::Axis> casa::PlotMSPlot::getCachedAxes (  ) 
vector<PMS::DataColumn> casa::PlotMSPlot::getCachedData (  ) 
PMS::Axis casa::PlotMSPlot::getCalAxis ( String  calType,
PMS::Axis  axis 
) [private]
PMS::Axis casa::PlotMSPlot::getDefaultXAxis ( String  calType  )  [private]
int casa::PlotMSPlot::getIterationIndex ( int  r,
int  c,
const PlotMSPage page 
) [private]

Returns the iteration for the canvas located at row, r, and column, c.

int casa::PlotMSPlot::getPageIterationCount ( const PlotMSPage page  )  [protected]
void casa::PlotMSPlot::getPlotSize ( Int &  rows,
Int &  cols 
) [private]

Return the dimensions of the plot data that this plot should hold.

void casa::PlotMSPlot::holdDrawing (  )  [protected]

Holds drawing on all plot canvases.

bool casa::PlotMSPlot::initializePlot (  )  [protected]

Initializes any internal plot objects, but does NOT set parameters or attach to canvases.

Will only be called ONCE, before assignCanvases and parametersUpdated, as long as the public initializePlot method is not overridden. Returns true for success, false for failure.

bool casa::PlotMSPlot::initializePlot ( PlotMSPages pages  ) 

Initializes the plot with the given canvases.

Initializes any internal plot objects via the protected initializePlot() method, then assigns the plot objects to the canvases via the protected assignCanvases() method, then calls parametersUpdated() to properly set the plot. Drawing is held before these operations, and then released afterwards. Returns true if all operations succeeded; false if at least one failed.

bool casa::PlotMSPlot::isCacheUpdating (  )  const

Whether a thread is currently updating the cache.

bool casa::PlotMSPlot::isIteration (  )  const

Returns true if the plot is an iteration plot.

Int casa::PlotMSPlot::iter (  )  [inline]

Definition at line 120 of file PlotMSPlot.h.

References iter_.

bool casa::PlotMSPlot::lastIter (  ) 
Record casa::PlotMSPlot::locateInfo ( int  plotIterIndex,
const Vector< PlotRegion > &  regions,
bool  showUnflagged,
bool  showFlagged,
bool  selectAll 
) const
PlotLogMessage* casa::PlotMSPlot::locateRange ( int  plotIterIndex,
const Vector< PlotRegion > &  regions,
bool  showUnflagged,
bool  showFlagged 
)
void casa::PlotMSPlot::logIter ( Int  iter,
Int  nIter 
)
void casa::PlotMSPlot::logMessage ( const QString &  msg  )  const [private]

Post a plot message to the logger.

void casa::PlotMSPlot::logPoints (  ) 
static void casa::PlotMSPlot::makeParameters ( PlotMSPlotParameters params,
PlotMSApp plotms 
) [static]

Updates the given PlotMSPlotParameters to be suitable for use with this class, using the given PlotMS parent.

static PlotMSPlotParameters casa::PlotMSPlot::makeParameters ( PlotMSApp plotms  )  [static]

Static //.

Returns a new instance of PlotMSPlotParameters suitable for use with this class, using the given PlotMS parent.

String casa::PlotMSPlot::name (  )  const

Returns a human-readable name for this plot.

Does not have to be unique.

bool casa::PlotMSPlot::nextIter (  ) 
Int casa::PlotMSPlot::nIter (  ) 
PlotMSPlot& casa::PlotMSPlot::operator= ( const PlotMSPlot copy  )  [private]
PlotMSPlotParameters& casa::PlotMSPlot::parameters (  ) 
const PlotMSPlotParameters& casa::PlotMSPlot::parameters (  )  const

Returns a reference to the plot's parameters.

void casa::PlotMSPlot::parametersHaveChanged ( const PlotMSWatchedParameters params,
int  updateFlag 
) [virtual]

Implements PlotMSParametersWatcher::parametersHaveChanged().

Updates the data parameters and then calls parametersHaveChanged_().

Implements casa::PlotMSParametersWatcher.

bool casa::PlotMSPlot::parametersHaveChanged_ ( const PlotMSWatchedParameters params,
int  updateFlag,
bool  releaseWhenDone 
) [protected]

Updates plot members for parameters specific to the child plot type.

Returns true if the drawing should be released right away; if false is returned, the child class is expect to release drawing when finished.

PlotMSApp* casa::PlotMSPlot::parent (  )  [inline]

Gets the plot's parent.

Definition at line 164 of file PlotMSPlot.h.

References itsParent_.

void casa::PlotMSPlot::plotDataChanged (  ) 

Calls the dataChanged() method on the MaskedScatterPlots.

This WILL cause a redraw of the affected canvases.

vector<MaskedScatterPlotPtr> casa::PlotMSPlot::plots (  )  const

Returns the plots assigned to this plot.

bool casa::PlotMSPlot::prevIter (  ) 
void casa::PlotMSPlot::recalculateIteration (  ) 
void casa::PlotMSPlot::releaseDrawing (  )  [protected]

Releases drawing on all plot canvases, which will also cause a redraw.

bool casa::PlotMSPlot::resetIter (  ) 
void casa::PlotMSPlot::resize ( PlotMSPages ,
uInt  rows,
uInt  cols 
)
void casa::PlotMSPlot::resizePlots ( int  rows,
int  cols 
) [private]

Adjust the amount of plot data that this plot is holding.

PlotMSRegions casa::PlotMSPlot::selectedRegions ( const vector< PlotCanvasPtr > &  canvases  )  const [protected]

Helper method for selectedRegions() and visibleSelectedRegions() that returns the selected regions for plots in the given canvases.

virtual PlotMSRegions casa::PlotMSPlot::selectedRegions (  )  const [virtual]

Returns all selected regions on all canvases associated with this plot.

void casa::PlotMSPlot::setCacheUpdating ( bool  updating  ) 

Referenced by cacheLoaded().

void casa::PlotMSPlot::setCanvasProperties ( int  row,
int  col,
PMS_PP_Cache ,
PMS_PP_Axes axes,
bool  set,
PMS_PP_Canvas canv,
uInt  rows,
uInt  cols,
PMS_PP_Iteration iter,
uInt  iteration,
PlotMSAveraging  averaging 
) [private]
void casa::PlotMSPlot::setColors (  )  [protected]
bool casa::PlotMSPlot::setIter ( int  index  ) 
void casa::PlotMSPlot::setRelease ( bool  b  ) 

This was added so that in 'mixed mode', cacheloaded will trigger a redraw of the plot.

String casa::PlotMSPlot::spectype (  )  const [inline]

Returns specialization Id for this plot.

Definition at line 108 of file PlotMSPlot.h.

bool casa::PlotMSPlot::updateCache (  )  [protected]
bool casa::PlotMSPlot::updateCanvas (  )  [protected]
bool casa::PlotMSPlot::updateData (  )  [protected]

Force data update by clearing the cache.

bool casa::PlotMSPlot::updateDisplay (  )  [protected]
bool casa::PlotMSPlot::updateIndexing (  ) 
void casa::PlotMSPlot::updateLocation (  ) 
void casa::PlotMSPlot::updatePages (  )  [protected]
void casa::PlotMSPlot::updatePlots (  ) 
vector<PlotCanvasPtr> casa::PlotMSPlot::visibleCanvases (  )  const

Returns the visible canvases (accessible via PlotMSPlotter::currentCanvases()) associated with this plot.

PlotMSRegions casa::PlotMSPlot::visibleSelectedRegions (  )  const

PlotMSPlotter::currentCanvases()) associated with this plot.

void casa::PlotMSPlot::waitForDrawing ( bool  holdDrawing  ) 

This method was written because in scripting mode, there was a segfault when the grid size was changed (for example 2 x 3 to 1x1).

It was in a draw thread that had stale data it was touching after its associated canvas was deleted. The purpose of the method is to wait for the draw threads to finish and then keep them from redrawing while the deletion is in progress.

void casa::PlotMSPlot::waitOnCanvas ( const PlotCanvasPtr canvas  )  [private]
void casa::PlotMSPlot::waitOnCanvases (  )  [protected]

Member Data Documentation

volatile bool casa::PlotMSPlot::cacheUpdating [protected]

Used to determine if a thread is running to update the cache.

Definition at line 304 of file PlotMSPlot.h.

Definition at line 352 of file PlotMSPlot.h.

Definition at line 351 of file PlotMSPlot.h.

Int casa::PlotMSPlot::iter_ [private]

Definition at line 354 of file PlotMSPlot.h.

Referenced by iter().

Definition at line 355 of file PlotMSPlot.h.

Cache.

Definition at line 301 of file PlotMSPlot.h.

Referenced by cache().

vector<vector<PlotCanvasPtr> > casa::PlotMSPlot::itsCanvases_ [private]

Note: First index for a canvas is the number of rows, second index is the column withen a grid.

Definition at line 347 of file PlotMSPlot.h.

Definition at line 349 of file PlotMSPlot.h.

Plot factory for generating plot objects as needed.

Definition at line 295 of file PlotMSPlot.h.

Parameters.

Definition at line 298 of file PlotMSPlot.h.

MEMBERS //.

PlotMS parent.

Definition at line 292 of file PlotMSPlot.h.

Referenced by cacheLoaded(), and parent().

Note: First index for a plot is the dataCount, second index is the number of iteration.

Definition at line 343 of file PlotMSPlot.h.

Definition at line 350 of file PlotMSPlot.h.

const uInt casa::PlotMSPlot::LARGE_THRESHOLD [static, private]

Definition at line 359 of file PlotMSPlot.h.

const uInt casa::PlotMSPlot::MEDIUM_THRESHOLD [static, private]

Definition at line 358 of file PlotMSPlot.h.

const uInt casa::PlotMSPlot::PIXEL_THRESHOLD [static, private]

Definition at line 357 of file PlotMSPlot.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1