Class BezierShape

3DS Max Plug-In SDK

Class BezierShape

See Also: Class ShapeObject, Class Spline3D, Class PatchCapInfo, Class ShapeVSel, Class ShapeSSel, Class ShapePSel, Class Material, Working with Shapes and Splines.

class BezierShape : public BaseInterfaceServer

Description:

Defines a basic bezier shape object. The BezierShape is effectively a collection of Bezier Splines. For example the 3ds max Donut object has two splines in a hierarchy to make a shape. The BezierShape contains these splines.

Method Groups:

The following hyperlinks jump to the start of groups of related methods within the class:

Constructors / Destructor / Init()

Get/SetVert()

Render / Select / Snap / HitTest

Shape Hierarchy / Reverse() / MakeFirst()

MakePolyShape() / ReadyCachedPolyShape()

Bounding Box / Transform() / InvalidateGeomCache() / InvalidateCapCache() / FreeAll()

Data Flow Evaluation

Display Flags

Selection / UpdateSels()

Load() / Save()

SplineCount() / GetSpline() / NewSpline() / AddSpline() / DeleteSpline() / InsertSpline() / NewShape()

Get/SetClosures()

GetNumVerts() / GetNumSegs()

Capping Methods

Operators

Data Members:

public:

PatchCapInfo patchCap;

Patch capping cache (mesh capping and hierarchy caches stored in PolyShape cache)

BOOL patchCapCacheValid;

Indicates if the patch cap is valid or not.

Spline3D **splines;

A pointer to the list of splines.

int splineCount;

The number of splines in this shape.

int steps;

Number of steps (a value of -1 will use adaptive).

BOOL optimize;

Setting this to TRUE optimizes linear segments

ShapeVSel vertSel;

The selected vertices.

ShapeSSel segSel;

The selected segments.

ShapePSel polySel;

The selected polygons.

int bezVecPoly;

This is used internally in hit testing.

int bezVecVert;

This is used internally in hit testing.

DWORD selLevel;

Selection level.

SHAPE_OBJECT - Object level selection.

SHAPE_SPLINE - Spline level selection (a single polygon within the shape).

SHAPE_SEGMENT - Segment level selection.

SHAPE_VERTEX - Vertex level selection.

DWORD dispFlags;

Display attribute flags. See List of BezierShape Display Flags.

Tab<bindShape> bindList;

The table of bind points. See Template Class Tab.

 

Methods:

Constructors / Destructor / Init()

Prototype:

BezierShape();

Remarks:

The data members are initialized as follows:

splines = NULL;

splineCount = 0;

dispFlags = 0;

selLevel = SHAPE_OBJECT;

bdgBox.Init();

bezVecPoly = -1;

bezVecVert = -1;

vertSel.Empty();

segSel.Empty();

polySel.Empty();

optimize = FALSE;

steps = 5;

Prototype:

BezierShape(BezierShape& fromShape);

Remarks:

Constructor. The shape is initialized based on the fromShape.

Prototype:

void Init();

Remarks:

Initializes the BezierShape. The data members are initialized as follows:

splines = NULL;

splineCount = 0;

dispFlags = 0;

selLevel = SHAPE_OBJECT;

bdgBox.Init();

bezVecPoly = -1;

bezVecVert = -1;

vertSel.Empty();

segSel.Empty();

polySel.Empty();

optimize = FALSE;

steps = 5;

Prototype:

~BezierShape();

Remarks:

Destructor. All the splines in this shape are cleared.

Get/SetVert()

Prototype:

Point3& GetVert(int poly, int i);

Remarks:

Returns the 'i-th' vertex of the specified spline.

Parameters:

int poly

The index into the splines list where poly >= 0 and poly < splineCount.

int i

The index of the control point in the spline.

Prototype:

void SetVert(int poly, int i, const Point3 &xyz);

Remarks:

Sets the 'i-th' vertex of the specified spline.

Parameters:

int poly

The index into the splines list where poly >= 0 and poly < splineCount.

int i

The index of the vertex in the spline.

const Point3 &xyz

The point to set.

Render / Select / Snap / HitTest

Prototype:

void Render(GraphicsWindow *gw, Material *ma, RECT *rp, int compFlags, int numMat);

