PlotView Class Reference

Displays plot objects. More...

#include <PlotView.h>

Inheritance diagram for PlotView:

Inheritance graph

List of all members.

Public Member Functions

virtual PlotType getPlotType () const =0
virtual PlotObjectcreateObject (const PlotObjectType &objectType, bool bPrimary)=0
virtual PlotObjectaddObject (const PlotObjectType &objectType, bool bPrimary)=0
virtual void getObjects (std::list< PlotObject * > &objects) const =0
virtual void getObjects (const PlotObjectType &objectType, std::list< PlotObject * > &objects) const =0
virtual bool containsObject (PlotObject *pObject) const =0
virtual unsigned int getNumObjects () const =0
virtual bool deleteObject (PlotObject *pObject)=0
virtual void clear ()=0
virtual bool moveObjectToFront (PlotObject *pObject)=0
virtual bool moveObjectToBack (PlotObject *pObject)=0
virtual bool selectObject (PlotObject *pObject, bool bSelect)=0
virtual void selectObjects (const std::list< PlotObject * > &objects, bool bSelect)=0
virtual void selectObjects (bool bSelect)=0
virtual void getSelectedObjects (std::list< PlotObject * > &selectedObjects, bool filterVisible) const =0
virtual unsigned int getNumSelectedObjects (bool filterVisible) const =0
virtual void deleteSelectedObjects (bool filterVisible)=0
virtual void setSelectionMode (PlotSelectionModeType mode)=0
virtual PlotSelectionModeType getSelectionMode () const =0
virtual PointSelectionDisplayType getSelectionDisplayMode () const =0
virtual void setSelectionDisplayMode (PointSelectionDisplayType mode)=0
virtual AnnotationLayergetAnnotationLayer () const =0
virtual LocatorgetMouseLocator ()=0
virtual const LocatorgetMouseLocator () const =0
virtual void translateWorldToData (double worldX, double worldY, double &dataX, double &dataY) const =0
virtual void translateDataToWorld (double dataX, double dataY, double &worldX, double &worldY) const =0
virtual void translateScreenToData (double screenX, double screenY, double &dataX, double &dataY) const =0
virtual void translateDataToScreen (double dataX, double dataY, double &screenX, double &screenY) const =0
virtual void setEnableShading (bool shading)=0
virtual bool isShadingEnabled () const =0
virtual void setExtentsMargin (double marginFactor)=0
virtual double getExtentsMargin () const =0

Static Public Member Functions

static PositionType getSettingClassificationMarkingPositions ()
static bool hasSettingClassificationMarkingPositions ()
static void setSettingClassificationMarkingPositions (PositionType newValue, bool setIfSame=false)
static std::string getSettingClassificationMarkingPositionsKey ()
static const std::string & signalObjectAdded ()
static const std::string & signalObjectDeleted ()
static const std::string & signalObjectSelected ()

Protected Member Functions

virtual ~PlotView ()


Detailed Description

Displays plot objects.

The plot view provides the means to display one or more plot objects. Plot objects can be added and removed from the view and can also be selected and deselected.

The plot view defines the following mouse modes, where the name given is the name populated by MouseMode::getName():

The annotation mouse mode allows users to add annotation objects to the plot. Objects can be added programatically via an annotation layer that is accessible by calling the getAnnotationLayer() method.

For the locator mouse mode, the view contains a default Locator object to display on the plot. When this mouse mode is active, the default behavior is to display the locator when the left mouse button is pressed and to hide the locator when the left mouse button is released. Access to the locator to change its properties is provided with the getMouseLocator() method.

This subclass of Subject will notify upon the following conditions:

See also:
PlotObject

Definition at line 56 of file PlotView.h.


Constructor & Destructor Documentation

virtual PlotView::~PlotView (  )  [protected, virtual]

This object should be destroyed by calling DesktopServices::deleteView().

Definition at line 516 of file PlotView.h.


Member Function Documentation

static PositionType PlotView::getSettingClassificationMarkingPositions (  )  [static]

Returns the current value for this setting.

If this setting does not exist in ConfigurationSettings, a verification error will be logged to the message log and potentially a verification error message box will be displayed to the user.

