PlotWidget Class Reference

A widget to display plot and associated information. More...

#include <PlotWidget.h>

Inheritance diagram for PlotWidget:

Inheritance graph

List of all members.

Public Member Functions

virtual std::list
< ContextMenuAction
getContextMenuActions () const =0
virtual const QWidget * getWidget () const =0
virtual QWidget * getWidget ()=0
virtual PlotSetgetPlotSet () const =0
virtual PlotViewgetPlot () const =0
virtual void setBackgroundColor (const ColorType &backgroundColor)=0
virtual ColorType getBackgroundColor () const =0
virtual void setClassificationPosition (PositionType ePosition)=0
virtual PositionType getClassificationPosition () const =0
virtual void setClassification (const Classification *pClassification)=0
virtual ClassificationgetClassification ()=0
virtual const ClassificationgetClassification () const =0
virtual std::string getClassificationText () const =0
virtual void setClassificationFont (const Font &font)=0
virtual const FontgetClassificationFont () const =0
virtual void setClassificationColor (const ColorType &classificationColor)=0
virtual ColorType getClassificationColor () const =0
virtual void setOrganizationPosition (PositionType ePosition)=0
virtual PositionType getOrganizationPosition () const =0
virtual void setOrganizationText (const std::string &strOrganization)=0
virtual std::string getOrganizationText () const =0
virtual void setOrganizationFont (const Font &font)=0
virtual const FontgetOrganizationFont () const =0
virtual void setOrganizationColor (const ColorType &clrOrganization)=0
virtual ColorType getOrganizationColor () const =0
virtual void setTitle (const std::string &title)=0
virtual std::string getTitle () const =0
virtual void setTitleFont (const Font &font)=0
virtual const FontgetTitleFont () const =0
virtual void showAxis (AxisPosition axis, bool bShow)=0
virtual bool isAxisShown (AxisPosition axis) const =0
virtual AxisgetAxis (AxisPosition axis) const =0
virtual void showLegend (bool bShow)=0
virtual bool isLegendShown () const =0
virtual void setLegendBackgroundColor (const ColorType &backgroundColor)=0
virtual ColorType getLegendBackgroundColor () const =0
virtual bool getCurrentImage (QImage &image)=0
virtual void print (bool bPrintDialog=true)=0

Static Public Member Functions

static const std::string & signalAboutToShowContextMenu ()

Protected Member Functions

virtual ~PlotWidget ()


Detailed Description

A widget to display plot and associated information.

The plot widget contains a plot view and several additional widgets to display information about the plot. The plot widget contains a title, the plot view, classification markings, axes, and a legend. The axes are displayed only for Cartesian plots and not polar plots.

When the user right-clicks in the plot widget, a context menu is invoked allowing the user to change the display characteristics of the widget.

Warning:
The PlotView::signalAboutToShowContextMenu() signal is not emitted when the user right-clicks in the plot widget.
This subclass of Subject will notify upon the following conditions:

See also:
PlotView

Definition at line 63 of file PlotWidget.h.


Constructor & Destructor Documentation

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

This object should be destroyed by calling PlotSet::deletePlot() or DesktopServices::deletePlotWidget().

Definition at line 526 of file PlotWidget.h.


Member Function Documentation

static const std::string& PlotWidget::signalAboutToShowContextMenu (  )  [static]

Emitted with boost::any<ContextMenu*> when the user right-clicks to invoke a context menu.

This signal provides a means by which an object can be notified when a context menu is invoked by the user clicking inside a plot widget. To receive notification for when a context menu is invoked when the user clicks on any session item, attach to the DesktopServices::signalAboutToShowContextMenu() signal instead.

This signal is emitted after getContextMenuActions() is called and after the DesktopServices::signalAboutToShowContextMenu() signal is emitted, but before the context menu is shown to give attached objects a chance to add or modify the context menu that will be displayed to the user.

The ContextMenu pointer value is guaranteed to be non-NULL. The session items vector in the context menu contains the plot widget and the plot view.

See also:
Context menu calling sequence

Definition at line 88 of file PlotWidget.h.

virtual std::list<ContextMenuAction> PlotWidget::getContextMenuActions (  )  const [pure virtual]

Returns the context menu actions available for this session item.

Returns:
The list of context menu actions that should be displayed when the user right-clicks on a widget displaying or containing the session item.
See also:
ContextMenuAction

Default Implementation:
The default implementation returns the context menu actions listed here. The default actions can be removed or additional actions can be added by attaching to the signalAboutToShowContextMenu() signal.

Implements SessionItem.

virtual const QWidget* PlotWidget::getWidget (  )  const [pure virtual]

Returns the plot widget as a Qt widget.

This method returns the plot widget as a Qt widget, which can then be used to add the plot widget to a custom dialog or widget layout.

Returns:
A pointer to the plot widget.

virtual QWidget* PlotWidget::getWidget (  )  [pure virtual]

Returns the plot widget as a Qt widget.

This method returns the plot widget as a Qt widget, which can then be used to add the plot widget to a custom dialog or widget layout.

