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

A PlotSelectTool is a concrete subclass of PlotMouseTool that mainly handles select events. More...

#include <PlotTool.h>

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

Public Member Functions

 PlotSelectTool (PlotCoordinate::System system=PlotCoordinate::WORLD)
 Constructor which takes the tool's coordinate system. More...
 
 PlotSelectTool (PlotAxis xAxis, PlotAxis yAxis, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Constructor which takes the tool's axes and coordinate system. More...
 
virtual ~PlotSelectTool ()
 Destructor. More...
 
virtual void addNotifier (PlotSelectToolNotifier *notifier)
 Adds the given notifier. More...
 
virtual void setSelectLine (PlotLinePtr line)
 Sets the selection line to the given. More...
 
virtual void setSubtractLine (PlotLinePtr line)
 
virtual void setSelectLine (bool on=true)
 
virtual void setDrawRects (bool on=true)
 Sets the attributes for drawing selected regions. More...
 
virtual void setRectLine (PlotLinePtr line)
 
virtual void setRectFill (PlotAreaFillPtr fill)
 
virtual unsigned int numSelectedRects () const
 Selected regions. More...
 
virtual void getSelectedRects (std::vector< double > &upperLeftXs, std::vector< double > &upperLeftYs, std::vector< double > &lowerRightXs, std::vector< double > &lowerRightYs, PlotCoordinate::System system=PlotCoordinate::WORLD) const
 
virtual std::vector< PlotRegiongetSelectedRects (PlotCoordinate::System system=PlotCoordinate::WORLD) const
 
virtual void clearSelectedRects ()
 
virtual int getSelectedRectCount ()
 
virtual void setActive (bool active=true)
 Overrides PlotTool::setActive(). More...
 
virtual void handleMouseEvent (const PlotEvent &event)
 Implements PlotMouseTool::handleMouseEvent(). More...
 
bool inSubtractionMode ()
 
- 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 Attributes

bool m_subtraction_mode
 

Protected Member Functions

virtual void attach (PlotCanvas *canvas)
 Overrides PlotTool::attach(). More...
 
virtual 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...
 

Protected Attributes

std::vector
< PlotSelectToolNotifier * > 
m_notifiers
 Notifiers. More...
 
PlotLinePtr m_selLine
 Copy of selection line to set on the canvas, or NULL if none has been set. More...
 
PlotLinePtr m_subLine
 
bool m_drawRects
 Whether or not to draw selected regions on the canvas. More...
 
PlotLinePtr m_rectLine
 Line for drawing selected regions, or NULL if none has been set. More...
 
PlotAreaFillPtr m_rectFill
 Area fill for drawing selected regions, or NULL if none has been set. More...
 
std::vector
< PlotShapeRectanglePtr > 
m_rects
 Selected regions. More...
 
- 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

A PlotSelectTool is a concrete subclass of PlotMouseTool that mainly handles select events.

Note that plotting implementations may wish to override this class with an implementation-specific version that may be more efficient. PlotSelectTool is responsible for: 1) managing the select line (the line show while the user is click-dragging to select a region on the canvas) and cursors, 2) keeping track of selected regions, 3) showing/hiding the regions on the canvas, and 4) notifying any interested classes whenever the selected regions changes.

Definition at line 255 of file PlotTool.h.

Constructor & Destructor Documentation

casa::PlotSelectTool::PlotSelectTool ( PlotCoordinate::System  system = PlotCoordinate::WORLD)

Constructor which takes the tool's coordinate system.

casa::PlotSelectTool::PlotSelectTool ( PlotAxis  xAxis,
PlotAxis  yAxis,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
)

Constructor which takes the tool's axes and coordinate system.

virtual casa::PlotSelectTool::~PlotSelectTool ( )
virtual

Destructor.

Member Function Documentation

virtual void casa::PlotSelectTool::addNotifier ( PlotSelectToolNotifier *  notifier)
virtual

Adds the given notifier.

This object will be notified when the list of selected regions changes (either by adding one from the mouse, or clearing them).

virtual void casa::PlotSelectTool::attach ( PlotCanvas canvas)
protectedvirtual

Overrides PlotTool::attach().

Reimplemented from casa::PlotTool.

virtual void casa::PlotSelectTool::clearSelectedRects ( )
virtual
virtual void casa::PlotSelectTool::detach ( )
protectedvirtual

Overrides PlotTool::detach().

Reimplemented from casa::PlotTool.

virtual int casa::PlotSelectTool::getSelectedRectCount ( )
virtual
virtual void casa::PlotSelectTool::getSelectedRects ( std::vector< double > &  upperLeftXs,
std::vector< double > &  upperLeftYs,
std::vector< double > &  lowerRightXs,
std::vector< double > &  lowerRightYs,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) const
virtual
virtual std::vector<PlotRegion> casa::PlotSelectTool::getSelectedRects ( PlotCoordinate::System  system = PlotCoordinate::WORLD) const
virtual
virtual void casa::PlotSelectTool::handleMouseEvent ( const PlotEvent event)
virtual
bool casa::PlotSelectTool::inSubtractionMode ( )
inline

Definition at line 307 of file PlotTool.h.

References m_subtraction_mode.

virtual unsigned int casa::PlotSelectTool::numSelectedRects ( ) const
virtual

Selected regions.

virtual void casa::PlotSelectTool::setActive ( bool  active = true)
virtual

Overrides PlotTool::setActive().

Reimplemented from casa::PlotTool.

virtual void casa::PlotSelectTool::setDrawRects ( bool  on = true)
virtual

Sets the attributes for drawing selected regions.

virtual void casa::PlotSelectTool::setRectFill ( PlotAreaFillPtr  fill)
virtual
virtual void casa::PlotSelectTool::setRectLine ( PlotLinePtr  line)
virtual
virtual void casa::PlotSelectTool::setSelectLine ( PlotLinePtr  line)
virtual

Sets the selection line to the given.

virtual void casa::PlotSelectTool::setSelectLine ( bool  on = true)
virtual
virtual void casa::PlotSelectTool::setSubtractLine ( PlotLinePtr  line)
virtual

Member Data Documentation

bool casa::PlotSelectTool::m_drawRects
protected

Whether or not to draw selected regions on the canvas.

Definition at line 324 of file PlotTool.h.

std::vector<PlotSelectToolNotifier*> casa::PlotSelectTool::m_notifiers
protected

Notifiers.

Definition at line 316 of file PlotTool.h.

PlotAreaFillPtr casa::PlotSelectTool::m_rectFill
protected

Area fill for drawing selected regions, or NULL if none has been set.

Definition at line 330 of file PlotTool.h.

PlotLinePtr casa::PlotSelectTool::m_rectLine
protected

Line for drawing selected regions, or NULL if none has been set.

Definition at line 327 of file PlotTool.h.

std::vector<PlotShapeRectanglePtr> casa::PlotSelectTool::m_rects
protected

Selected regions.

Definition at line 333 of file PlotTool.h.

PlotLinePtr casa::PlotSelectTool::m_selLine
protected

Copy of selection line to set on the canvas, or NULL if none has been set.

Definition at line 320 of file PlotTool.h.

PlotLinePtr casa::PlotSelectTool::m_subLine
protected

Definition at line 321 of file PlotTool.h.

bool casa::PlotSelectTool::m_subtraction_mode

Definition at line 311 of file PlotTool.h.

Referenced by inSubtractionMode().


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