casa
5.7.0-16
|
Base class describing interface for objects supported by DrawingDisplayData. More...
#include <DDDObject.h>
Public Types | |
enum | Mode { None, Handle, Move, Rotate } |
Public Member Functions | |
DDDObject (const casacore::Record &description, DrawingDisplayData *owner) | |
Constructor taking a casacore::Record description. More... | |
virtual | ~DDDObject () |
Destructor. More... | |
virtual void | draw (const Display::RefreshReason &reason, WorldCanvas *worldcanvas)=0 |
Draw this DrawingDisplayData object for the given reason on the provided WorldCanvas. More... | |
virtual void | showHandles (const casacore::Bool show, const casacore::Bool tellOwner=true) |
Indicate whether the object should show its handles or not. More... | |
virtual casacore::Bool | showingHandles () |
Query whether the object is showing its handles. More... | |
virtual casacore::Record | description () |
Return a record describing this object. More... | |
virtual void | setDescription (const casacore::Record &rec) |
Update this object based on the information in the provided Record. More... | |
virtual casacore::Bool | storeClick (const DisplayEvent &ev) |
Store a click in the buffer and look for a double-click event. More... | |
virtual void | clearClickBuffer () |
Clear the click buffer. More... | |
casacore::Int | objectID () const |
Return the unique id of this object. More... | |
virtual void | operator() (const WCRefreshEvent &ev)=0 |
Event handlers. More... | |
virtual void | operator() (const WCPositionEvent &ev)=0 |
Default just prints the event to cout. More... | |
virtual void | operator() (const WCMotionEvent &ev)=0 |
default sends event to cout 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 () |
Public Member Functions inherited from casa::WCMotionEH | |
WCMotionEH () | |
Default Constructor Required. More... | |
virtual | ~WCMotionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::WCPositionEH | |
WCPositionEH () | |
Default Constructor Required. More... | |
virtual | ~WCPositionEH () |
Destructor. More... | |
Private Attributes | |
DrawingDisplayData * | itsOwner |
DrawingDisplayData which owns this DDDObject. More... | |
casacore::Bool | itsShowHandles |
Whether the handles are showing, and therefore whether this DDDObject is presently editable. More... | |
casacore::Bool | itsEditable |
Is this object editable. More... | |
casacore::Bool | itsMovable |
Is it movable. More... | |
casacore::Double | itsLastClickTime |
Timing for double clicks. More... | |
casacore::Double | its2ndLastClickTime |
casacore::String | itsColor |
Color of this object. More... | |
casacore::Int | itsLineWidth |
Line width of the lines drawn. More... | |
casacore::String | itsLabel |
Label for this object. More... | |
casacore::Int | itsObjectID |
Unique identification for this object. More... | |
Base class describing interface for objects supported by DrawingDisplayData.
This class defines the interface which objects that are drawable by the DrawingDisplayData class must provide.
World units of 'pix' and 'frac' are defined. 'pix' units are in screen pixel units. They are not very useful once the display has been zoomed. 'frac' units have range [0,0] -> [1,1] mapping to the display part of the pixel canvas.
Definition at line 62 of file DDDObject.h.
Enumerator | |
---|---|
None | |
Handle | |
Move | |
Rotate |
Definition at line 67 of file DDDObject.h.
casa::DDDObject::DDDObject | ( | const casacore::Record & | description, |
DrawingDisplayData * | owner | ||
) |
Constructor taking a casacore::Record description.
Fields in the record are: color
and label
.
|
virtual |
Destructor.
|
protected |
(Required) default constructor.
|
protected |
(Required) copy constructor.
|
virtual |
Clear the click buffer.
|
inlineprotected |
Return the color to use to draw this object.
Definition at line 136 of file DDDObject.h.
References itsColor.
|
protected |
Convert DisplayCoordinateSystem to screen pixels.
|
virtual |
Return a record describing this object.
Reimplemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.
|
pure virtual |
Draw this DrawingDisplayData object for the given reason on the provided WorldCanvas.
Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.
|
protected |
Is point inside the polygon.
|
protected |
|
inlineprotected |
Definition at line 150 of file DDDObject.h.
References itsEditable.
|
inlineprotected |
Definition at line 158 of file DDDObject.h.
References itsEditable, and itsMovable.
|
inlineprotected |
Definition at line 154 of file DDDObject.h.
References itsMovable.
|
inlineprotected |
|
inlineprotected |
Return the line width of this object.
Definition at line 146 of file DDDObject.h.
References itsLineWidth.
|
inline |
Return the unique id of this object.
Definition at line 116 of file DDDObject.h.
References itsObjectID.
|
protected |
Is the point on a handle.
|
pure virtual |
Event handlers.
The parent DrawingDisplayData will distribute events as necessary to the various DDDObjects which comprise it.
Implements casa::WCRefreshEH.
Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.
|
pure virtual |
Default just prints the event to cout.
Implements casa::WCPositionEH.
Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.
|
pure virtual |
default sends event to cout
Implements casa::WCMotionEH.
Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.
|
protected |
(Required) copy assignment.
|
inlineprotected |
|
protected |
Rotate Matrix.
|
virtual |
Update this object based on the information in the provided Record.
Reimplemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.
|
virtual |
Indicate whether the object should show its handles or not.
The parent DrawingDisplayData will control this, and either ask all DDDObjects to show their handles or not, via the user setting an option. This actually controls the state of whether this DDDObject is editable, so the parent DrawingDisplayData could also allow editing of only one DDDObject at a time.
|
inlinevirtual |
Query whether the object is showing its handles.
Definition at line 95 of file DDDObject.h.
References itsShowHandles.
|
virtual |
Store a click in the buffer and look for a double-click event.
If one is found, then call the doubleClick function in the owning DisplayData. Returns true
if a double click was detected.
|
protected |
Translate Matrix.
|
private |
Definition at line 206 of file DDDObject.h.
|
private |
|
private |
Is this object editable.
Definition at line 201 of file DDDObject.h.
Referenced by isEditable(), and isFixed().
|
private |
|
private |
Timing for double clicks.
Definition at line 206 of file DDDObject.h.
|
private |
Line width of the lines drawn.
Definition at line 212 of file DDDObject.h.
Referenced by lineWidth().
|
private |
Is it movable.
Definition at line 203 of file DDDObject.h.
Referenced by isFixed(), and isMovable().
|
private |
Unique identification for this object.
Definition at line 218 of file DDDObject.h.
Referenced by objectID().
|
private |
DrawingDisplayData which owns this DDDObject.
Definition at line 194 of file DDDObject.h.
Referenced by owner().
|
private |
Whether the handles are showing, and therefore whether this DDDObject is presently editable.
Definition at line 198 of file DDDObject.h.
Referenced by showingHandles().