Returns:
A pointer to the plot widget.

virtual PlotSet* PlotWidget::getPlotSet (  )  const [pure virtual]

Returns the plot set that contains this plot widget.

Returns:
A pointer to the plot set. NULL is returned if this plot widget is not contained in a plot set.
See also:
PlotSet

virtual PlotView* PlotWidget::getPlot (  )  const [pure virtual]

Returns the plot view inside of the widget.

Returns:
A pointer to the plot view.
See also:
PlotView

virtual void PlotWidget::setBackgroundColor ( const ColorType backgroundColor  )  [pure virtual]

Sets the background color of the plot widget.

This method sets the background color of the plot widget, but does not set the background color of the plot area or the legend.

Parameters:
backgroundColor The new plot widget background color, which must be valid.
Subject Notifications:
This method will notify Subject::signalModified().
See also:
setLegendBackgroundColor(), PlotView::setBackgroundColor()

virtual ColorType PlotWidget::getBackgroundColor (  )  const [pure virtual]

Returns the background color of the plot widget.

The background color of the plot widget is separate from the background color of the plot area and legend.

Returns:
The current background color of the plot widget.
See also:
getLegendBackgroundColor(), PlotView::getBackgroundColor()

virtual void PlotWidget::setClassificationPosition ( PositionType  ePosition  )  [pure virtual]

Sets the position of the classification label.

The position value is maintained by the plot view even though the PlotWidget actually draws the classification text. The new position is set in the plot view.

Parameters:
ePosition The position of the label.
Subject Notifications:
This method will notify Subject::signalModified() if the position is different from the previous position.
Warning:
If the classification text label position and the organization text label position contain an overlap (i.e.: both labels are set to appear in the same location), the color and font of the classification text will be used for display in the overlapping areas (the color and font of the organization text will be ignored).
See also:
PositionType, View::setClassificationPosition()

virtual PositionType PlotWidget::getClassificationPosition (  )  const [pure virtual]

Gets the position of the classification label.

The position value is maintained by the plot view even though the PlotWidget actually draws the classification text at the position stored in the plot view.

Returns:
The position of the label.
See also:
PositionType, View::getClassificationPosition()

virtual void PlotWidget::setClassification ( const Classification pClassification  )  [pure virtual]

Sets the classification for this plot widget.

This method is a convenience method that sets the classification of the PlotView.

Parameters:
pClassification A pointer to the classification object from which to set the widget's text markings. The classification text is cleared if the given classification object pointer is NULL or if the object is invalid.
Subject Notifications:
This method will notify Subject::signalModified().
See also:
View::setClassification(), Classification

virtual Classification* PlotWidget::getClassification (  )  [pure virtual]

Returns a pointer to the plot widget's classification object.

The classification object documents how the data in the plot widget is to be handled and/or restricted.

This is a convenience method that returns the classification object that is stored in the PlotView object.

Returns:
A pointer to the plot widget's classification object.
See also:
View::getClassification(), Classification

virtual const Classification* PlotWidget::getClassification (  )  const [pure virtual]

Returns read-only access to the plot widget's classification object.

The classification object documents how the data in the plot widget is to be handled and/or restricted.

This is a convenience method that returns the classification object that is stored in the PlotView object.

Returns:
A const pointer to the plot widgets's classification object. The classification represented by the returned pointer should not be modified. To modify the values, call the non-const version of getClassification() instead.
See also:
View::getClassification(), Classification

virtual std::string PlotWidget::getClassificationText (  )  const [pure virtual]

Returns a text string containing the classification text of the plot widget.

Returns:
A string containing the classification text.

virtual void PlotWidget::setClassificationFont ( const Font font  )  [pure virtual]

Sets the font for the classification text.

Parameters:
font The new classification font.
Subject Notifications:
This method will notify Subject::signalModified().

virtual const Font& PlotWidget::getClassificationFont (  )  const [pure virtual]

Returns read-only access to the classification text font.

Returns:
The current classification text font. To modify the font values, call setClassificationFont() instead.

virtual void PlotWidget::setClassificationColor ( const ColorType classificationColor  )  [pure virtual]

Sets the classification text label color.

Parameters:
classificationColor The new classification text label color.
Subject Notifications:
This method will notify Subject::signalModified().

virtual ColorType PlotWidget::getClassificationColor (  )  const [pure virtual]

Returns the color of the classification text label.

Returns:
The classification text label color.

virtual void PlotWidget::setOrganizationPosition ( PositionType  ePosition  )  [pure virtual]

Sets the position of the organization label.

Parameters:
ePosition The position of the label.
Subject Notifications:
This method will notify Subject::signalModified() if the position is different from the previous position.
Warning:
If the classification text label position and the organization text label position contain an overlap (i.e.: both labels are set to appear in the same location), the color and font of the classification text will be used for display in the overlapping areas (the color and font of the organization text will be ignored).
See also:
PositionType

virtual PositionType PlotWidget::getOrganizationPosition (  )  const [pure virtual]

Gets the position of the organization label.