Remarks:

This is used internally to render the shape.

Prototype:

BOOL Select(GraphicsWindow *gw, Material *ma, HitRegion *hr,

int abortOnHit = FALSE);

Remarks:

This is used internally to hit test the shape.

Prototype:

void Snap(GraphicsWindow *gw, SnapInfo *snap, IPoint2 *p, Matrix3 &tm);

Remarks:

This is used internally to snap to the shape.

Prototype:

void Snap(GraphicsWindow *gw, SnapInfo *snap, IPoint2 *p,

Matrix3 &tm, DWORD flags);

Remarks:

This is used internally to snap to the shape.

Prototype:

BOOL SubObjectHitTest(GraphicsWindow *gw, Material *ma, HitRegion *hr,

DWORD flags, SubShapeHitList& hitList );

Remarks:

This method is used internally to perform sub-object hit testing of the shape.

Prototype:

float FindSegmentPoint(int poly, int segment, GraphicsWindow *gw,

Material *ma, HitRegion *hr, int ptype = PARAM_SIMPLE);

Remarks:

This is used for hit testing. This method returns a value from 0.0 to 1.0 that tells you where a hit was found on a particular segment. Sample code that uses this is the edit spline modifier in \MAXSDK\SAMPLES\MODIFIERS\EDITSPL.H. This allows a refinement of the hit testing.

Parameters:

int poly

The index of the spline.

int segment

The index of the segment.

GraphicsWindow *gw

The graphics window where the hit test was done.

Material *ma

The list of materials.

HitRegion *hr

The hit region. See Class HitRegion.

int ptype = PARAM_SIMPLE

This parameter is available in release 4.0 and later only.

This allows the caller to get the location on the segment in either parameter space or normalized distance space. Both return values of 0-1. For proper backward compatibility, the default parameter type is PARAM_SIMPLE. The other option is PARAM_NORMALIZED.

Bounding Box / Transform() / InvalidateGeomCache() / InvalidateCapCache() / FreeAll()

Prototype:

void BuildBoundingBox(void);

Remarks:

Computes the bounding box of the splines making up this bezier shape object. The result is stored in the bdgBox data member.

Prototype:

Box3 GetBoundingBox(Matrix3 *tm=NULL);

Remarks:

Returns the bounding box of the splines making up this bezier shape object. The optional TM allows the box to be calculated in any space.

Parameters:

Matrix3 *tm=NULL

The matrix to transform the points before computing the bounding box.

Prototype:

void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel );

Remarks:

Computes the bounding box of this shape.

Parameters:

TimeValue t

This parameter is not used.

Box3& box

The result is stored here.

Matrix3 *tm

The points of each spline in this shape are deformed using this matrix.

BOOL useSel

If TRUE the box is computed about the selected vertices only; otherwise all points.

Prototype:

void Transform(Matrix3 &tm);

Remarks:

Transforms the points of each poly in the shape by the matrix passed.

Parameters:

Matrix3 &tm

The transformation matrix.

Prototype:

void InvalidateGeomCache();

Remarks:

This method should be called when a shape changes. It invalidates the caches of the shape. This resets the bounding box, and removes the hierarchy, cap and shape caches.

Prototype:

void InvalidateCapCache();

Remarks:

This method is used internally.

Prototype:

void FreeAll();

Remarks:

Frees everything from the shape.

Data Flow Evaluation

Prototype:

void ShallowCopy(BezierShape *ashape, ULONG_PTR channels);

Remarks:

This method is used internally in data flow evaluation

Prototype:

void DeepCopy(BezierShape *ashape, ULONG_PTR channels);

Remarks:

This method is used internally in data flow evaluation

Prototype:

void NewAndCopyChannels(ULONG_PTR channels);

Remarks:

This method is used internally in data flow evaluation

Prototype:

void FreeChannels(ULONG_PTR channels, int zeroOthers=1);

Remarks:

This method is used internally in data flow evaluation

Display Flag Access

Prototype:

void SetDispFlag(DWORD f);

Remarks:

Sets the state of the specified display flags.

Parameters:

DWORD f

The flags to set. See List of BezierShape Display Flags.

Prototype:

DWORD GetDispFlag(DWORD f);

Remarks:

