3ds Max C++ API Reference
Loading...
Searching...
No Matches
shape.h File Reference
#include "maxheap.h"
#include "shphier.h"
#include "spline3d.h"
#include "shpsels.h"
#include "hitdata.h"
#include "TabTypes.h"
#include "GraphicsConstants.h"
#include "Util/CountedObject.h"

Classes

struct  bindShape
 Contains the data for the bind points. More...
 
class  ShapeSubHitRec
 
class  SubShapeHitList
 class SubShapeHitList More...
 
class  ShapeHitData
 
class  ShapeContextCallback
 
class  BezierShapeTopology
 
class  BezierShapeInterface_Ex41
 

class BezierShapeInterface_Ex41 : public BaseInterface

More...
 
class  BezierShape
 Defines a basic bezier shape object. More...
 

Macros

#define SHAPE_TRIM   0
 
#define SHAPE_EXTEND   1
 
#define BEZIER_SHAPE_INTERFACE_EX41   Interface_ID(0x23526cd1, 0x695d7e4e)
 
#define GET_BEZIER_SHAPE_INTERFACE_EX41()    (BezierShapeInterface_Ex41*) GetInterface(BEZIER_SHAPE_INTERFACE_EX41)
 

Functions

CoreExport bool BezierShapeFindWeldTarget (ViewExp *pVpt, Matrix3 &tm, BezierShape *shape, int polyIndex, int knotToCompare, bool allowSelfWeld, bool autoWeld, int &weldToPolyOut, int &weldToKnotOut)
 Find an endpoint weld target in a shape.
 
CoreExport void BezierShapeDoPolyLastToFirstWeld (BezierShape *shape, int polyIndex)
 Weld the last knot of a spline to the first knot in the same spline.
 

Macro Definition Documentation

◆ SHAPE_TRIM

#define SHAPE_TRIM   0

◆ SHAPE_EXTEND

#define SHAPE_EXTEND   1

◆ BEZIER_SHAPE_INTERFACE_EX41

#define BEZIER_SHAPE_INTERFACE_EX41   Interface_ID(0x23526cd1, 0x695d7e4e)

◆ GET_BEZIER_SHAPE_INTERFACE_EX41

#define GET_BEZIER_SHAPE_INTERFACE_EX41 ( )     (BezierShapeInterface_Ex41*) GetInterface(BEZIER_SHAPE_INTERFACE_EX41)

Function Documentation

◆ BezierShapeFindWeldTarget()

CoreExport bool BezierShapeFindWeldTarget ( ViewExp pVpt,
Matrix3 tm,
BezierShape shape,
int  polyIndex,
int  knotToCompare,
bool  allowSelfWeld,
bool  autoWeld,
int weldToPolyOut,
int weldToKnotOut 
)

Find an endpoint weld target in a shape.

This is designed to work with the 3ds Max insert/create mechanism when it's working with the last knot in the shape being edited. It will use one of two threshold values depending on whether automatic endpoint welding is enabled. Caller has the option to allow the spline being edited to weld to itself (this will always be the knot being edited ('knotToCompare') welding to the first knot in the spline).

If any knots in the shape have endpoints that are appropriate for welding, the function will fill in the 'weldToPolyOut' poly and 'weldToKnotOut' knot indices with non-negative indices of the candidate knot.

Parameters
[in]pVptPointer to the ViewExp for the viewport being used. This viewport will be used to compute the distance between endpoint knots in screen space, which is used with the auto-weld distance threshold value.
[in]tmTransform of the object.
[in]shapePointer to the BezierShape containing the spline being edited and the weld target candidate splines.
[in]polyIndexThe index of the spline being edited.
[in]knotToCompareThe index of the knot that will be compared to candidate weld-target knots.
[in]allowSelfWeldTrue if the caller wants to allow the spline being edited to weld 'knotToCompare' to its own first knot.
[in]autoWeldtrue if End Point Auto-Welding is to be used.
[out]weldToPolyOutThe index of the spline being welded to or -1 if no weld found.
[out]weldToKnotOutThe index of the knot in the spline being welded to or -1 if no weld found.
Returns
true if a weld candidate was found; false otherwise.

◆ BezierShapeDoPolyLastToFirstWeld()

CoreExport void BezierShapeDoPolyLastToFirstWeld ( BezierShape shape,
int  polyIndex 
)

Weld the last knot of a spline to the first knot in the same spline.

This function performs last-to-first knot welding in a spline. It shifts the position of the last knot to align with the first knot, including the Bezier vectors, if any, sets the first knot type as needed to preserve the spline's shape and closes the spline.

Parameters
[in]shapePointer to the BezierShape containing the spline being welded.
[in]polyIndexThe index of the spline being welded.