...
The class extension constructor is used mainly to create the extension parameters (look at the example below) and, possibly, allocate data structures needed throughout the life of the extension. These data structures must be freed in the class destructor. initializeForRendering is called just before rendering starts, and the incoming pMaxwell (always check != NULL ) is useful for accessing the scene while executing loadMesh.
loadMesh
virtual
...
bool
...
loadMesh(
...
Cmaxwell::Cobject&
...
meshToLoad
...
)
...
=
...
0;
Main function of the extension. It is where the actual work of filling a geometric object is done.
Arguments
Cmaxwell::Cobject& meshToLoad
: input/output, reference to the object being created.
...
true
on success, otherwise false
;
getBoundingBox
virtual
...
bool
...
getBoundingBox(
...
Cpoint&
...
min,
...
Cpoint&
...
max
...
);
Returns the bounding box of the newly created object, in local coordinates of the object.
Arguments
Cpoint& min
: output, reference to the lower corner of the bounding box.
Cpoint& max
: output, reference to the upper corner of the bounding box.
...
true
on success, otherwise false
;
getProxyDisplayPoints
virtual
...
bool
...
getProxyDisplayPoints(
...
const
...
dword&
...
percent,
...
const
...
dword&
...
maxPoints,
...
dword&
...
nPoints,
...
...
float*&
...
points
...
);
Allocates and fills the "points" array with the coordinates of points to be drawn in the Studio viewport. Also sets "nPoints" to the actual number of points filled.
Arguments
const dword& percent
: input, goes from 0 to 100, indicating the degree of desired precision to draw the proxy.
const dword& maxPoint
s : input, the maximum number of points allowed.
dword& nPoints
: output, the actual number of points allocated. Must be <= maxPoints.
float*& points
: output, array with the points, x0y0z0x1y1z1x2y2z2....
...
true
on success, otherwise false
;
getProxyDisplayLines
virtual
...
bool
...
getProxyDisplayLines(
...
const
...
dword&
...
percent,
...
const
...
dword&
...
maxPoints,
...
const
...
dword&
...
maxLines,
...
...
dword&
...
nPoints,
...
float*&
...
points,
...
dword&
...
nLines,
...
dword*&
...
pointsPerLine
...
);
Allocates and fills the "points" array and "pointsPerLine" array with with the coordinates of points, and number of points per line to be drawn in the Studio viewport. Also sets "nPoints" to the actual number of points created and nLines to the actual number of lines created.
Arguments
const dword& percent
: input, goes from 0 to 100, indicating the degree of desired precision to draw the proxy.
const dword& maxPoints
: input, the maximum number of points allowed.
const dword& maxLines
: input, the maximum number of lines allowed.
dword& nPoints
: output, the actual number of points allocated. Must be <= maxPoints.
float*& points
: output, array with the points, x0y0z0x1y1z1x2y2z2....
dword& nLines
: output, the actual number of lines created. Must be <= maxLines.
dword*& pointsPerLine
: output, array with the number of points per line, n0n1n2.... If this array is NULL, then the number of points per line is constant, and is nPoints/nLines.
...
true
on success, otherwise false
;
getProxyDisplayFaces
virtual
...
bool
...
getProxyDisplayFaces(
...
const
...
dword&
...
percent,
...
const
...
dword&
...
maxFaces,
...
dword&
...
nPoints,
...
...
float*&
...
points,
...
dword&
...
nFaces,
...
dword*&
...
faces
...
);
Allocates and fills the "points" array and "faces" array with with the coordinates of points, and indexes to vertices to be drawn in the Studio viewport. Also sets "nPoints" to the actual number of points created and "nFaces" to the actual number of triangles created.
Arguments
const dword& percent
: input, goes from 0 to 100, indicating the degree of desired precision to draw the proxy.
const dword& maxPoints
: input, the maximum number of points allowed.
const dword& maxFaces
: input, the maximum number of faces allowed.
dword& nPoints
: output, the actual number of points allocated. Must be <= maxPoints.
float*& points
: output, array with the points, x0y0z0x1y1z1x2y2z2....
dword& nFaces
: output, the actual number of faces created. Must be <= maxLines.
dword*& faces
: output, array with the indices to vertices in the "points" array v00v01v02v10v11v12v20v21v22....
...