casa
5.7.0-16
|
Control class for a collection of DisplayShapeInterfaces. More...
#include <Annotations.h>
Public Types | |
enum | State { Nothing, Creation, WcCreation, Handle, OtherHandle, Move, OtherMove } |
Used to determine the state of the class. More... | |
enum | CreationType { Normal, Arrow, Polygon, PolyLine, Marker } |
This is used to handle the creation of shapes by mouse events. More... | |
Public Member Functions | |
Annotations (PanelDisplay *panDisp, const Display::KeySym &keysym=Display::K_Pointer_Button1, const casacore::Bool useEH=true) | |
Destructor, and constructor, taking the panelDisplay to which the Annotator will attach itself to, and which mouse button to listen to. More... | |
virtual | ~Annotations () |
virtual void | operator() (const PCPositionEvent &ev) |
The event handlers. More... | |
virtual void | operator() (const PCMotionEvent &ev) |
Default just prints the event to cout. More... | |
virtual void | operator() (const PCRefreshEvent &ev) |
Default just prints the event to cout. More... | |
virtual void | operator() (const WCRefreshEvent &ev) |
original handler interface (still used for WCRefreshEvents) More... | |
virtual void | draw (PixelCanvas *pc, const casacore::Bool noHandles=false) |
Redraw all the shapes. More... | |
virtual void | newShape (casacore::Record &settings, const casacore::Bool &refresh=true) |
Instantly creates a shape on screen, and hence requires certain information in its record such as the center of the new object on screen. More... | |
virtual void | setKey (const Display::KeySym &newKey) |
Set the key assigned to control shapes. More... | |
virtual void | createShape (casacore::Record &settings) |
Create a shape, based on the information contained in the record. More... | |
virtual void | enable () |
Disable event handling (with the exception of refresh calls). More... | |
virtual void | disable () |
virtual void | cancelShapes () |
Cancels creation of any pending shapes, unselects all shapes and turns off drawing of all handles. More... | |
virtual casacore::Bool | deleteShape (const casacore::uInt &toDel) |
Delete the shape at the specified point in the collection of shapes The current (selected) shape can be determined by using the activeShape() function. More... | |
virtual void | removeLockedFromCurrent (const casacore::uInt &removeMe) |
These allow shapes to be "locked" together. More... | |
virtual void | addLockedToCurrent (const casacore::uInt &addMe) |
virtual casacore::Int | activeShape () |
Return the currently selected shapes' index. More... | |
virtual casacore::Record | shapesSummary () |
Return a brief summary of all current shapes. More... | |
virtual void | setShapeOptions (const casacore::uInt &whichShape, const casacore::Record &newOptions) |
Set the options for the specified shape. More... | |
virtual casacore::Record | getShapeOptions (const casacore::uInt &whichShape) |
Returns a record containing the options for the specified shape. More... | |
virtual casacore::Record | getAllOptions () |
Returns a record which contains a sub record (containing options) for each shape. More... | |
virtual void | setAllOptions (const casacore::Record &newSettings) |
Deletes all existing shapes, and rebuilds new shapes based on records in sub records of the supplied record. More... | |
virtual void | update (PixelCanvas *pc) |
Called when a refresh is required. More... | |
virtual void | annotEvent (const casacore::String &) |
Overwrite this to fire glish events. More... | |
virtual casacore::Bool | revertToPix (const casacore::Int &whichOne) |
Functions for changing the co-ords system of a shape. More... | |
virtual casacore::Bool | revertToFrac (const casacore::Int &whichOne) |
virtual casacore::Bool | lockToWC (const casacore::Int &whichOne) |
virtual casacore::Record | availableShapes () |
Returns a list of shapes annotations knows about. More... | |
Public Member Functions inherited from casa::PCPositionEH | |
PCPositionEH () | |
Default Constructor Required. More... | |
virtual | ~PCPositionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::PCMotionEH | |
PCMotionEH () | |
Default Constructor Required. More... | |
virtual | ~PCMotionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::PCRefreshEH | |
PCRefreshEH () | |
Default Constructor Required. More... | |
PCRefreshEH (const PCRefreshEH &other) | |
virtual | ~PCRefreshEH () |
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 void | handleEvent (DisplayEvent &) |
Classes that contain this interface (i.e., derive from it) can override this method to implement actions for whatever types of DisplayEvent they're interested in. More... | |
virtual | ~DisplayEH () |
Private Attributes | |
PanelDisplay * | itsPanelDisplay |
My private variables... More... | |
PixelCanvas * | itsPC |
std::list< WorldCanvas * > | itsWCs |
My copy of the list of Worldcanvases. More... | |
casacore::PtrBlock < DisplayShape * > | itsShapes |
casacore::List of shapes More... | |
Display::KeySym | itsKey |
Some overall settings. More... | |
casacore::Bool | itsUseEH |
Annotations::State | itsState |
Stuff to remember my current state: More... | |
Annotations::CreationType | itsCreation |
casacore::Bool | itsShapeMoved |
casacore::Int | itsActiveShape |
casacore::Int | itsActiveHandle |
casacore::uInt | itsX |
casacore::uInt | itsY |
casacore::Bool | itsEnabled |
casacore::Bool | itsRefreshedYet |
Control class for a collection of DisplayShapeInterfaces.
Annotations is a method by which a collection of shapes can be managed on a pixel canvas.
Annotations registers itself as an event handler on whichever pixelcanvas it is supplied. It can then add, delete or modify shapes based on function calls and user mouse input.
The class is essentially a casacore::PtrBlock of DisplayShapeInterfaces, with pixelcanvas event handling to control them.
To allow a collection of shapes to be displayed and cotrolled by one class.
Definition at line 84 of file Annotations.h.
This is used to handle the creation of shapes by mouse events.
Some types of shapes require special treatment when constructed with the mouse.
Enumerator | |
---|---|
Normal | |
Arrow | |
Polygon | |
PolyLine | |
Marker |
Definition at line 99 of file Annotations.h.
Used to determine the state of the class.
The state may change due to mouse events, or function calls.
Enumerator | |
---|---|
Nothing | |
Creation | |
WcCreation | |
Handle | |
OtherHandle | |
Move | |
OtherMove |
Definition at line 92 of file Annotations.h.
casa::Annotations::Annotations | ( | PanelDisplay * | panDisp, |
const Display::KeySym & | keysym = Display::K_Pointer_Button1 , |
||
const casacore::Bool | useEH = true |
||
) |
Destructor, and constructor, taking the panelDisplay to which the Annotator will attach itself to, and which mouse button to listen to.
|
virtual |
|
virtual |
Return the currently selected shapes' index.
|
virtual |
|
inlinevirtual |
Overwrite this to fire glish events.
Definition at line 202 of file Annotations.h.
|
virtual |
Returns a list of shapes annotations knows about.
|
virtual |
Cancels creation of any pending shapes, unselects all shapes and turns off drawing of all handles.
|
private |
Internal functions.
|
private |
|
private |
|
virtual |
Create a shape, based on the information contained in the record.
This function does not require the center to be specified, as once createShape is called, the user can "drag" out the shape required. If createShape is called, and the shape is no longer required, the function 'cancelShapes' can be used to reset the state of the annotator.
|
virtual |
Delete the shape at the specified point in the collection of shapes The current (selected) shape can be determined by using the activeShape() function.
|
private |
|
virtual |
|
virtual |
Redraw all the shapes.
Turns all handles off if noHandles is true
|
virtual |
Disable event handling (with the exception of refresh calls).
This stops the user from moving shapes etc via the mouse motion / position event handlers. These do not recognize nested calls (e.g. two disables, followed by an enable will enable the handlers).
|
virtual |
Returns a record which contains a sub record (containing options) for each shape.
e.g. To obtain options for the first shape:
|
virtual |
Returns a record containing the options for the specified shape.
The user selected shape can be determined by calling the 'activeShape' method. To see a list of the options returned by shapes / objects, see their individual documentation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
virtual |
|
virtual |
Instantly creates a shape on screen, and hence requires certain information in its record such as the center of the new object on screen.
Refresh == false can be used to surpress a refresh.
|
virtual |
The event handlers.
Reimplemented from casa::PCPositionEH.
|
virtual |
Default just prints the event to cout.
Reimplemented from casa::PCMotionEH.
|
virtual |
Default just prints the event to cout.
Reimplemented from casa::PCRefreshEH.
|
virtual |
original handler interface (still used for WCRefreshEvents)
Implements casa::WCRefreshEH.
|
private |
|
private |
|
virtual |
These allow shapes to be "locked" together.
Adding a locked shape to the current shape means that whenever the current shape moves, so too will the specified shape. removeLockedFromCurrent can be used to remove this effect.
|
virtual |
|
virtual |
Functions for changing the co-ords system of a shape.
|
private |
|
virtual |
Deletes all existing shapes, and rebuilds new shapes based on records in sub records of the supplied record.
A record returned from getAllOptions() can therefore be used to copy a set of shapes.
|
virtual |
Set the key assigned to control shapes.
|
virtual |
Set the options for the specified shape.
The user selected shape can be determined by call the 'activeShape' method. To see a list of available options for different types of shapes / objects, see their individual documentation.
|
virtual |
Return a brief summary of all current shapes.
|
virtual |
Called when a refresh is required.
It copies back to front buffer, then causes a refresh with reason = backCopiedToFront.
|
private |
|
private |
|
private |
Definition at line 247 of file Annotations.h.
|
private |
Definition at line 246 of file Annotations.h.
|
private |
Definition at line 244 of file Annotations.h.
|
private |
Definition at line 249 of file Annotations.h.
|
private |
Some overall settings.
Definition at line 237 of file Annotations.h.
|
private |
My private variables...
The PanelDisplay I was given on construction and some stuff I got out of it
Definition at line 224 of file Annotations.h.
|
private |
Definition at line 225 of file Annotations.h.
|
private |
Definition at line 250 of file Annotations.h.
|
private |
Definition at line 245 of file Annotations.h.
|
private |
casacore::List of shapes
Definition at line 233 of file Annotations.h.
|
private |
Stuff to remember my current state:
Definition at line 243 of file Annotations.h.
|
private |
Definition at line 238 of file Annotations.h.
|
private |
My copy of the list of Worldcanvases.
I can check this against itsPanelDisplay to see if anything has changed.
Definition at line 230 of file Annotations.h.
|
private |
Definition at line 248 of file Annotations.h.
|
private |
Definition at line 248 of file Annotations.h.