[Classes] [Prev] [Next] [Methods]

CPolygon

Methods Index

Heritage
Description
Usage
Environment
Protected Data Members
Public Methods
Constructor, Destructor, and Initializer Methods
Utility Methods
Protected Methods

CPolygon


Heritage

Superclass: CShape

Subclasses: CRegularPoly


Description

CPolygon objects paint a polygon inside a view.


Usage

Create a CPolygon object and initialize it. Like all shapes, this class inherits all properties of CSubview, such as stickiness, enclosure, and so on.

CPolygon is initialized with an array of CPoints. Thus, the polygon is not necessarily regular (contrast with CRegularPoly). The object draws the polygon by connecting the dots, or CPoints. If you choose to let the object fill its interior, then the last point will connect with the first.


Environment

The line of the polygon is drawn with the pen; its interior is painted with the brush. You can set the color and pattern of both the pen and the brush. Also, you can set the pen style and width. See CBrush, CEnvironment, and CPen.


Protected Data Members

PNT* itsPoints; The polygon's points
int itsNumberOfPoints; The number of vertices+1
BOOLEAN itIsFilled; Whether the polygon has a fill
short itsLastPenSize Keeps drawing information for accurate clipping.
RWOrdered itsPointList List of CPointRWC* object representing the polygon.


Public Methods

Constructor, Destructor, and Initializer Methods

CPolygon(CSubview* theEnclosure, const RWOrdered* theListOfPoints);
CPolygon(CSubview* theEnclosure,
const CPoint* theArrayOfPoints,
int theNumberOfPoints);
CPolygon(const CPolygon& thePolygon);
CPolygon& operator=(const CPolygon& thePolygon);
virtual ~CPolygon(void);
BOOLEAN IPolygon(BOOLEAN isFilled	= FALSE,
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);

Utility Methods

virtual void SetFilled(BOOLEAN isFilled);
virtual BOOLEAN IsFilled(void) const;
virtual void Draw(const CRect& theClippingRegion);
virtual void Size(const CRect& theNewSize);
virtual void SetOrigin(const CPoint& theChange);
virtual void SetDragging(BOOLEAN isDraggable);
virtual void SetSizing(BOOLEAN isSizable);
RWOrdered GetPoints(void) const;
virtual BOOLEAN HitTest(const CPoint &theHitLoc) const;

Protected Methods

CPolygon(CSubview* theEnclosure, const CRect& theRegion);
void AdjustInternalPoints(void);
CRect CreatePoints(const CPoint* theArrayOfPoints,
int theNumberOfPoints);
CRect CreatePoints(const CIdOrderedList* theListOfPoints);
CRect BoundingRect();


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.