Please see Settings Macros for more details

Returns:
the current value for this setting.

Definition at line 69 of file PlotView.h.

static bool PlotView::hasSettingClassificationMarkingPositions (  )  [static]

Returns true if this setting exists and has a value in ConfigurationSettings.

Please see Settings Macros for more details

Returns:
true if this setting exists, false otherwise.

Definition at line 76 of file PlotView.h.

static void PlotView::setSettingClassificationMarkingPositions ( PositionType  newValue,
bool  setIfSame = false 
) [static]

Changes the current value of this setting to the new value.

Please see Settings Macros for more details

Parameters:
newValue the new value for this setting.
setIfSame If true, the value will be set into ConfigurationSettings even if the newValue and existing value are the same. This has the side-effect of making the value a per-user setting and stored in the user's configuration file. If false, this value will only be set if the newValue and existing value are different. Therefore the value will only be stored in the user's configuration file if the newValue is unique to the user.

Definition at line 92 of file PlotView.h.

static std::string PlotView::getSettingClassificationMarkingPositionsKey (  )  [static]

Returns the key for this setting that could be passed to ConfigurationSettings::getSetting() or ConfigurationSettings::setSetting().

Please see Settings Macros for more details

Returns:
the key used for this setting.

Definition at line 100 of file PlotView.h.

static const std::string& PlotView::signalObjectAdded (  )  [static]

Emitted with any<PlotObject*> when an object is added to the plot.

Definition at line 105 of file PlotView.h.

static const std::string& PlotView::signalObjectDeleted (  )  [static]

Emitted with any<PlotObject*> when an object is deleted from the plot.

Definition at line 110 of file PlotView.h.

static const std::string& PlotView::signalObjectSelected (  )  [static]

Emitted with any<pair<PlotObject*,bool> > when an object is selected or deselected in the plot.

Definition at line 115 of file PlotView.h.

virtual PlotType PlotView::getPlotType (  )  const [pure virtual]

Returns the plot type.

Returns:
The plot type.
See also:
PlotType

virtual PlotObject* PlotView::createObject ( const PlotObjectType objectType,
bool  bPrimary 
) [pure virtual]

Creates a new object but doesn't add it to the plot.

This method creates a new object of the given type. The object can be created as a primary object or secondary object. A primary plot object is one that appears in the foreground of the plot and has an entry in the legend. Most objects added to a plot will be primary objects, but sometimes objects such as gridlines can be created as secondary objects so that they will not be included with the main data objects in the plot.

Parameters:
objectType The type of plot object to add.
bPrimary Set this value to TRUE to create a primary object or FALSE to create a secondary object.
Returns:
A pointer to the new plot object. NULL is returned if an error occurred and the object could not be added.

virtual PlotObject* PlotView::addObject ( const PlotObjectType objectType,
bool  bPrimary 
) [pure virtual]

Adds a new object to the plot.

This method adds a new object of the given type to the plot with the given type. The object can be created as a primary object or secondary object. A primary plot object is one that appears in the foreground of the plot and has an entry in the legend. Most objects added to a plot will be primary objects, but sometimes objects such as gridlines can be created as secondary objects so that they will not be included with the main data objects in the plot.

Parameters:
objectType The type of plot object to add.
bPrimary Set this value to TRUE to create a primary object or FALSE to create a secondary object.
Returns:
A pointer to the new plot object. NULL is returned if an error occurred and the object could not be added.
Subject Notifications:
This method will notify signalObjectAdded() with any<PlotObject*>.

virtual void PlotView::getObjects ( std::list< PlotObject * > &  objects  )  const [pure virtual]

Retrieves all objects in the plot.

Parameters:
objects A list that is populated with pointers to all objects in the plot.

virtual void PlotView::getObjects ( const PlotObjectType objectType,
std::list< PlotObject * > &  objects 
) const [pure virtual]

Retrieves objects in the plot of a given type.

Parameters:
objectType The plot object type for which to retrieve the current objects.
objects A list that is populated with pointers to all objects in the plot of the given type.

virtual bool PlotView::containsObject ( PlotObject pObject  )  const [pure virtual]

