DDDObject.h
Classes
- DDDObject -- Base class describing interface for objects supported by DrawingDisplayData (full description)
Types
- None
-
- Handle
-
- Move
-
- Rotate
-
Interface
- Public Members
- DDDObject(const Record &description, DrawingDisplayData *owner)
- virtual ~DDDObject()
- virtual void draw(const Display::RefreshReason &reason, WorldCanvas *worldcanvas) = 0
- virtual void showHandles(const Bool show, const Bool tellOwner = True)
- virtual Bool showingHandles()
- virtual Record description()
- virtual void setDescription(const Record &rec)
- virtual Bool storeClick(const DisplayEvent &ev)
- virtual void clearClickBuffer()
- Int objectID() const
- virtual void operator()(const WCRefreshEvent &ev) = 0
- virtual void operator()(const WCPositionEvent &ev) = 0
- virtual void operator()(const WCMotionEvent &ev) = 0
- Protected Members
- DrawingDisplayData *owner()
- String color() const
- String label() const
- Int lineWidth() const
- Bool isEditable() const
- Bool isMovable() const
- Bool isFixed() const
- DDDObject()
- DDDObject(const DDDObject &other)
- void operator=(const DDDObject &other)
- void translateMatrix(Matrix<Double>& points, Double dx, Double dy)
- Matrix<Double> rotateMatrix(const Matrix<Double>& points, Double angle)
- Bool inPolygon(const Matrix<Double>& points, Double x, Double y)
- Bool inPolygon(const Vector<Double>& xP, const Vector<Double>& yP, Double x, Double y)
- void convertCoordinateSystem (CoordinateSystem& cSys, WorldCanvas* wcPtr) const
- Bool onHandle(const Block<DDDHandle>& handles, Double x, Double y)
Synopsis
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.
Member Description
Constructor taking a Record description. Fields in the record
are: color and label.
Destructor.
virtual void draw(const Display::RefreshReason &reason, WorldCanvas *worldcanvas) = 0
Draw this DrawingDisplayData object for the given reason on the
provided WorldCanvas.
virtual void showHandles(const Bool show, const Bool tellOwner = True)
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.
Query whether the object is showing its handles.
Return a record describing this object.
Update this object based on the information in the provided
Record.
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.
Clear the click buffer.
Return the unique id of this object.
Event handlers. The parent DrawingDisplayData will distribute
events as necessary to the various DDDObjects which comprise it.
Return the owner of this object.
Return the color to use to draw this object.
Return the label of this object.
Return the line width of this object.
(Required) default constructor.
DDDObject(const DDDObject &other)
(Required) copy constructor.
void operator=(const DDDObject &other)
(Required) copy assignment.
void translateMatrix(Matrix<Double>& points, Double dx, Double dy)
Translate Matrix
Rotate Matrix
Bool inPolygon(const Matrix<Double>& points, Double x, Double y)
Bool inPolygon(const Vector<Double>& xP, const Vector<Double>& yP, Double x, Double y)
Is point inside the polygon
Convert CoordinateSystem to screen pixels
Is the point on a handle