Returns the state of the specified display flags.

Parameters:

DWORD f

The flags to get. See List of BezierShape Display Flags.

Prototype:

void ClearDispFlag(DWORD f);

Remarks:

Clears the specified display flags.

Parameters:

DWORD f

The flags to clear. See List of BezierShape Display Flags.

Selection / UpdateSels()

Prototype:

BitArray VertexTempSel(int poly, int level = -1);

Remarks:

Constructs a vertex selection list based on the current selection level for the specified spline. For example if the selection level is at object level all the bits are set. If the selection level is at vertex level only the selected vertex bits are set. See Class BitArray.

Parameters:

int poly

The index into the splines data member.

int level = -1

This allows a selction level to be optionally specified. For example if the selection level is at object level all the bits are set. If the selection level is at vertex level only the selected vertex bits are set. One of the following values:

SHAPE_OBJECT

SHAPE_SPLINE

SHAPE_SEGMENT

SHAPE_VERTEX

Prototype:

BitArray VertexTempSelAll(int poly = -1, BOOL includeVecs = FALSE, int level = 0, BOOL forceSel = FALSE);

Remarks:

This method looks at the selection state for the selection level and sets the appropriate bits based on the selection set unless forceSel is TRUE. If forceSel is TRUE, it acts as if every item in the selection set for the specified spline was set. It's an easy way to select entire splines.

See Class BitArray.

Parameters:

int poly = -1

The index into the splines data member (-1 means use all).

BOOL includeVecs = FALSE

If set, this method will set the bits for vectors associated with selected knots.

int level = 0

This allows a selction level to be optionally specified. For example if the selection level is at object level all the bits are set. If the selection level is at vertex level only the selected vertex bits are set. One of the following values:

SHAPE_OBJECT

SHAPE_SPLINE

SHAPE_SEGMENT

SHAPE_VERTEX

BOOL forceSel = FALSE

If TRUE, it acts as if every item in the selection set for the specified spline was set. It's an easy way to select entire splines. For example, selecting spline 2 regardless of the spline-level selection state:

VertexTempSelAll(2, FALSE, SHAPE_SPLINE, TRUE);

This just builds the selection set as if spline 2 was completely selected. Otherwise, the spline bits would have only been selected if BezierShape::polySel.sel[2] was set.

Incidentally, the following calls will do exactly the same thing:

VertexTempSelAll(2, FALSE, SHAPE_VERTEX, TRUE);

VertexTempSelAll(2, FALSE, SHAPE_SEGMENT, TRUE);

For what it's worth, the SHAPE_SPLINE version is the most efficient.

Prototype:

void UpdateSels(BOOL save = FALSE);

Remarks:

This is a very important call to make. When you are done adding polygons to the shape you should call this method. This method updates a set of embedded selection set data within the shape. This selection set data tells what polygons are selected, what segments are selected, and what control points are selected. This resets the sizes of the selection bit arrays for this shape.

Parameters:

BOOL save = FALSE

This parameter is available in release 4.0 and later only.

This optional parameter preserves the selection set information when set to TRUE, and erases it when set to FALSE. The default, FALSE, is present for backward compatibility, where there was no argument.

Load() / Save()

Prototype:

IOResult Save(ISave* isave);

Remarks:

Saves the shape data to the .MAX file.

Prototype:

IOResult Load(ILoad* iload);

Remarks:

Loads the shape data from the .MAX file.

SplineCount() / GetSpline() / NewSpline() / AddSpline() / DeleteSpline() / InsertSpline() / NewShape()

Prototype:

inline int SplineCount();

Remarks:

Returns the number of splines in this shape.

Prototype:

Spline3D* GetSpline(int index);

Remarks:

Returns a pointer to the spline specified by the index passed.

Parameters:

int index

Specifies which spline to return. This is an index into the splines data member.

Prototype:

Spline3D* NewSpline(int itype = KTYPE_CORNER,int dtype = KTYPE_BEZIER,

int ptype = PARM_UNIFORM);

Remarks:

Creates and adds an empty spline to the shape.

Parameters:

int itype = KTYPE_CORNER

The initial knot type you get when you click and release the mouse during spline creation. See List of Knot Types.

int dtype = KTYPE_BEZIER