Queries whether an object exists in this plot.

Parameters:
pObject The object for which to query the plot.
Returns:
TRUE if this plot contains the object, otherwise FALSE.

virtual unsigned int PlotView::getNumObjects (  )  const [pure virtual]

Returns the number of objects in the plot.

Returns:
The total number of objects in the plot.

virtual bool PlotView::deleteObject ( PlotObject pObject  )  [pure virtual]

Removes an object from the plot and deletes it.

Parameters:
pObject The annotation object to delete.
Returns:
TRUE if the object was successfully removed and deleted, otherwise FALSE.
See also:
clear()
Subject Notifications:
This method will notify signalObjectDeleted() with any<PlotObject*>.

virtual void PlotView::clear (  )  [pure virtual]

Removes all objects from the plot.

virtual bool PlotView::moveObjectToFront ( PlotObject pObject  )  [pure virtual]

Moves a given object to the front of the plot.

This method repositions the given object to be the topmost object in the plot.

Parameters:
pObject The object to move to the front of the plot.
See also:
moveObjectToBack()

virtual bool PlotView::moveObjectToBack ( PlotObject pObject  )  [pure virtual]

Moves a given object to the back of the plot.

This method repositions the given object to be the bottommost object in the plot. If the object is a primary object, it will still be on top of any secondary objects.

Parameters:
pObject The object to move to the back of the plot.
See also:
moveObjectToFront()

virtual bool PlotView::selectObject ( PlotObject pObject,
bool  bSelect 
) [pure virtual]

Selects or deselects an object in the plot.

This method sets a given plot object as selected and may alter how the object is drawn in the plot. This is done mainly for user feedback that the object is selected. For some objects, like the histogram, selecting the object does nothing.

Parameters:
pObject The plot object to select. Cannot be NULL.
bSelect Set this value to TRUE to select the object or FALSE to deselect the object.
Returns:
TRUE if the object was successfully selected or deselected, otherwise FALSE.
See also:
selectObjects()
Subject Notifications:
This method will notify signalObjectSelected() with any<pair<PlotObject*,bool> >.

virtual void PlotView::selectObjects ( const std::list< PlotObject * > &  objects,
bool  bSelect 
) [pure virtual]

Selects or deselects multiple objects in the plot.

Parameters:
objects The plot objects to select.
bSelect Set this value to TRUE to select the objects or FALSE to deselect the objects.
See also:
selectObject()
Subject Notifications:
This method will notify signalObjectSelected() with any<pair<PlotObject*,bool> > for each object selected or deselected.

virtual void PlotView::selectObjects ( bool  bSelect  )  [pure virtual]

Selects or deselects all objects in the plot.

Parameters:
bSelect Set this value to TRUE to select the objects or FALSE to deselect the objects.
See also:
selectObject()
Subject Notifications:
This method will notify signalObjectSelected() with any<pair<PlotObject*,bool> > for each object selected or deselected.

virtual void PlotView::getSelectedObjects ( std::list< PlotObject * > &  selectedObjects,
bool  filterVisible 
) const [pure virtual]

Retrieves the currently selected objects on the plot.

Parameters:
selectedObjects A list that is populated with pointers to selected plot objects.
filterVisible True if selectedObjects should contain only visible objects.
See also:
getNumSelectedObjects()

virtual unsigned int PlotView::getNumSelectedObjects ( bool  filterVisible  )  const [pure virtual]

Returns the number of selected objects in the plot.

Parameters:
filterVisible True if the count should only include visible objects
Returns:
The number of selected objects in the plot.

virtual void PlotView::deleteSelectedObjects ( bool  filterVisible  )  [pure virtual]

Removes all selected objects from the plot and deletes them.

Parameters:
filterVisible True if it should delete only visible selected objects.
See also:
deleteObject()
Subject Notifications:
This method will notify signalObjectDeleted() with any<PlotObject*> for each object deleted.

virtual void PlotView::setSelectionMode ( PlotSelectionModeType  mode  )  [pure virtual]

Set the selection mode for this plot.

Parameters:
mode The new selection mode.

