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

VIEWS_API CODEllipseComponent()

Constructor.

VIEWS_API CODEllipseComponent(const CODEllipseComponent& src)

Copy constructor.

VIEWS_API virtual ~CODEllipseComponent()

Destructor.

VIEWS_API BOOL Create(CRect rcCreate)

Creates the ellipse component within a rectangle.

VIEWS_API CODEllipseComponent& operator=(const CODEllipseComponent& src)

Assignment operator: sets the component's attributes equal to that of the r-value component.

VIEWS_API virtual CODComponent* Dup() const

Creates a copy of this component.

enum

Number of points comprising the ellipse.

VIEWS_API virtual void OnPrepareDC(CDC* pDC)

Creates GDI objects and sets up the device context for drawing.

VIEWS_API virtual void OnDraw(CDC* pDC)

Draw the ellipse.

VIEWS_API virtual CODRgn GetEdgeRgn()

Returns a region surrounding the edges of the component.

VIEWS_API virtual void CalculateRgn(CODRgn* pRgn)

Calculates the component region.

VIEWS_API virtual void GetHandles(CODPointArray* pHandleArray, BOOL bVertexHandles = FALSE)

Gets the component control handles.

VIEWS_API virtual OD_MOVEVERTEX_RC CalculateMovedVertices(int nIndex, int nOffsetX, int nOffsetY)

Calculates the new position of a vertex given an offset.

VIEWS_API void CalculateEllipse(const CRect& rect, float* lpPointsX, float* lpPointsY)

Calculates points of the ellipse.

VIEWS_API void SetLocalBounds(const CRect& rcLocal)

Sets the local bounds for the ellipse.

VIEWS_API void CalcDrawingPoints()

Calculates the bezier control points and transforms them to world coordinates.

VIEWS_API virtual void Serialize(CArchive& ar)

Serialize the ellipse component.