| Methods Index |
CShapeSubclasses:
CRegularPoly
CPolygon objects paint a polygon inside a view.
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.
CBrush, CEnvironment, and CPen.
CPolygon(CSubview* theEnclosure, const RWOrdered* theListOfPoints);
theEnclosure is a pointer to the subview that will contain the polygon. When you pass it an ordered list of points, this constructor connects these points into a polygon.
CPolygon(CSubview* theEnclosure,
const CPoint* theArrayOfPoints,
int theNumberOfPoints);
theEnclosure is a pointer to the subview that will contain the polygon. When you pass it an array of points and give the number of points, this constructor connects these points into a polygon. This constructor, which uses an array, is an alternative to the preceding constructor, which uses an ordered list of points.
CPolygon(const CPolygon& thePolygon);
CPolygon object with the same enclosure, color, visibility attributes, enabled/disabled attributes, environment, and so on as the original CPolygon object. However, any views nested within the original CPolygon object are not copied.
CPolygon& operator=(const CPolygon& thePolygon);
CPolygon object, creating a new CPolygon object that has the same color, glue, environment, visibility state, and so on. However, any views nested within the original CPolygon object are not copied.
virtual ~CPolygon(void);
BOOLEAN IPolygon(BOOLEAN isFilled = FALSE,
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);
CPolygon object has no interior fill, is visible, and uses the glue type NULLSTICKY. One or more of these defaults can be overridden.
virtual void SetFilled(BOOLEAN isFilled);
BOOLEAN value; if TRUE, the polygon has a fill.
virtual BOOLEAN IsFilled(void) const;
BOOLEAN value that indicates whether the polygon has a fill.
virtual void Draw(const CRect& theClippingRegion);
theClippingRegion is the part of the polygon that needs to be drawn, and it is in global, window-relative coordinates.
virtual void Size(const CRect& theNewSize);
theNewSize. The reset region could be in a different location and have completely different dimensions-a new width or a new height. The coordinates of the region, theNewSize, are relative to the enclosure-like the coordinates of the region that is passed in when a view is instantiated.
virtual void SetOrigin(const CPoint& theChange);
theChange to it. For example, suppose a view has an origin of 10,20 and you want to shift the origin by three pixels to the right. You would set the origin by giving it a delta point of 3,0, which shifts the view three pixels horizontally.
virtual void SetDragging(BOOLEAN isDraggable);
CView::SetDragging to enable or disable dragging of this object whenever the user selects it via a mouse click. See Dragging and Stretching Methods under CView for more information.
virtual void SetSizing(BOOLEAN isSizable);
CView::SetSizing to enable or disable sizing of this object whenever the user selects it via a mouse click. See Dragging and Stretching Methods under CView for more information.
RWOrdered GetPoints(void) const;
CPointRWC points that define the polygon.
virtual BOOLEAN HitTest(const CPoint &theHitLoc) const;
theHitLoc is a point in one of the polygon's lines.
CPolygon(CSubview* theEnclosure, const CRect& theRegion);
theEnclosure is a pointer to the subview that will contain the polygon. theRegion is a coordinate location, local to the enclosure, that is used to place the polygon. This is a protected constructor for classes such as CRegularPoly, which create their internal point structures themselves.
void AdjustInternalPoints(void);
CRect CreatePoints(const CPoint* theArrayOfPoints,
int theNumberOfPoints);
CPoints and an integer value indicating the number of points, this method translates the points into coordinates for the XVT Portability Toolkit.
CRect CreatePoints(const CIdOrderedList* theListOfPoints);
CPoints, this method translates the points into coordinates for the XVT Portability Toolkit.
CRect BoundingRect();
CRect object representing the rectangular region bounding all points in the polygon.