virtual PlotSelectionModeType PlotView::getSelectionMode (  )  const [pure virtual]

Get the selection mode for this plot.

Returns:
The current selection mode.

virtual PointSelectionDisplayType PlotView::getSelectionDisplayMode (  )  const [pure virtual]

Get the selection display mode for this plot.

Returns:
The current selection mode.

virtual void PlotView::setSelectionDisplayMode ( PointSelectionDisplayType  mode  )  [pure virtual]

Set the selection display mode for this plot.

Parameters:
mode The new selection mode.

virtual AnnotationLayer* PlotView::getAnnotationLayer (  )  const [pure virtual]

Returns the annotation layer for the plot.

The annotation layer is drawn on top of the data objects and the gridlines. The layer can be modified, but ownership remains with the plot view.

Returns:
A pointer to the annotation layer.

virtual Locator* PlotView::getMouseLocator (  )  [pure virtual]

Returns the mouse locator object used in the "LocatorMode" mouse mode.

Returns:
A pointer to the locator object.

virtual const Locator* PlotView::getMouseLocator (  )  const [pure virtual]

Returns read-only access to the mouse locator object used in the "LocatorMode" mouse mode.

Returns:
A const pointer to the locator object. The locator object represented by the returned pointer should not be modified. To modify the values, call the non-const version of getMouseLocator().

virtual void PlotView::translateWorldToData ( double  worldX,
double  worldY,
double &  dataX,
double &  dataY 
) const [pure virtual]

Translate from world coordinates to data coordinates for this plot.

Parameters:
worldX World x-coordinate
worldY World y-coordinate
dataX X-coordinate of the plot
dataY Y-coordinate of the plot

virtual void PlotView::translateDataToWorld ( double  dataX,
double  dataY,
double &  worldX,
double &  worldY 
) const [pure virtual]

Translate from data coordinates to world coordinates for this plot.

Parameters:
dataX X-coordinate of the plot
dataY Y-coordinate of the plot
worldX World x-coordinate
worldY World y-coordinate

virtual void PlotView::translateScreenToData ( double  screenX,
double  screenY,
double &  dataX,
double &  dataY 
) const [pure virtual]

Translate from screen coordinates to data coordinates for this plot.

Parameters:
screenX Screen x-coordinate
screenY Screen y-coordinate
dataX X-coordinate of the plot
dataY Y-coordinate of the plot

virtual void PlotView::translateDataToScreen ( double  dataX,
double  dataY,
double &  screenX,
double &  screenY 
) const [pure virtual]

Translate from data coordinates to screen coordinates for this plot.

Parameters:
dataX X-coordinate of the plot
dataY Y-coordinate of the plot
screenX Screen x-coordinate
screenY Screen y-coordinate

virtual void PlotView::setEnableShading ( bool  shading  )  [pure virtual]

Enables or disables shading when displaying pointset lines.

Parameters:
shading Set to true to enable GL_SMOOTH shading when drawing pointset lines. The default is to disable shading (GL_FLAT).

virtual bool PlotView::isShadingEnabled (  )  const [pure virtual]

Returns true if shading is enabled, otherwise false.

Returns:
True if shading is enabled, otherwise false.

virtual void PlotView::setExtentsMargin ( double  marginFactor  )  [pure virtual]

Sets a margin around the overall plot extents.

The plot extents as returned by getExtents() is calculated based on the extents of all primary plot objects it contains. An additional amount can be added to the plot extents by specifying a margin factor that is multiplied to the data range of the object extents. For example a margin factor of 0.01 subtracts one percent of the data range from the minimum value and adds one percent of the data range to the maximum value.

Calling this method sets the margin for both X and Y dimensions.

The default margin factor is 0.0.

Parameters:
marginFactor The factor that should be multiplied by the data range to use as additional margin around the plot objects. If the given value is less than zero, the margin factor is set to 0.0.

virtual double PlotView::getExtentsMargin (  )  const [pure virtual]

Returns the margin around the overall plot extents.

Returns:
The factor that is multiplied by the data range to use as additional margin around the plot objects.
See also:
setExtentsMargin()


Software Development Kit - Opticks 4.9.0 Build 16218