The drag knot type used when you click and drag to create a vertex during spline creation. See List of Knot Types.

int ptype = PARM_UNIFORM

This parameter is not used. Let it default to PARM_UNIFORM.

Return Value:

A pointer to the newly created spline.

Prototype:

Spline3D* AddSpline(Spline3D* spline);

Remarks:

Add an existing spline to this shape as the last one in the list. Note that this copies only the pointer, it does not copy the entire spline, so do not delete the spline anywhere else. This will do it when it's done with it.

Parameters:

Spline3D* spline

The spline to add.

Return Value:

A pointer to the spline passed or NULL if the call failed.

Prototype:

int DeleteSpline(int index);

Remarks:

Deletes the specified spline.

Parameters:

int index

The index into the splines data member.

Return Value:

Nonzero on success; otherwise zero.

Prototype:

int InsertSpline(Spline3D* spline, int index);

Remarks:

Inserts the specified spline into the spline list at the location passed.

Parameters:

Spline3D* spline

The spline to add.

int index

The index in to the splines data member indicating where to insert the spline.

Return Value:

Nonzero on success; otherwise zero.

Prototype:

void NewShape();

Remarks:

This method deletes every spline in the shape.

Prototype:

void AddAndWeld(BezierShape &from, float weldThreshold);

Remarks:

This method is available in release 3.0 and later only.

This method is used for adding the splines from one BezierShape to another, with a weld threshold that will weld endpoints of the new splines onto endpoints of existing splines. Calling this method will cause the splines of the "from" shape to be added to those of the shape. If any endpoints in the "from" shape are within the specified weld threshold, they will be automatically welded.

Parameters:

BezierShape &from

The shape whose splines are added.

float weldThreshold

The endpoint weld threshold.

GetNumVerts() / GetNumSegs()

Prototype:

int GetNumVerts();

Remarks:

Returns the total number of vertices in the entire shape.

Prototype:

int GetNumSegs();

Remarks:

Returns the total number of segments in the entire shape.

Get/SetClosures()

Prototype:

void GetClosures(BitArray& array);

Remarks:

For each spline in this shape, this method sets the corresponding bit if the shape is closed and clears the bit is the shape is open.

Parameters:

BitArray& array

The BitArray to update.

Prototype:

void SetClosures(BitArray& array);

Remarks:

Sets the closed state of each spline in this shape based on the BitArray passed.

Parameters:

BitArray& array

Indicates which shapes should be closed: 1 = closed; 0 = open.

Shape Hierarchy / Reverse() / MakeFirst()

Prototype:

ShapeHierarchy &OrganizeCurves(TimeValue t, ShapeHierarchy *hier = NULL);

Remarks:

This methods looks at the shape organization, and puts together a shape hierarchy. This provides information on how the shapes are nested. For example on a donut object with two circles, this method determines which circle is inside the other one.

Parameters:

TimeValue t

This parameter is not used.

ShapeHierarchy *hier = NULL

If non-NULL the result is store here (in addition to being returned). See Class ShapeHierarchy.

Return Value:

The result is returned here.

Prototype:

void Reverse(int poly, BOOL keepZero = FALSE);

Remarks:

Reverses the spline whose index is passed.

Parameters:

int poly

The spline to reverse.

BOOL keepZero = FALSE

This optional parameter is available in release 2.0 and later only.

This parameter defaults to FALSE in order to retain backwards compatibility. Setting it to TRUE insures that a closed spline will have the same vertex as its first point when it is reversed. The parameter is ignored on open splines.

Prototype:

void Reverse(BitArray &reverse, BOOL keepZero = FALSE);

Remarks:

Reverses the splines of this shape if the corresponding bit in reverse is set.

Parameters:

BitArray &reverse

If the bit is set the spline is reversed; otherwise it is left alone.

BOOL keepZero = FALSE

This optional parameter is available in release 2.0 and later only.

This parameter defaults to FALSE in order to retain backwards compatibility. Setting it to TRUE insures that a closed spline will have the same vertex as its first point when it is reversed. The parameter is ignored on open splines.

Prototype:

void MakeFirst(int poly, int vertex);

Remarks:

