InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PMPolygon4 Class Reference

#include <PMPolygon4.h>

Public Types

typedef base_type data_type
 

Public Member Functions

 PMPolygon4 ()
 
 PMPolygon4 (const PMRect &r)
 
 PMPolygon4 (const PMPolygon4 &other)
 
void SetPoints (const PMRect &r)
 
bool16 IsEmpty () const
 
PMPolygon4operator= (const PMPolygon4 &other)
 
PMPoint operator[] (int16 index) const
 
PMPointoperator[] (int16 index)
 
PMRect GetContainingRect () const
 

Detailed Description

A C++ class for a 4-side polygon. This polygon is defined by 4 points.

Constructor & Destructor Documentation

PMPolygon4::PMPolygon4 ()

Default constructor.

PMPolygon4::PMPolygon4 (const PMRectr)

Contstructor a polygon with a given rectangle.

Parameters
ris the rectangle.
PMPolygon4::PMPolygon4 (const PMPolygon4other)

Contstructor a polygon with another polygon.

Parameters
otheris the PMPolygon4.

Member Function Documentation

PMRect PMPolygon4::GetContainingRect () const
Returns
the smallest rectangle that contains this polygon.
bool16 PMPolygon4::IsEmpty () const
Returns
true if this is an empty polygon.
PMPolygon4& PMPolygon4::operator= (const PMPolygon4other)

Return true if two polygons are equal.

Parameters
otherspecifies the other PMPolygon4 to compare with.
Returns
true if both are equal.
PMPoint PMPolygon4::operator[] (int16 index) const

Returns the nth point of the polygon. 0 is the top left, 1 is top right, 2 is bottom right, 3 is bottom left.

Parameters
indexshould be >= 0 and <= 3.
Returns
the nth point.
PMPoint& PMPolygon4::operator[] (int16 index)

Returns the nth point of the polygon. 0 is the top left, 1 is top right, 2 is bottom right, 3 is bottom left.

Parameters
indexshould be >= 0 and <= 3.
Returns
the nth point.
void PMPolygon4::SetPoints (const PMRectr)

Set four points for the polygon from the given rectangle.

Parameters
ris the rectangle.