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

WorldCanvas event-based ellipse region drawer. More...

#include <MultiEllipseToolImpl.h>

Inheritance diagram for casa::MultiEllipseToolImpl:
casa::MultiEllipseTool casa::MultiRectTool casa::RegionTool casa::DTVisible casa::viewer::RegionCreator casa::MultiWCTool casa::DisplayTool casa::WCPositionEH casa::WCMotionEH casa::WCRefreshEH casa::DisplayEH casa::QtELRegion casa::QtEllipseTool

Public Member Functions

 MultiEllipseToolImpl (viewer::RegionSourceFactory *rf, PanelDisplay *pd, Display::KeySym keysym=Display::K_Pointer_Button2)
 Constructor. More...
 
virtual ~MultiEllipseToolImpl ()
 Destructor. More...
 
virtual void handleEvent (DisplayEvent &ev)
 handle events, via new-style interface. More...
 
- Public Member Functions inherited from casa::MultiEllipseTool
 MultiEllipseTool (viewer::RegionSourceFactory *rsf, PanelDisplay *pd, Display::KeySym keysym=Display::K_Pointer_Button1, const casacore::Bool persistent=false)
 Constructor. More...
 
virtual ~MultiEllipseTool ()
 Destructor. More...
 
const std::set
< viewer::region::RegionTypes > & 
regionsCreated () const
 returns a set which indicates regions this creator creates... More...
 
RegionToolTypes type () const
 
- Public Member Functions inherited from casa::MultiRectTool
 MultiRectTool (viewer::RegionSourceFactory *rsf, PanelDisplay *pd, Display::KeySym keysym=Display::K_Pointer_Button1, const casacore::Bool persistent=false)
 Constructor. More...
 
virtual ~MultiRectTool ()
 Destructor. More...
 
virtual void disable ()
 Switch the tool off - this erases the rectangle, if any, and calls the base class disable. More...
 
virtual void reset (casacore::Bool skipRefresh=false)
 reset to non-existent, non-active rectangle. More...
 
virtual casacore::Bool rectangleDefined ()
 Is a rectangle currently defined? More...
 
viewer::RegionSourcegetRegionSource ()
 
void checkPoint (WorldCanvas *wc, State &state)
 this is a non-const function because a non-const RegionTool ptr is returned in 'state' which can then be used for setting the state of the regions managed by the various tools.... More...
 
void revokeRegion (viewer::Region *)
 called when the user (read GUI user) indicates that a region should be deleted... More...
 
const std::set
< viewer::region::RegionTypes > & 
regionsCreated () const
 returns a set which indicates regions this creator creates... More...
 
