Template Class Reference

Template Class Reference

#include <templt.h>

Class 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.
+ Inheritance diagram for Template:

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
 
Point2pts
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

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.
117 { return points; }
int points
Definition: templt.h:94
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
Point2* pts