CODEllipseComponent Class
class CODEllipseComponent: public CODPointComponent
The ellipse component renders an ellipse within a given bounding rectangle. In order to support rotation for ellipses, four bezier curves are used to approximate the ellipse. The local points for the ellipse define a rectangle which is used to calculate the control points of the bezier curves. Once the control points are calculated, they are transformed into world points in order to apply translation, scaling, and rotation to the ellipse. The function CalculateEllipse is responsible for calculating the thirteen control points for the four bezier curves based on a given rectangle.The following properties are added to the component by this class:
OD_PROP_LINE, OD_PROP_FILL
Defined in: OdEllipseComp.h
See Also
Component Property Identifiers
Class Members
Constructor.
CODEllipseComponent(const CODEllipseComponent& src)
Copy constructor.
virtual ~CODEllipseComponent()
Destructor.
BOOL Create(CRect rcCreate)
Creates the ellipse component within a rectangle.
CODEllipseComponent& operator=(const CODEllipseComponent& src)
Assignment operator: sets the component's attributes equal to that of the r-value component.
virtual CODComponent* Dup() const
Creates a copy of this component.
Number of points comprising the ellipse.
virtual void OnPrepareDC(CDC* pDC)
Creates GDI objects and sets up the device context for drawing.
virtual void OnDraw(CDC* pDC)
Draw the ellipse.
virtual CODRgn GetEdgeRgn()
Returns a region surrounding the edges of the component.
virtual void CalculateRgn(CODRgn* pRgn)
Calculates the component region.
virtual void GetHandles(CODPointArray* pHandleArray, BOOL bVertexHandles = FALSE)
Gets the component control handles.
virtual OD_MOVEVERTEX_RC CalculateMovedVertices(int nIndex, int nOffsetX, int nOffsetY)
Calculates the new position of a vertex given an offset.
void CalculateEllipse(const CRect& rect, float* lpPointsX, float* lpPointsY)
Calculates points of the ellipse.
void SetLocalBounds(const CRect& rcLocal)
Sets the local bounds for the ellipse.
void CalcDrawingPoints()
Calculates the bezier control points and transforms them to world coordinates.
virtual void Serialize(CArchive& ar)
Serialize the ellipse component.