Class LinearShape

3DS Max Plug-In SDK

Class LinearShape

See Also: Class ShapeObject, Class PolyShape, Working with Shapes and Splines.

class LinearShape : public ShapeObject

Description:

This class represents a linear shape object. This class is similar to a SplineShape except this class uses a PolyShape as its data while a SplineShape uses a BezierShape as its data. Therefore this is a shape made up of entirely linear segments. All methods of this class are implemented by the system.

Data Members:

public:

PolyShape shape;

The PolyShape that holds the linear shape.

Methods:

Prototype:

LinearShape();

Remarks:

Constructor.

Prototype:

~LinearShape();

Remarks:

Destructor.

Prototype:

PolyShape& GetShape();

Remarks:

Returns the shape data member.

Prototype:

void SetPointFlags();

Remarks:

This method does the job of setting all points in the PolyShape to POLYPT_KNOT types, and removing the POLYPT_INTERPOLATED flag. This is because the LinearShape knows nothing about its origin.

Prototype:

virtual MtlID GetMatID(TimeValue t, int curve, int piece);

Remarks:

This method is available in release 3.0 and later only.

This method provides access to the material IDs of the shape. It returns the material ID of the specified segment of the specified curve of this shape at the time passed. There is a default implementation so there is no need to implement this method if the shape does not support material IDs.

Note: typedef unsigned short MtlID;

Parameters:

TimeValue t

The time to evaluate the sub-curve.

int curve

The zero based index of the curve to evaluate.

int piece

The sub-curve (segment) to evaluate.