Sets the specified vertex of the specified poly as the first vertex. On an open polygon this has to be one of the end control points. On a closed shape it doesn't matter.

Parameters:

int poly

The poly to update.

int vertex

The vertex to make first.

MakePolyShape() / ReadyCachedPolyShape()

Prototype:

void MakePolyShape(PolyShape &pshp, int steps = -1, BOOL optimize = FALSE);

Remarks:

Makes a PolyShape from this shape.

Parameters:

PolyShape &pshp

The results are stored here.

int steps = -1

The number of steps between knots in the spline.

BOOL optimize = FALSE

If TRUE, linear segments between control points in the spline will not generate steps in between. It will just be one line segment.

Prototype:

void ReadyCachedPolyShape();

Remarks:

This method is used internally.

Capping Methods

Prototype:

int MakeCap(TimeValue t, MeshCapInfo &capInfo, int capType);

Remarks:

This method is passed a capping information structure and it will compute the information it needs to make a mesh cap for this shape.

Parameters:

TimeValue t

This parameter is not used.

MeshCapInfo &capInfo

The capping information. See Class MeshCapInfo.

int capType

See List of Shape Capping Types.

Return Value:

Nonzero if the method succeeded; otherwise zero.

Prototype:

int MakeCap(TimeValue t, PatchCapInfo &capInfo);

Remarks:

This method is passed a capping information structure and it will compute the information it needs to make a patch cap for this shape.

Parameters:

TimeValue t

This parameter is not used.

PatchCapInfo &capInfo

The capping information. See Class PatchCapInfo.

Return Value:

Nonzero if the method succeeded; otherwise zero.

Prototype:

int ReadyPatchCap();

Remarks:

This method is used internally by the BezierShape code. When you call BezierShape::MakeCap(TimeValue t, PatchCapInfo &capInfo), if the patch cap data isn't cached, this method is called to build it. Calling it is not normally necessary, or a good idea -- it builds the PatchCapInfo data structure regardless of whether it's cached or not. Just call the MakeCap() method to get the cap information and the caching is done automatically.

Prototype:

void CopyShapeDataFrom(BezierShape &fromShape);

Remarks:

This method copies the shapes, selection sets and any caches from the source object. It does not copy selection level, or display information.

Parameters:

BezierShape &fromShape

The shape to copy from.

Prototype:

void PrepVertBaseIndex();

Remarks:

This method is used internally.

Prototype:

int GetVertIndex(int poly, int vert);

Remarks:

This method provides an easy way to derive a simple index for any vertex in any spline in the shape.

Parameters:

int poly

The zero based index of the spline.

int vert

The zero based index of the vertex.

Return Value:

A zero based index for vertex.

Prototype:

void GetPolyAndVert(int index, int &polyOut, int &vertOut);

Remarks:

This method takes a vertex index and turns it back into a poly / vertex pair (see GetVertIndex() above).

Parameters:

int index

The input index.

int &polyOut

The output poly.

int &vertOut

The output vertex.

Prototype:

int GetTotalVerts();

Remarks:

Returns the total number of verticies in the shape.

Prototype:

void PrepKnotBaseIndex();

Remarks:

This method is used internally, automatically.

Prototype:

int GetKnotIndex(int poly, int knot);

Remarks:

This method returns an index for any knot in any spline in the shape.

Parameters:

int poly

The input poly number.

int knot

The input know number.

Return Value:

The zero based index of the knot.

Prototype:

void GetPolyAndKnot(int index, int &polyOut, int &knotOut);

Remarks:

This method computes a poly / knot pair from an index (see GetKnotIndex() above).

Parameters:

int index

The input knot index.

int &polyOut

The output index of the poly it is a part of.

int &knotOut

The output knot number.

Prototype:

int GetTotalKnots();

Remarks:

Returns the total number of knots in the shape.

Prototype:

BOOL DeleteSelVerts(int poly);

Remarks:

Deletes the selected vertices for the specified poly in the shape.

Parameters:

int poly

The zero based index of the polygon.

Return Value:

TRUE if any were deleted; FALSE if none were deleted.

Prototype:

BOOL DeleteSelSegs(int poly);

Remarks:

Deletes the selected polygons for the specified poly in the shape.

Parameters:

int poly

The zero based index of the polygon.

