DDDPolygon.h
Classes
- DDDPolygon -- Implementation of aan ellipse object for DrawingDisplayData class. (full description)
Interface
- Public Members
- DDDPolygon(const Record &description, DrawingDisplayData *owner)
- virtual ~DDDPolygon()
- 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
- DDDPolygon()
- DDDPolygon(const DDDPolygon &other)
- void operator=(const DDDPolygon &other)
- Private Members
- void convertToPixel ()
- void updateWorldValues ()
- void decode(const RecordInterface& description, Bool required)
- void encode(RecordInterface& description) const
- void createCorners()
- void createHandles()
- void listWorld()
- void listPixel()
Synopsis
This class implements the interface defined by DDDObject, to provide
a polygon object for registration with DrawingDisplayData objects.
To Do
Allow vertices to be edited.
Member Description
Constructor taking a Record description. Fields in the record,
on top of what is consumed by the DDDObject constructor, are:
Required : x (quantum of vector double) and
y (quantum of vector double).
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.
Destructor.
virtual void draw(const Display::RefreshReason &reason, WorldCanvas *worldcanvas)
Draw this rectangle object for the given reason on the provided
WorldCanvas.
Return a record describing this object. Presently returns
only construction description.
Update this object based on the information in the provided
Record.
Event handlers. The parent DrawingDisplayData will distribute
events as necessary to the various DDDObjects which comprise it.
(Required) default constructor.
DDDPolygon(const DDDPolygon &other)
(Required) copy constructor.
void operator=(const DDDPolygon &other)
(Required) copy assignment.
COnvert parameters from world to pixel
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
compute corners of rectangle of bounding box of polygon
create handles, one per vertex
Debugging routines