casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
casa::PlotMSAnnotator Class Reference

Subclass of PlotMouseTool for drawing/managing annotations on the plot canvases of PlotMSApp. More...

#include <PlotMSAnnotator.h>

Inheritance diagram for casa::PlotMSAnnotator:
casa::PlotMouseTool casa::PlotMSPlotManagerWatcher casa::PlotWheelEventHandler casa::PlotMouseMoveEventHandler casa::PlotMouseDragEventHandler casa::PlotMouseReleaseEventHandler casa::PlotMousePressEventHandler casa::PlotClickEventHandler casa::PlotSelectEventHandler casa::PlotTool

Public Types

enum  Mode {
  TEXT,
  RECTANGLE
}
 Static //. More...
 

Public Member Functions

 PlotMSAnnotator (PlotMSPlotter *parent, Mode startingMode=TEXT)
 Non-Static //. More...
 
 ~PlotMSAnnotator ()
 Destructor. More...
 
Mode drawingMode () const
 Gets/Sets the current drawing mode. More...
 
void setDrawingMode (Mode mode)
 
PlotFontPtr textFont () const
 Gets/Sets the current text properties (null means default for PlotAnnotation object). More...
 
void setTextFont (const PlotFontPtr font)
 
PlotLinePtr textOutline () const
 
void setTextOutline (const PlotLinePtr outline)
 
PlotAreaFillPtr textBackground () const
 
void setTextBackground (const PlotAreaFillPtr background)
 
PlotLinePtr rectangleLine () const
 Gets/Sets the current rectangle properties (null means default for PlotShapeRectangle object). More...
 
void setRectangleLine (const PlotLinePtr line)
 
PlotAreaFillPtr rectangleAreaFill () const
 
void setRectangleAreaFill (const PlotAreaFillPtr fill)
 
void clearText (PlotCanvas *canvas=NULL)
 Clears all text/rectangle annotations off the given canvas. More...
 
void clearRectangles (PlotCanvas *canvas=NULL)
 
void clearAll (PlotCanvas *canvas=NULL)
 
void setActive (bool isActive=true)
 Overrides PlotTool::setActive(). More...
 
void handleMouseEvent (const PlotEvent &event)
 Implements PlotMouseTool::handleMouseEvent(). More...
 
void plotsChanged (const PlotMSPlotManager &manager)
 Implements PlotMSPlotManagerWatcher::plotChanged(). More...
 
- Public Member Functions inherited from casa::PlotMouseTool
 PlotMouseTool (PlotCoordinate::System coordSys=PlotCoordinate::WORLD)
 Constructor which takes the tool's coordinate system. More...
 
 PlotMouseTool (PlotAxis xAxis, PlotAxis yAxis, PlotCoordinate::System coordSys=PlotCoordinate::WORLD)
 Constructor which takes the tool's axes and coordinate system. More...
 
virtual ~PlotMouseTool ()
 Destructor. More...
 
virtual void handleSelect (const PlotSelectEvent &event)
 Event handling methods. More...
 
virtual void handleClick (const PlotClickEvent &event)
 Handle the given event. More...
 
virtual void handleMousePress (const PlotMousePressEvent &event)
 Handle the given event. More...
 
virtual void handleMouseRelease (const PlotMouseReleaseEvent &event)
 Handle the given event. More...
 
virtual void handleMouseDrag (const PlotMouseDragEvent &event)
 Handle the given event. More...
 
virtual void handleMouseMove (const PlotMouseMoveEvent &event)
 Handle the given event. More...
 
virtual void handleWheel (const PlotWheelEvent &event)
 Handle the given event. More...
 
- Public Member Functions inherited from casa::PlotTool
 PlotTool (PlotCoordinate::System sys=PlotCoordinate::WORLD)
 Constructor which takes which coordinate system events should be processed in. More...
 
 PlotTool (PlotAxis xAxis, PlotAxis yAxis, PlotCoordinate::System sys=PlotCoordinate::WORLD)
 Constructor which takes the two axes and the coordinate system which events should be processed in. More...
 
virtual ~PlotTool ()
 Destructor. More...
 
virtual bool isActive () const
 Returns whether this tool is currently active or not. More...
 
virtual bool isBlocking () const
 Returns whether this tool is blocking or not. More...
 
virtual void setBlocking (bool blocking=true)
 Sets whether this tool is blocking or not. More...
 
virtual PlotAxis getXAxis () const
 Gets the axes on which the tool operates. More...
 
virtual PlotAxis getYAxis () const
 
virtual PlotCoordinate::System getCoordinateSystem () const
 Gets the coordinate system in which the tool wants to process events. More...
 
virtual bool lastEventWasHandled () const
 Returns whether the last event was handled or not. More...
 
virtual void reset ()
 Resets any internal state such as history/stacks. More...
 