Return Value:

TRUE if any were deleted; FALSE if none were deleted.

Prototype:

BOOL DeleteSelectedVerts();

Remarks:

Deletes the selected vertices for all polys in the shape.

Return Value:

TRUE if any were deleted; FALSE if none were deleted.

Prototype:

BOOL DeleteSelectedSegs();

Remarks:

Deletes the selected segments for all polys in the shape.

Return Value:

TRUE if any were deleted; FALSE if none were deleted.

Prototype:

BOOL DeleteSelectedPolys();

Remarks:

Deletes the selected polygons for all polys in the shape.

Return Value:

TRUE if any were deleted; FALSE if none were deleted.

Prototype:

BOOL CloneSelectedParts(BOOL reverse=FALSE);

Remarks:

Copies the selected geometry (segments or polys), reversing if needed.

Parameters:

BOOL reverse=FALSE

TRUE to reverse; FALSE to leave alone.

Return Value:

Returns TRUE if anything was copied.

Prototype:

BOOL RecordTopologyTags(int channel=0);

Remarks:

Tags the points in the spline components to record the topology of the shape. (This stores identifying values in the Spline3D's Knot::aux fields for each control point). This info can be used after topology-changing operations to remap information tied to control points.

Parameters:

int channel=0

This parameter is available in release 3.0 and later only.

Specifies which auxiliary channel. One of the following values:

0=aux2

1=aux3

Return Value:

Returns FALSE if > 32767 knots or polys (it can't record that many).

Prototype:

Point3 InterpCurve3D(int poly, float param, int ptype=PARAM_SIMPLE);

Remarks:

This method returns a point interpolated on the specified spline on the entire curve. This method returns the point but you don't know which segment the point falls on. See method InterpPiece3D().

Parameters:

int poly

The zero based index of the spline.

float param

The position along the curve to return where 0 is the start and 1 is the end.

int ptype=PARAM_SIMPLE

The parameter type for spline interpolation. See List of Parameter Types for Shape Interpolation.

Return Value:

The interpolated point on the curve.

Prototype:

Point3 TangentCurve3D(int poly, float param, int ptype=PARAM_SIMPLE);

Remarks:

This method returns a tangent vector interpolated on the entire curve of the specified spline. Also see method TangentPiece3D().

Parameters:

int poly

The zero based index of the spline.

float param

The position along the curve to return where 0 is the start and 1 is the end.

int ptype=PARAM_SIMPLE

The parameter type for spline interpolation. See List of Parameter Types for Shape Interpolation.

Return Value:

The tangent vector

Prototype:

Point3 InterpPiece3D(int poly, int piece, float param, int ptype=PARAM_SIMPLE);

Remarks:

This method returns the interpolated point along the specified sub-curve (segment) for the specified spline. For example consider a shape that is a single circle with four knots. If you called this method with curve=0 and piece=0 and param=0.0 you'd get back the point at knot 0. If you passed the same parameters except param=1.0 you'd get back the point at knot 1.

Parameters:

int poly

The zero based index of the spline.

int piece

The sub-curve (segment) to evaluate.

float param

The position along the curve to return where 0 is the start and 1 is the end.

int ptype=PARAM_SIMPLE

The parameter type for spline interpolation. See List of Parameter Types for Shape Interpolation.

Return Value:

The point in world space.

Prototype:

Point3 TangentPiece3D(int poly, int piece, float param, int ptype=PARAM_SIMPLE);

Remarks:

Returns the tangent vector of the specified spline on a sub-curve at the specified 'distance' along the curve.

Parameters:

int poly

The zero based index of the spline.

int piece

The sub-curve (segment) to evaluate.

float param

The position along the curve to return where 0 is the start and 1 is the end.

int ptype=PARAM_SIMPLE

The parameter type for spline interpolation. See List of Parameter Types for Shape Interpolation.

Prototype:

float LengthOfCurve(int poly);

Remarks:

Returns the length of the specified spline.

Parameters:

int poly

The index of the spline to check.

Prototype:

MtlID GetMatID(int poly, int piece);

Remarks:

This method is available in release 3.0 and later only.

Returns the material ID for the specified spline and segment of this shape.

Parameters:

int poly

The zero based index of the spline.

int piece

The zero based index of the segment of the spline.

Prototype:

void GetTopology(BezierShapeTopology &topo);

Remarks:

This method is available in release 3.0 and later only.

Retrieves information on the shape topology.

Parameters:

BezierShapeTopology &topo

The object which is updated with the shape data. See Class BezierShapeTopology.

Prototype:

BOOL PerformTrimOrExtend(IObjParam *ip, ViewExp *vpt, ShapeHitData *hit, IPoint2 &m, ShapeContextCallback &cb, int trimType, int trimInfinite);

Remarks:

This method is available in release 3.0 and later only.

This method provides a way for a BezierShape to trim and extend splines. This method is meant to perform as part of a mouse-centered operation -- Click on the part of the spline and pass the hitrecord, viewport and mouse point to the trim function.

Parameters:

IObjParam *ip

The interface pointer. See Class Interface.

ViewExp *vpt

The viewport the user clicked in. See Class ViewExp.

ShapeHitData *hit

The hit record for the selection. See Class ShapeHitData.

IPoint2 &m

The point the user clicked on in the viewport. See Class IPoint2.

ShapeContextCallback &cb

The callback object. See Class ShapeContextCallback.

int trimType

Specifies if the operation is a Trim or an Extend. One of the following values:

SHAPE_TRIM

SHAPE_EXTEND

int trimInfinite

This is set to TRUE for infinite projections.

Return Value:

This returns TRUE if the trim or extend was performed.

Prototype:

void BindKnot(BOOL isEnd, int segIndex, int splineSegID, int splinePointID);

Remarks:

This method is available in release 3.0 and later only.

This method binds a knot to a segment. A bind acts as a constraint, it constrains the first point or the end point of a spline to the mid point of a segment.

Parameters:

BOOL isEnd

Specifies whether the first or last point is bound. TRUE for the end; FALSE for the start.

int segIndex

The index of the segment to be bound to.

int splineSegID

The index of the spline that contains the segment.

int splinePointID

The index of spline that is being bound.

Prototype:

void UnbindKnot(int splineID, BOOL isEnd);

Remarks:

This method is available in release 3.0 and later only.

This method unbinds the specified spline.

Parameters:

int splineID

The index of spline that is being bound.

BOOL isEnd

Specifies whether the first or last point is unbound. TRUE for the end; FALSE for the start.

Prototype:

void UpdateBindList(BOOL useGeomTracking=FALSE);

Remarks:

This method is available in release 3.0 and later only.

This method needs to be called when the topology changes to update the bind list.

Parameters:

BOOL useGeomTracking=FALSE

This parameter is available in release 4.0 and later only.

This allows the update to be dependant on previous recorded topology or geometry. If this flag is set to TRUE it uses the old method of using the geometry to rebuild the binds, else it uses the new method which uses the aux flags of the splines which store the old topology indices. Normally this will be FALSE since most of the times the topology tracking is more accurate, it should be set to TRUE when there is no initial topology to work from for instance when attaching or detaching geometry.

Prototype:

BOOL HideSelectedSegs();

Remarks:

This method is available in release 3.0 and later only.

Hides the selected segments.

Return Value:

TRUE if any were hidden. FALSE if none were hidden.

Prototype:

BOOL HideSelectedVerts();

Remarks:

This method is available in release 3.0 and later only.

Hides the segments attached to the selected vertices.

Return Value:

TRUE if any were hidden. FALSE if none were hidden.

Prototype:

BOOL HideSelectedSplines();

Remarks:

This method is available in release 3.0 and later only.

Hides the segments attached to the selected splines.

Return Value:

TRUE if any were hidden. FALSE if none were hidden.

Prototype:

BOOL UnhideSegs();

Remarks:

This method is available in release 3.0 and later only.

Unhides all the segments in the shape.

Return Value:

TRUE if any were unhidden. FALSE if none were unhidden.

Operators:

Prototype:

BezierShape& operator+=(BezierShape& from);

Remarks:

This lets you add another shape to this one.

Prototype:

BezierShape& operator=(BezierShape& fromShape);

Remarks:

Assignment operator.

Prototype:

BezierShape& operator=(PolyShape& fromShape);

Remarks:

Assignment operator.