casa
$Rev:20696$
|
Implementation of an ellipse/rectangle object for DrawingDisplayData class. More...
#include <DDDEllipse.h>
Public Member Functions | |
DDDEllipse (const Record &description, DrawingDisplayData *owner) | |
Constructor taking a Record description. | |
virtual | ~DDDEllipse () |
Destructor. | |
virtual void | draw (const Display::RefreshReason &reason, WorldCanvas *worldcanvas) |
Draw this object for the given reason on the provided WorldCanvas. | |
virtual Record | description () |
Return a record describing this object. | |
virtual void | setDescription (const Record &rec) |
Update this object based on the information in the provided Record. | |
virtual void | operator() (const WCRefreshEvent &ev) |
Event handlers. | |
virtual void | operator() (const WCPositionEvent &ev) |
Default just prints the event to cout. | |
virtual void | operator() (const WCMotionEvent &ev) |
default sends event to cout | |
Protected Member Functions | |
DDDEllipse () | |
DDDEllipse (const DDDEllipse &other) | |
(Required) copy constructor. | |
void | operator= (const DDDEllipse &other) |
(Required) copy assignment. | |
Private Member Functions | |
void | convertToPixel () |
COnvert parameters from world to pixel. | |
void | updateWorldValues () |
Update private world parameters from current pixel values. | |
void | decode (const RecordInterface &description, Bool required) |
Decode record into private data. | |
void | encode (RecordInterface &description) const |
Encode private data into record. | |
void | createCorners () |
compute corners of rectangle | |
Matrix< Int > | toIntPixel (const Matrix< Double > &points) |
void | listWorld () |
Debugging routines. | |
void | listPixel () |
Private Attributes | |
Bool | itsOutline |
Fill style. | |
Vector< Quantum< Double > > | itsWorldParameters |
Define center x, center y, major, minor, pa in world. | |
Vector< Double > | itsPixelCenter |
Define center x, center y, major, minor, pa (radians) in screen pixel. | |
Vector< Double > | itsPixelShape |
Matrix< Double > | itsCorners |
Rotated Rectangle Corners to draw in screen pixel. | |
Matrix< Double > | itsPixelOffsets |
Block< DDDHandle > | itsHandles |
List of handles. | |
DDDObject::Mode | itsMode |
Mode. | |
Double | itsBaseMoveX |
Store for movement bases. | |
Double | itsBaseMoveY |
LogIO | itsLogger |
Logger. | |
CoordinateSystem | itsCoordinateSystem |
CoordinateSystem in screen pixel coordinates. | |
WorldCanvas * | itsWorldCanvasPtr |
pointer to world canvas (shallow copy) | |
Bool | itsRectangle |
are we drawing a rectangle or an ellipse ? | |
Bool | itsFracX |
Fractional indicators. | |
Bool | itsFracY |
Bool | itsDoRef |
Do world/pixel conversions at reference location ? |
Implementation of an ellipse/rectangle object for DrawingDisplayData class.
This class implements the interface defined by DDDObject, to provide an ellipse or rectangle object for registration with DrawingDisplayData objects. The widths are all full widths.
Definition at line 65 of file DDDEllipse.h.
casa::DDDEllipse::DDDEllipse | ( | const Record & | description, |
DrawingDisplayData * | owner | ||
) |
Constructor taking a Record description.
Fields in the record, on top of what is consumed by the DDDObject constructor, are: Required : center
(vector of quanta length 2), major, minor, positionangle
(all quanta).
Units 'frac' ([0->1]) are available for the center only. Units 'pix' (absolute 0-rel image pixels) are available for the major and minor only.
Other, not required fields are outline & editable
which default to True
. When editable=False
the object can be moved but not reshaped, when True
it can be moved and reshaped. When outline=False
the ellipse is filled. If the field rectangle=True
a rectangle is drawn. If it does not exist or is False, an ellipse is drawn.
Finally, field doreference
which defaults to False
is used to control the location at which conversions to and from pixel coordinates are done. If True
then all conversions are done at the reference value. Otherwise, the conversions are done at the actual location of the shape. For example, with a DirectionCoordinate plane, setting doreference=True
will cause the shape to rotate as you move it about the display as the position angle tracks the local North.
virtual casa::DDDEllipse::~DDDEllipse | ( | ) | [virtual] |
Destructor.
casa::DDDEllipse::DDDEllipse | ( | ) | [protected] |
(Required) default constructor.
casa::DDDEllipse::DDDEllipse | ( | const DDDEllipse & | other | ) | [protected] |
(Required) copy constructor.
void casa::DDDEllipse::convertToPixel | ( | ) | [private] |
COnvert parameters from world to pixel.
void casa::DDDEllipse::createCorners | ( | ) | [private] |
compute corners of rectangle
void casa::DDDEllipse::decode | ( | const RecordInterface & | description, |
Bool | required | ||
) | [private] |
Decode record into private data.
virtual Record casa::DDDEllipse::description | ( | ) | [virtual] |
Return a record describing this object.
Presently returns only construction description.
Reimplemented from casa::DDDObject.
virtual void casa::DDDEllipse::draw | ( | const Display::RefreshReason & | reason, |
WorldCanvas * | worldcanvas | ||
) | [virtual] |
Draw this object for the given reason on the provided WorldCanvas.
Implements casa::DDDObject.
void casa::DDDEllipse::encode | ( | RecordInterface & | description | ) | const [private] |
Encode private data into record.
void casa::DDDEllipse::listPixel | ( | ) | [private] |
void casa::DDDEllipse::listWorld | ( | ) | [private] |
Debugging routines.
virtual void casa::DDDEllipse::operator() | ( | const WCRefreshEvent & | ev | ) | [virtual] |
Event handlers.
The parent DrawingDisplayData will distribute events as necessary to the various DDDObjects which comprise it.
Implements casa::DDDObject.
virtual void casa::DDDEllipse::operator() | ( | const WCPositionEvent & | ev | ) | [virtual] |
Default just prints the event to cout.
Implements casa::DDDObject.
virtual void casa::DDDEllipse::operator() | ( | const WCMotionEvent & | ev | ) | [virtual] |
default sends event to cout
Implements casa::DDDObject.
void casa::DDDEllipse::operator= | ( | const DDDEllipse & | other | ) | [protected] |
(Required) copy assignment.
virtual void casa::DDDEllipse::setDescription | ( | const Record & | rec | ) | [virtual] |
Update this object based on the information in the provided Record.
Reimplemented from casa::DDDObject.
Matrix<Int> casa::DDDEllipse::toIntPixel | ( | const Matrix< Double > & | points | ) | [private] |
void casa::DDDEllipse::updateWorldValues | ( | ) | [private] |
Update private world parameters from current pixel values.
Double casa::DDDEllipse::itsBaseMoveX [private] |
Store for movement bases.
Definition at line 156 of file DDDEllipse.h.
Double casa::DDDEllipse::itsBaseMoveY [private] |
Definition at line 156 of file DDDEllipse.h.
CoordinateSystem in screen pixel coordinates.
Definition at line 163 of file DDDEllipse.h.
Matrix<Double> casa::DDDEllipse::itsCorners [private] |
Rotated Rectangle Corners to draw in screen pixel.
Definition at line 143 of file DDDEllipse.h.
Bool casa::DDDEllipse::itsDoRef [private] |
Do world/pixel conversions at reference location ?
Definition at line 175 of file DDDEllipse.h.
Bool casa::DDDEllipse::itsFracX [private] |
Fractional indicators.
Definition at line 172 of file DDDEllipse.h.
Bool casa::DDDEllipse::itsFracY [private] |
Definition at line 172 of file DDDEllipse.h.
Block<DDDHandle> casa::DDDEllipse::itsHandles [private] |
List of handles.
Definition at line 148 of file DDDEllipse.h.
LogIO casa::DDDEllipse::itsLogger [private] |
Logger.
Definition at line 160 of file DDDEllipse.h.
DDDObject::Mode casa::DDDEllipse::itsMode [private] |
Mode.
Definition at line 152 of file DDDEllipse.h.
Bool casa::DDDEllipse::itsOutline [private] |
Fill style.
Definition at line 134 of file DDDEllipse.h.
Vector<Double> casa::DDDEllipse::itsPixelCenter [private] |
Define center x, center y, major, minor, pa (radians) in screen pixel.
Definition at line 140 of file DDDEllipse.h.
Matrix<Double> casa::DDDEllipse::itsPixelOffsets [private] |
Definition at line 144 of file DDDEllipse.h.
Vector<Double> casa::DDDEllipse::itsPixelShape [private] |
Definition at line 140 of file DDDEllipse.h.
Bool casa::DDDEllipse::itsRectangle [private] |
are we drawing a rectangle or an ellipse ?
Definition at line 169 of file DDDEllipse.h.
WorldCanvas* casa::DDDEllipse::itsWorldCanvasPtr [private] |
pointer to world canvas (shallow copy)
Definition at line 166 of file DDDEllipse.h.
Vector<Quantum<Double> > casa::DDDEllipse::itsWorldParameters [private] |
Define center x, center y, major, minor, pa in world.
Definition at line 137 of file DDDEllipse.h.