- Public Member Functions inherited from casa::PlotSelectEventHandler
 PlotSelectEventHandler ()
 
virtual ~PlotSelectEventHandler ()
 
- Public Member Functions inherited from casa::PlotClickEventHandler
 PlotClickEventHandler ()
 
virtual ~PlotClickEventHandler ()
 
- Public Member Functions inherited from casa::PlotMousePressEventHandler
 PlotMousePressEventHandler ()
 
virtual ~PlotMousePressEventHandler ()
 
- Public Member Functions inherited from casa::PlotMouseReleaseEventHandler
 PlotMouseReleaseEventHandler ()
 
virtual ~PlotMouseReleaseEventHandler ()
 
- Public Member Functions inherited from casa::PlotMouseDragEventHandler
 PlotMouseDragEventHandler ()
 
virtual ~PlotMouseDragEventHandler ()
 
- Public Member Functions inherited from casa::PlotMouseMoveEventHandler
 PlotMouseMoveEventHandler ()
 
virtual ~PlotMouseMoveEventHandler ()
 
- Public Member Functions inherited from casa::PlotWheelEventHandler
 PlotWheelEventHandler ()
 
virtual ~PlotWheelEventHandler ()
 
- Public Member Functions inherited from casa::PlotMSPlotManagerWatcher
 PlotMSPlotManagerWatcher ()
 Constructor. More...
 
virtual ~PlotMSPlotManagerWatcher ()
 Destructor. More...
 

Protected Member Functions

void setActions (QAction *annotateAction, const QMap< PlotMSAction::Type, QAction * > &actionMap, PlotFactoryPtr factory)
 Sets the annotate and mode actions and the factory to the given. More...
 
void attach (PlotCanvas *canvas)
 Overrides PlotTool::attach(). More...
 
void detach ()
 Overrides PlotTool::detach(). More...
 
- Protected Member Functions inherited from casa::PlotTool
virtual PlotCanvascanvas () const
 Returns the canvas this tool is attached to, or NULL for none. More...
 
virtual PlotFactoryfactory () const
 Returns a factory that can be used for generating implementation-specific classes, or NULL for none. More...
 
virtual bool isAttached () const
 Returns true if this tool is attached to a canvas, false otherwise. More...
 

Private Member Functions

void setDefaults ()
 Sets properties to their defaults. More...
 

Private Attributes

PlotFactoryPtr itsFactory_
 Parent. More...
 
Mode itsMode_
 Current drawing mode. More...
 
QAction * itsAnnotateAction_
 Actions to keep updated. More...
 
QMap< Mode, QAction * > itsModeActions_
 
QMultiMap< PlotCanvas
*, PlotAnnotationPtr > 
itsAText_
 Text annotations. More...
 
PlotFontPtr itsTextFont_
 Current text properties. More...
 
PlotLinePtr itsTextOutline_
 
PlotAreaFillPtr itsTextFill_
 
QMultiMap< PlotCanvas
*, PlotShapeRectanglePtr > 
itsARect_
 Rectangle annotations. More...
 
PlotLinePtr itsRectLine_
 Current rectangle properties. More...
 
PlotAreaFillPtr itsRectFill_
 
PlotMSPlotterguiParent
 

Friends

class PlotMSPlotter
 

Additional Inherited Members

- Protected Attributes inherited from casa::PlotTool
PlotCanvasm_canvas
 Attached canvas (or NULL for none). More...
 
PlotFactorym_factory
 Factory for creating implementation-specific objects. More...
 
bool m_active
 Whether this tool is active. More...
 
bool m_blocking
 Whether this tool is blocking. More...
 
PlotAxis m_xAxis
 The tool axes. More...
 
PlotAxis m_yAxis
 
PlotCoordinate::System m_coordSystem
 The tool coordinate system. More...
 
bool m_lastEventHandled
 Last event handled flag. More...
 

Detailed Description

Subclass of PlotMouseTool for drawing/managing annotations on the plot canvases of PlotMSApp.

Definition at line 44 of file PlotMSAnnotator.h.

Member Enumeration Documentation

Static //.

Drawing mode for the annotator.

Enumerator
TEXT 
RECTANGLE 

Definition at line 53 of file PlotMSAnnotator.h.

Constructor & Destructor Documentation

casa::PlotMSAnnotator::PlotMSAnnotator ( PlotMSPlotter parent,
Mode  startingMode = TEXT 
)

Non-Static //.

Constructor which takes the PlotMS parent and optional starting mode.

casa::PlotMSAnnotator::~PlotMSAnnotator ( )

Destructor.

Member Function Documentation

void casa::PlotMSAnnotator::attach ( PlotCanvas canvas)
protectedvirtual

Overrides PlotTool::attach().

Reimplemented from casa::PlotTool.

