Class PolyPt

3DS Max Plug-In SDK

Class PolyPt

See Also: Class PolyLine.

class PolyPt

Description:

This class represents a single point of a PolyLine. All methods of this class are implemented by the system.

Data Members:

public:

Point3 p;

The location of the point.

DWORD flags;

Predefined PolyPt flags. Note that developers can use bits 0-7 of the flags for their own use. Bits 8 and above are used by the system.

If you are converting some other type of shape or spline to a PolyShape (and thus PolyLines) you can set certain flags to make things operate smoother. These flags are described below:

POLYPT_KNOT

This indicates if this point in the PolyLine corresponds to a knot in the original spline. For example if you had a circle that was a bezier spline it should have four of the points in the PolyLine designated as POLYPT_KNOT. These are the points at the 12 o'clock, 3 o'clock, 6 o'clock and 9 o'clock positions. Then all the other points would be POLYPT_INTERPOLATED. This is used to make capping more efficient, for example, the system generally tries to attach to a knot when making connections between polygons.

POLYPT_INTERPOLATED

This indicates the point is an interpolated point (not a knot).

POLYPT_SMOOTH

If you convert to a PolyLine, use this bit to control smoothing of the resulting shape. If this bit is set, it means that any mesh generated will share smoothing across the edge. For example, all the points on a curved section of a spline between knots will have this flag set. Then depending on the knot type (if it's a corner or bezier corner) then this smooth flag will not be set. If this shape is then extruded or lofted this information is used to determine smoothing groups. If this flag is set you'll get a smooth transition however if this bit is not set you'll get a nice sharp corner.

POLYPT_SEG_SELECTED

The segment that starts with this point is selected. This is used in the drawing routines so that PolyShapes generated from BezierShapes will still have the selected segments drawn in the selected color.

POLYPT_BRIDGE

This flag is used internally by the capping code.

POLYPT_SPLICE

This flag is used internally by the capping code.

POLYPT_VISEDGE

This flag is used internally by the capping code.

POLYPT_NO_SPLICE

This flag is used internally by the capping code.

int aux;

Auxiliary data attached to this point (usually a mesh vertex number for capping).

DWORD flags2;

This flag contains the material information for the segments. The mat ID is stored in the HIWORD.

#define POLYPT_MATID_SHIFT 16

#define POLYPT_MATID_MASK  0xFFFF

Methods:

Prototype:

PolyPt();

Remarks:

Constructor. The point p is set to 0,0,0, flags and flags2 are set to 0, aux is set to 0.

Prototype:

PolyPt(Point3 ip, DWORD f = 0, int a=0, DWORD f2=0);

Remarks:

Constructor. The point, flags, aux and flags2 data members are initialized to the data passed.

Prototype:

inline MtlID GetMatID();

Remarks:

This method is available in release 3.0 and later only.

This method gets the material ID on a per-segment basis within the spline or polyline.

Prototype:

inline void SetMatID(MtlID id);

Remarks:

This method is available in release 3.0 and later only.

This method sets the material ID on a per-segment basis within the spline or polyline.

Parameters:

MtlID id

The ID to set.