Public Member Functions | Public Attributes

Template Class Reference

Search for all occurrences

Detailed Description

See also:
Class PolyShape, Class Box2D, Class Spline3D, Class PolyLine.

Description:
This class defines a 2D template object. This object is used to test shapes for self-intersection, clockwise status, point surrounding and intersection with other templates. The last and first points will be the same if it is closed. All methods of this class are implemented by the system.

Note: Developers should use the PolyShape class instead of this class. It provides methods for the same purposes.
Data Members:
int points;

The number of points in the template.

BOOL closed;

Indicates if the template is closed.

Point2 *pts;

The template points.

#include <templt.h>

Inheritance diagram for Template:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  Template (Spline3D *spline)
  Template (PolyLine *line)
  Template (Template3D *t3)
void  Create (PolyLine *line)
  ~Template ()
int  Points ()
BOOL  SurroundsPoint (Point2 &point)
BOOL  IsClockWise ()
BOOL  SelfIntersects (BOOL findAll=FALSE, IntersectionCallback2D *cb=NULL)
BOOL  Intersects (Template &t, BOOL findAll=FALSE, IntersectionCallback2D *cb=NULL)
Box2D  Bound ()

Public Attributes

int  points
BOOL  closed
Point2 pts

Constructor & Destructor Documentation

Template ( Spline3D spline )
Remarks:
Constructor.
Parameters:
Spline3D *spline

Builds the template from this spline.
Template ( PolyLine line )
Remarks:
Constructor.
Parameters:
PolyLine *line

Builds the template from this polyline.
Template ( Template3D t3 )
~Template ( )
Remarks:
Destructor.

Member Function Documentation

void Create ( PolyLine line )
Remarks:
Updates the template with the data from the specified PolyLine.
Parameters:
PolyLine *line

Builds the template from this polyline.
int Points ( ) [inline]
Remarks:
Returns the number of points.
{ return points; }
BOOL SurroundsPoint ( Point2 point )
Remarks:
Returns TRUE if the specified point is surrounded (contained within) this Template.
Parameters:
Point2& point

The point to check.
BOOL IsClockWise ( )
Remarks:
Returns TRUE if the Template is clockwise in the XY plane (it ignores Z); otherwise FALSE. If the Template self intersects, the results from this method are meaningless.
BOOL SelfIntersects ( BOOL  findAll = FALSE,
IntersectionCallback2D cb = NULL 
)
Remarks:
Returns TRUE if the Template intersects itself in the XY plane (it ignores Z); otherwise FALSE.
Parameters:
BOOL findAll = FALSE

TRUE to find all self intersections. FALSE to find only the first self intersection.

IntersectionCallback2D *cb = NULL

A pointer to an IntersectionCallback2D class.
BOOL Intersects ( Template t,
BOOL  findAll = FALSE,
IntersectionCallback2D cb = NULL 
)
Remarks:
Returns TRUE if the specified Template intersects this Template in the XY plane (it ignores Z); otherwise FALSE.
Parameters:
Template &t

The Template to check.

BOOL findAll = FALSE

TRUE to find all self intersections. FALSE to find only the first self intersection.

IntersectionCallback2D *cb = NULL

A pointer to an IntersectionCallback2D class.
Box2D Bound ( )
Remarks:
Returns an instance of the Box2D class that contains two corner points defining the bounding box size of this template.

Member Data Documentation

int points
BOOL closed

Template Template Template Template Template Template Template Template Template Template
Template Template Template Template Template Template Template Template Template Template