bool create (viewer::region::RegionTypes, WorldCanvas *, const std::vector< std::pair< double, double > > &, const std::string &, viewer::region::TextPosition, const std::vector< int > &, const std::string &, int, int, const std::string &, const std::string &, viewer::region::LineStyle, unsigned int, bool, VOID *)
 create regions of various types (e.g. More...
 
RegionToolTypes type () const
 
- Public Member Functions inherited from casa::RegionTool
 RegionTool (Display::KeySym keysym=Display::K_Pointer_Button1)
 Constructor taking the primary key to which this tool will respond. More...
 
 ~RegionTool ()
 
void otherKeyReleased (const WCPositionEvent &)
 
void enable ()
 DISPLAY_PURE_VIRTUAL(RegionTool::create,true);. More...
 
- Public Member Functions inherited from casa::MultiWCTool
 MultiWCTool (const Display::KeySym &keysym=Display::K_Pointer_Button1, bool enable_events=true)
 Constructor taking the primary key to which this tool will respond. More...
 
virtual ~MultiWCTool ()
 Destructor. More...
 
virtual void addWorldCanvas (WorldCanvas &worldcanvas)
 Add/remove a WorldCanvas from the control of this tool. More...
 
virtual void removeWorldCanvas (WorldCanvas &worldcanvas)
 
virtual void addWorldCanvases (PanelDisplay *pdisp)
 Add/Remove a list of WorldCanvases from PanelDisplay. More...
 
virtual void removeWorldCanvases (PanelDisplay *pdisp)
 
virtual void operator() (const WCPositionEvent &ev)
 Required operators for event handling - these are called when events occur, and distribute the events to the "user-level" methods. More...
 
virtual void operator() (const WCMotionEvent &ev)
 default sends event to cout More...
 
virtual void operator() (const WCRefreshEvent &ev)
 original handler interface (still used for WCRefreshEvents) More...
 
- Public Member Functions inherited from casa::DisplayTool
virtual ~DisplayTool ()
 Destructor. More...
 
virtual void setKey (const Display::KeySym &keysym)
 Set/get which key to catch. More...
 
virtual Display::KeySym getKey () const
 
- Public Member Functions inherited from casa::WCPositionEH
 WCPositionEH ()
 Default Constructor Required. More...
 
virtual ~WCPositionEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::WCMotionEH
 WCMotionEH ()
 Default Constructor Required. More...
 
virtual ~WCMotionEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::WCRefreshEH
 WCRefreshEH ()
 Default Constructor Required. More...
 
virtual ~WCRefreshEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::DisplayEH
virtual ~DisplayEH ()
 
- Public Member Functions inherited from casa::DTVisible
 DTVisible ()
 Default constructor. More...
 
virtual ~DTVisible ()
 Destructor. More...
 
virtual casacore::String drawColor () const
 Return the color to use. More...
 
virtual casacore::Int lineWidth () const
 Return the line width to use. More...
 
virtual casacore::Double doubleClickInterval () const
 Return the double click interval (in seconds). More...
 
- Public Member Functions inherited from casa::viewer::RegionCreator
 RegionCreator ()
 DISPLAY_PURE_VIRTUAL(RegionCreator::create,true);. More...
 
virtual ~RegionCreator ()
 

Protected Member Functions

virtual void doubleInside ()
 Handle double-click inside the ellipse. More...
 
virtual void regionReady ()
 This function is called when a region is deliberately "finished" by the user. More...
 
void getWorldCoords (casacore::Vector< casacore::Double > &blc, casacore::Vector< casacore::Double > &trc)
 get the world coords of the current elliptical region More...
 
void getLinearCoords (casacore::Vector< casacore::Double > &blc, casacore::Vector< casacore::Double > &trc)
 get the linear coords of the current elliptical region More...
 
- Protected Member Functions inherited from casa::MultiEllipseTool
bool checkType (viewer::region::RegionTypes t)
 
virtual std::shared_ptr
< viewer::Rectangle
allocate_region (WorldCanvas *wc, double x1, double y1, double x2, double y2, VOID *region_specific_state) const
 
- Protected Member Functions inherited from casa::MultiRectTool
virtual void keyPressed (const WCPositionEvent &ev)
 Functions called by the base class event handling operators–and normally only those. More...
 
virtual void keyReleased (const WCPositionEvent &ev)
 
virtual void otherKeyPressed (const WCPositionEvent &ev)
 
virtual void moved (const WCMotionEvent &ev, const viewer::region::region_list_type &)
 
virtual void draw (const WCRefreshEvent &, const viewer::region::region_list_type &)
 draw the rectangle (if any) on the object's currently active WC. More...
 
virtual void doubleOutside ()
 
virtual void rectangleReady ()
 Called when a rectangle is ready and not being edited. More...
 
virtual void get (casacore::Int &x1, casacore::Int &y1, casacore::Int &x2, casacore::Int &y2) const
 Retrieve the rectangle coordinates, in screen pixels. More...
 
- Protected Member Functions inherited from casa::MultiWCTool
virtual void updateRegion ()
 
virtual void clicked (casacore::Int, casacore::Int)
 
virtual void doubleClicked (casacore::Int, casacore::Int)
 
virtual void refresh ()
 Copy back-to-front buffer (erasing all MWCTool drawings), then cause this (and all MWCTools on current WC's PC) to draw (or not draw) themselves, according to their current state. More...
 
virtual void setClipToDrawArea ()
 Cause subsequent drawing commands to be clipped to the current WC (or its drawing area). More...
 
virtual void setClipToWC ()
 
virtual void resetClip ()
 
- Protected Member Functions inherited from casa::DisplayTool
 DisplayTool (const Display::KeySym &keysym=Display::K_Pointer_Button1)
 
Constructor taking a key to which this tool will initially be

attached, typically one of the pointer buttons. More...

 
 DisplayTool (const DisplayTool &other)
 Copy constructor - construct a new DisplayTool from other, using copy semantics. More...
 
DisplayTooloperator= (const DisplayTool &other)
 Copy assignment using copy semantics. More...
 
Display::KeyModifier keyModifiers ()
 Return the modifier mask. More...
 
- Protected Member Functions inherited from casa::DTVisible
 DTVisible (const DTVisible &other)
 (Required) copy constructor. More...
 
DTVisibleoperator= (const DTVisible &other)
 (Required) copy assignment. More...
 

Additional Inherited Members

- Public Types inherited from casa::RegionTool
enum  RegionToolTypes {
  POLYTOOL,
  RECTTOOL,
  POINTTOOL,
  ELLIPSETOOL,
  POLYLINETOOL,
  PVLINETOOL
}
 
typedef std::map
< viewer::Region
*, viewer::region::PointInfo
region_map_type
 
- Public Types inherited from casa::viewer::RegionCreator
typedef std::list
< RegionCreator * > 
creator_list_type
 
- Static Public Member Functions inherited from casa::viewer::RegionCreator
static const creator_list_typefindCreator (region::RegionTypes type)
 
- Protected Attributes inherited from casa::MultiRectTool
viewer::RegionSourcerfactory
 
- Protected Attributes inherited from casa::MultiWCTool
WorldCanvasitsCurrentWC
 WC being (or to be) drawn on (may be 0 initially). More...
 

Detailed Description

WorldCanvas event-based ellipse region drawer.

Intended use:

Public interface

Review Status

<prerequisites> MWCEllipseTool </prerequisites>

Etymology

MultiEllipseToolImpl stands for MultiWorldCanvas Ellipse Tool Region

Synopsis

Why this "finalization" is required is beyond me... i.e. why not roll this functionality into the parent class??

Thu Aug 18 20:13:53 UTC 2011

This class finalises the functionality in MWCEllipseTool to implement event-based drawing of elliptical regions on a WorldCanvas. casacore::Double clicking inside the constructed ellipse emits the region, whilst pressing Escape cancels the region.

Example

Motivation

Elliptical regions are the most common regions, and constructing them visually can be very efficient.

To Do

Definition at line 83 of file MultiEllipseToolImpl.h.

Constructor & Destructor Documentation

casa::MultiEllipseToolImpl::MultiEllipseToolImpl ( viewer::RegionSourceFactory rf,
PanelDisplay pd,
Display::KeySym  keysym = Display::K_Pointer_Button2 
)

Constructor.

virtual casa::MultiEllipseToolImpl::~MultiEllipseToolImpl ( )
virtual

Destructor.

Member Function Documentation

virtual void casa::MultiEllipseToolImpl::doubleInside ( )
protectedvirtual

Handle double-click inside the ellipse.

Invokes regionReady().

Reimplemented from casa::MultiRectTool.

void casa::MultiEllipseToolImpl::getLinearCoords ( casacore::Vector< casacore::Double > &  blc,
casacore::Vector< casacore::Double > &  trc 
)
protected

get the linear coords of the current elliptical region

void casa::MultiEllipseToolImpl::getWorldCoords ( casacore::Vector< casacore::Double > &  blc,
casacore::Vector< casacore::Double > &  trc 
)
protected

get the world coords of the current elliptical region

virtual void casa::MultiEllipseToolImpl::handleEvent ( DisplayEvent ev)
virtual

handle events, via new-style interface.

Currently just for reset event.

Reimplemented from casa::DisplayEH.

virtual void casa::MultiEllipseToolImpl::regionReady ( )
inlineprotectedvirtual

This function is called when a region is deliberately "finished" by the user.

It can be implemented to do further actions, such as report the region to the application

Reimplemented in casa::QtELRegion.

Definition at line 104 of file MultiEllipseToolImpl.h.


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