3ds Max C++ API Reference
Loading...
Searching...
No Matches
Template Class Reference

#include <C:/adskgit/3dsmax/3dsmax/3dswin/src/maxsdk/include/templt.h>

Inheritance diagram for Template:

Public Member Functions

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

Public Attributes

int points
BOOL closed
Point2 * pts

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.

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 normally use the PolyShape class instead of this class. It provides methods for the same purposes; the Template class additionally provides the ability to optionally use more precise double-precision math in the SurroundsPoint(), SelfIntersects() and Intersects() methods.
Data Members:
int points;

The number of points in the template.

BOOL closed;

Indicates if the template is closed.

Point2 *pts;

The template points.

Constructor & Destructor Documentation

◆ Template() [1/3]

Remarks
Constructor.
Parameters:
Spline3D *spline

Builds the template from this spline.

◆ Template() [2/3]

Remarks
Constructor.
Parameters:
PolyLine *line

Builds the template from this polyline.

◆ Template() [3/3]

◆ ~Template()

Remarks
Destructor.

Member Function Documentation

◆ Create()

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

Builds the template from this polyline.

◆ Points()

int Points ( )
inline
Remarks
Returns the number of points.
148 {
149 return points;
150 }
int points
Definition templt.h:124

◆ SurroundsPoint() [1/2]

CoreExport BOOL SurroundsPoint ( Point2 & point)
Remarks
Returns TRUE if the specified point is surrounded (contained within) this Template. (Legacy single-precision version)
Parameters:
Point2& point

The point to check.

◆ SurroundsPoint() [2/2]

CoreExport BOOL SurroundsPoint ( BOOL useDoubleMath,
Point2 & point )
Remarks
Returns TRUE if the specified point is surrounded (contained within) this Template, optionally using double-precision math for improved accuracy.
Parameters:
BOOL useDoubleMath

When TRUE, uses double-precision math for calculations for more precise results, at some additional computational cost.

Point2& point

The point to check.

◆ IsClockWise()

CoreExport 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.

◆ SelfIntersects() [1/2]

CoreExport BOOL SelfIntersects ( BOOL findAll = FALSE,
IntersectionCallback2D * cb = NULL ) const
Remarks
Returns TRUE if the Template intersects itself in the XY plane (it ignores Z); otherwise FALSE. (Legacy single-precision version)
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.

◆ SelfIntersects() [2/2]

CoreExport BOOL SelfIntersects ( BOOL useDoubleMath,
BOOL findAll = FALSE,
IntersectionCallback2D * cb = NULL ) const
Remarks
Returns TRUE if the Template intersects itself in the XY plane (it ignores Z); otherwise FALSE, optionally using double-precision math for improved accuracy.
Parameters:
BOOL useDoubleMath

When TRUE, uses double-precision math for intersection calculations for more precise results, at some additional computational cost.

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.

◆ Intersects() [1/2]

CoreExport 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. (Legacy single-precision version)
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.

◆ Intersects() [2/2]

CoreExport BOOL Intersects ( BOOL useDoubleMath,
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, optionally using double-precision math for improved accuracy.
Parameters:
BOOL useDoubleMath

When TRUE, uses double-precision math for intersection calculations for more precise results, at some additional computational cost.

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.

◆ Bound()

CoreExport 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

◆ points

int points

◆ closed

BOOL closed

◆ pts

Point2* pts