void casa::PlotMSAnnotator::clearAll ( PlotCanvas canvas = NULL)
void casa::PlotMSAnnotator::clearRectangles ( PlotCanvas canvas = NULL)
void casa::PlotMSAnnotator::clearText ( PlotCanvas canvas = NULL)

Clears all text/rectangle annotations off the given canvas.

If the given canvas is NULL, then it clears them from all canvases.

void casa::PlotMSAnnotator::detach ( )
protectedvirtual

Overrides PlotTool::detach().

Reimplemented from casa::PlotTool.

Mode casa::PlotMSAnnotator::drawingMode ( ) const

Gets/Sets the current drawing mode.

void casa::PlotMSAnnotator::handleMouseEvent ( const PlotEvent event)
virtual
void casa::PlotMSAnnotator::plotsChanged ( const PlotMSPlotManager manager)
virtual

Implements PlotMSPlotManagerWatcher::plotChanged().

Removes annotations that are attached to canvases that no longer exist.

Implements casa::PlotMSPlotManagerWatcher.

PlotAreaFillPtr casa::PlotMSAnnotator::rectangleAreaFill ( ) const
PlotLinePtr casa::PlotMSAnnotator::rectangleLine ( ) const

Gets/Sets the current rectangle properties (null means default for PlotShapeRectangle object).

Only applies to future rectangle annotations.

void casa::PlotMSAnnotator::setActions ( QAction *  annotateAction,
const QMap< PlotMSAction::Type, QAction * > &  actionMap,
PlotFactoryPtr  factory 
)
protected

Sets the annotate and mode actions and the factory to the given.

MUST be called before the annotator is used.

void casa::PlotMSAnnotator::setActive ( bool  isActive = true)
virtual

Overrides PlotTool::setActive().

Reimplemented from casa::PlotTool.

void casa::PlotMSAnnotator::setDefaults ( )
private

Sets properties to their defaults.

void casa::PlotMSAnnotator::setDrawingMode ( Mode  mode)
void casa::PlotMSAnnotator::setRectangleAreaFill ( const PlotAreaFillPtr  fill)
void casa::PlotMSAnnotator::setRectangleLine ( const PlotLinePtr  line)
void casa::PlotMSAnnotator::setTextBackground ( const PlotAreaFillPtr  background)
void casa::PlotMSAnnotator::setTextFont ( const PlotFontPtr  font)
void casa::PlotMSAnnotator::setTextOutline ( const PlotLinePtr  outline)
PlotAreaFillPtr casa::PlotMSAnnotator::textBackground ( ) const
PlotFontPtr casa::PlotMSAnnotator::textFont ( ) const

Gets/Sets the current text properties (null means default for PlotAnnotation object).

Only applies to future text annotations.

PlotLinePtr casa::PlotMSAnnotator::textOutline ( ) const

Friends And Related Function Documentation

friend class PlotMSPlotter
friend

Definition at line 47 of file PlotMSAnnotator.h.

Member Data Documentation

PlotMSPlotter* casa::PlotMSAnnotator::guiParent
private

Definition at line 166 of file PlotMSAnnotator.h.

QAction* casa::PlotMSAnnotator::itsAnnotateAction_
private

Actions to keep updated.

Definition at line 139 of file PlotMSAnnotator.h.

QMultiMap<PlotCanvas*, PlotShapeRectanglePtr> casa::PlotMSAnnotator::itsARect_
private

Rectangle annotations.

Definition at line 154 of file PlotMSAnnotator.h.

QMultiMap<PlotCanvas*, PlotAnnotationPtr> casa::PlotMSAnnotator::itsAText_
private

Text annotations.

Definition at line 144 of file PlotMSAnnotator.h.

PlotFactoryPtr casa::PlotMSAnnotator::itsFactory_
private

Parent.

PlotMSApp* itsParent_;

Factory for generating plot objects.

Definition at line 132 of file PlotMSAnnotator.h.

Mode casa::PlotMSAnnotator::itsMode_
private

Current drawing mode.

Definition at line 135 of file PlotMSAnnotator.h.

QMap<Mode, QAction*> casa::PlotMSAnnotator::itsModeActions_
private

Definition at line 140 of file PlotMSAnnotator.h.

PlotAreaFillPtr casa::PlotMSAnnotator::itsRectFill_
private

Definition at line 159 of file PlotMSAnnotator.h.

PlotLinePtr casa::PlotMSAnnotator::itsRectLine_
private

Current rectangle properties.

Definition at line 158 of file PlotMSAnnotator.h.

PlotAreaFillPtr casa::PlotMSAnnotator::itsTextFill_
private

Definition at line 150 of file PlotMSAnnotator.h.

PlotFontPtr casa::PlotMSAnnotator::itsTextFont_
private

Current text properties.

Definition at line 148 of file PlotMSAnnotator.h.

PlotLinePtr casa::PlotMSAnnotator::itsTextOutline_
private

Definition at line 149 of file PlotMSAnnotator.h.


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