| PathEngine home | previous: | next: |
Instantiate a content snapshot that was previously saved out to persistant storage.
void loadSnapshot(
const char* format,
const char* dataBuffer, tUnsigned32 bufferSize,
const iFaceVertexMesh *const*& meshObjectPointers,
tSigned32& numberOfMeshObjects,
const iSolidObjects*& solidObjects,
tSigned32& extrudeHeight,
tSigned32& maxStepHeight,
tSigned32& maxSlope,
const char *const*& options
) const;
|
| format |
A C string specifying the format of the data in the buffer.
Currently this can be "xml" or "tok" (lower case). This format string is not retained after the call and can subsequently be safely deleted. | ||
| dataBuffer | A byte buffer. This buffer is not retained after the call and can subsequently be safely deleted. | ||
| bufferSize | The size of the buffer pointed to by dataBuffer, in bytes. | ||
| meshObjectPointers |
If numberOfMeshObjects is non-zero then this argument returns a buffer containing pointers to each of the instantiated mesh objects. Otherwise this will be set to zero. | ||
| numberOfMeshObjects | The number of mesh objects instantiated (and the size of the returned mesh objects buffer). | ||
| solidObjects |
If the snapshot includes solid object data, then this returns a pointer to an object instantiated for this data. Otherwise returns zero. | ||
| extrudeHeight | Set to the value saved out for this parameter in the content snapshot. | ||
| maxStepHeight | Set to the value saved out for this parameter in the content snapshot. | ||
| maxSlope | Set to the value saved out for this parameter in the content snapshot. | ||
| options |
If any additional options were saved out with the snapshot
then this returns a buffer allocated and filled with pointers to allocated C strings for these
saved options. Otherwise this returns zero. |
Running 3D content processing against a loaded snapshot should be identical to
running the processing against the original data used to generate the snapshot.
The objects and data buffers set by this method can be passed directly into
iFaceVertexMesh and iSolidObjects
derived objects are allocated and constructed internally by PathEngine,
together with buffers for mesh object pointers and options.
These objects and memory buffers are managed internally by PathEngine, and can be freed by calling
The memory buffers and objects should not be deleted directly by the client application, even through interface object virtual destructor methods.
One potential use for this is to import content snapshots into custom editors or 3rd party content applications, for visualisation and analysis.
The code for this could then look something like the following:
// import a 3D content snapshot
const iFaceVertexMesh** meshObjectPointers;
tSigned32 numberOfMeshObjects;
const iSolidObjects* solidObjects;
tSigned32 extrudeHeight;
tSigned32 maxStepHeight;
tSigned32 maxSlope;
const char** options;
cp3d->loadSnapshot(
format, &fileBuffer.front(), SizeL(fileBuffer),
meshObjectPointers, numberOfMeshObjects,
solidObjects,
extrudeHeight, maxStepHeight, maxSlope,
options
);
tSigned32 i;
for(i = 0; i != numberOfMeshObjects; ++i)
{
ImportFaceVertexMesh(*meshObjectPointers[i]);
}
if(solidObjects)
{
ImportSolidObjects(*solidObjects); // this can then use iContentProcessing3D::generateHullsForVisualisation(), internally, to convert point clouds to meshes, if desired
}
cp3d->deleteLoadedSnapshot(
meshObjectPointers, numberOfMeshObjects,
solidObjects,
options
);
|
| Documentation for PathEngine release 5.29 - Copyright © 2002-2012 PathEngine | next: |