DDDPolygon.h

Classes

DDDPolygon -- Implementation of aan ellipse object for DrawingDisplayData class. (full description)

class DDDPolygon : public DDDObject

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

Description

Synopsis

This class implements the interface defined by DDDObject, to provide a polygon object for registration with DrawingDisplayData objects.

To Do

Member Description

DDDPolygon(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 : 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.

virtual ~DDDPolygon()

Destructor.

virtual void draw(const Display::RefreshReason &reason, WorldCanvas *worldcanvas)

Draw this rectangle 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.

DDDPolygon()

(Required) default constructor.

DDDPolygon(const DDDPolygon &other)

(Required) copy constructor.

void operator=(const DDDPolygon &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 of bounding box of polygon

void createHandles()

create handles, one per vertex

void listWorld()

Debugging routines

void listPixel()