Returns:
The position of the label.
See also:
PositionType

virtual void PlotWidget::setOrganizationText ( const std::string &  strOrganization  )  [pure virtual]

Sets the organization text label.

Parameters:
strOrganization The text label.
Subject Notifications:
This method will notify Subject::signalModified().

virtual std::string PlotWidget::getOrganizationText (  )  const [pure virtual]

Gets the organization text label.

Returns:
The text label.

virtual void PlotWidget::setOrganizationFont ( const Font font  )  [pure virtual]

Sets the font for the organization text.

Parameters:
font The new organization font.
Subject Notifications:
This method will notify Subject::signalModified().

virtual const Font& PlotWidget::getOrganizationFont (  )  const [pure virtual]

Returns read-only access to the organization text font.

Returns:
The current organization text font. To modify the font values, call setOrganizationFont() instead.

virtual void PlotWidget::setOrganizationColor ( const ColorType clrOrganization  )  [pure virtual]

Sets the organization label color.

Parameters:
clrOrganization The new label color.
Subject Notifications:
This method will notify Subject::signalModified().

virtual ColorType PlotWidget::getOrganizationColor (  )  const [pure virtual]

Gets the organization label color.

Returns:
The label color.

virtual void PlotWidget::setTitle ( const std::string &  title  )  [pure virtual]

Sets the plot title text.

The plot title appears above the plot view and below the classification and organization text.

Parameters:
title The new title text.
Subject Notifications:
This method will notify Subject::signalModified() if the given title is different than the current title.

virtual std::string PlotWidget::getTitle (  )  const [pure virtual]

Returns the plot title text.

Returns:
The plot title.

virtual void PlotWidget::setTitleFont ( const Font font  )  [pure virtual]

Sets the font for the title text.

Parameters:
font The new title font.
Subject Notifications:
This method will notify Subject::signalModified() if the given font is different than the current font.

virtual const Font& PlotWidget::getTitleFont (  )  const [pure virtual]

Returns read-only access to the title text font.

Returns:
The current title text font. To modify the font values, call setTitleFont() instead.

virtual void PlotWidget::showAxis ( AxisPosition  axis,
bool  bShow 
) [pure virtual]

Toggles the display state of an axis widget.

This method shows or hides an axis widget if a CartesianPlot is displayed. This method does nothing if a PolarPlot is displayed.

Parameters:
axis The position for which to show or hide the axis.
bShow Set this parameter to true to show the axis or to false to hide the axis.

virtual bool PlotWidget::isAxisShown ( AxisPosition  axis  )  const [pure virtual]

Queries the display state of an axis widget.

This method queries the display state of an axis widget if a CartesianPlot is displayed.

Parameters:
axis The position for which to query the axis display state.
Returns:
Returns true if the axis in the given position is shown, or returns false if the axis is hidden or if a PolarPlot is displayed.

virtual Axis* PlotWidget::getAxis ( AxisPosition  axis  )  const [pure virtual]

Retrieves an axis widget.

Parameters:
axis The position for which to get the axis.
Returns:
Returns a pointer to the axis widget in the given position. This method always returns NULL if a PolarPlot is displayed.

virtual void PlotWidget::showLegend ( bool  bShow  )  [pure virtual]

Sets the display state of the plot legend.

Parameters:
bShow Set this value to true to show the legend or to false to hide the legend.

virtual bool PlotWidget::isLegendShown (  )  const [pure virtual]

Queries the display state of the plot legend.

Returns:
Returns true if the legend is displayed, or false if the legend is hidden.

virtual void PlotWidget::setLegendBackgroundColor ( const ColorType backgroundColor  )  [pure virtual]

Sets the background color of the legend.

This method sets the background color of the legend, which is separate from the background color of the plot widget and plot area.

Parameters:
backgroundColor The new legend background color, which must be valid.
Subject Notifications:
This method will notify Subject::signalModified().
See also:
setBackgroundColor(), PlotView::setBackgroundColor()

virtual ColorType PlotWidget::getLegendBackgroundColor (  )  const [pure virtual]

Returns the background color of the legend.

The background color of the legend is separate from the background color of the plot widget and plot area.

Returns:
The current background color of the legend.
See also:
getBackgroundColor(), PlotView::getBackgroundColor()

virtual bool PlotWidget::getCurrentImage ( QImage &  image  )  [pure virtual]

Retrieves an image of the plot widget.

This method retrieves the image data for the plot widget. This is similar to taking a screen snapshot of the widget.

Parameters:
image A Qt image reference that is populated with the current plot widget image. If a null image is passed in, the size of the image will be equal to the size of the plot widget in screen pixels. Otherwise, the widget will be scaled to the image size when generating the image data.
Returns:
Returns true if a valid image was successfully retrieved, otherwise returns false.

virtual void PlotWidget::print ( bool  bPrintDialog = true  )  [pure virtual]

Sends the current widget image to the printer.

Parameters:
bPrintDialog Set this value to true to display the print options dialog before printing.


Software Development Kit - Opticks 4.9.0 Build 16218