DDDEllipse.h

Classes

DDDEllipse -- Implementation of an ellipse/rectangle object for DrawingDisplayData class. (full description)

class DDDEllipse : public DDDObject

Interface

Public Members
DDDEllipse(const Record &description, DrawingDisplayData *owner)
virtual ~DDDEllipse()
virtual void draw(const Display::RefreshReason &reason, WorldCanvas *worldcanvas)
virtual Record description()
virtual void setDescription(const Record &rec)
virtual void operator()(const WCRefreshEvent &ev)
virtual void operator()(const WCPositionEvent &ev)
virtual void operator()(const WCMotionEvent &ev)
Protected Members
DDDEllipse()
DDDEllipse(const DDDEllipse &other)
void operator=(const DDDEllipse &other)
Private Members
void convertToPixel ()
void updateWorldValues ()
void decode(const RecordInterface& description, Bool required)
void encode(RecordInterface& description) const
void createCorners()
Matrix<Int> toIntPixel(const Matrix<Double>& points)
void listWorld()
void listPixel()

Description

Synopsis

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.

To Do

Member Description

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<src> is used to control the location at which conversions to and from pixel coordinates are done. If <src>True<src> 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 <src>doreference=True will cause the shape to rotate as you move it about the display as the position angle tracks the local North.

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. Presently returns only construction description.

virtual void setDescription(const Record &rec)

Update this object based on the information in the provided Record.

virtual void operator()(const WCRefreshEvent &ev)
virtual void operator()(const WCPositionEvent &ev)
virtual void operator()(const WCMotionEvent &ev)

Event handlers. The parent DrawingDisplayData will distribute events as necessary to the various DDDObjects which comprise it.

DDDEllipse()

(Required) default constructor.

DDDEllipse(const DDDEllipse &other)

(Required) copy constructor.

void operator=(const DDDEllipse &other)

(Required) copy assignment.

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()