casa
$Rev:20696$
|
Base class for MultiWorldCanvas event-based rectangle tools. More...
#include <MultiPointTool.h>
Public Member Functions | |
MultiPointTool (viewer::RegionSourceFactory *rsf, PanelDisplay *pd, Display::KeySym keysym=Display::K_Pointer_Button1, const Bool persistent=False) | |
Constructor. | |
virtual | ~MultiPointTool () |
Destructor. | |
const std::set < viewer::region::RegionTypes > & | regionsCreated () const |
returns a set which indicates regions this creator creates... | |
RegionToolTypes | type () const |
Protected Member Functions | |
bool | checkType (viewer::region::RegionTypes t) |
virtual std::tr1::shared_ptr < viewer::Rectangle > | allocate_region (WorldCanvas *wc, double x1, double y1, double x2, double y2, VOID *region_specific_state) const |
Base class for MultiWorldCanvas event-based rectangle tools.
Public interface
<prerequisites> WCTool </prerequisites>
MultiPointTool stands for MultiWorldCanvas Rectangle Tool
This class adds to its base WCTool to provide a tool for drawing, resizing and moving rectangles on a WorldCanvas. While MultiPointTool is not abstract, it performs no useful function. The programmer should derive from this class, and implement the functions doubleInside and doubleOutside, which are called when the user double-clicks the key or mouse button inside or outside an existing rectangle respectively. It is up to the programmer to decide what double clicks inside and outside the rectangle correspond to, although it is recommended that a double click inside correspond to the main action of the tool, and a double click outside correspond to a secondary action of the tool, if indeed a secondary action exists.
The rectangle is drawn by dragging the mouse from one corner to the diagonally opposite corner. Once constructed, the rectangle can be resized by dragging its corners, or relocated by dragging inside the rectangle. The rectangle is removed from the display when the Esc key is pressed.
Many activities on the WorldCanvas will be based on the user drawing a rectangle, and then proceeding to some action with that rectangle. A nice example is zooming.
Definition at line 84 of file MultiPointTool.h.
casa::MultiPointTool::MultiPointTool | ( | viewer::RegionSourceFactory * | rsf, |
PanelDisplay * | pd, | ||
Display::KeySym | keysym = Display::K_Pointer_Button1 , |
||
const Bool | persistent = False |
||
) | [inline] |
Constructor.
Definition at line 89 of file MultiPointTool.h.
virtual casa::MultiPointTool::~MultiPointTool | ( | ) | [inline, virtual] |
Destructor.
Definition at line 94 of file MultiPointTool.h.
virtual std::tr1::shared_ptr<viewer::Rectangle> casa::MultiPointTool::allocate_region | ( | WorldCanvas * | wc, |
double | x1, | ||
double | y1, | ||
double | x2, | ||
double | y2, | ||
VOID * | region_specific_state | ||
) | const [protected, virtual] |
Reimplemented from casa::MultiRectTool.
bool casa::MultiPointTool::checkType | ( | viewer::region::RegionTypes | t | ) | [inline, protected, virtual] |
Reimplemented from casa::MultiRectTool.
Definition at line 103 of file MultiPointTool.h.
References casa::viewer::region::PointRegion.
const std::set<viewer::region::RegionTypes>& casa::MultiPointTool::regionsCreated | ( | ) | const [virtual] |
returns a set which indicates regions this creator creates...
Reimplemented from casa::MultiRectTool.
RegionToolTypes casa::MultiPointTool::type | ( | ) | const [inline, virtual] |
Reimplemented from casa::MultiRectTool.
Definition at line 99 of file MultiPointTool.h.
References casa::RegionTool::POINTTOOL.