#include <NBFSaver.h>
Inheritance diagram for NBFSaveTraverser:
Public Types | |
enum | { VIEWSIZE = 0x04000000 } |
Public Methods | |
NBFSaveTraverser () | |
Default constructor. More... | |
void | preCalculateFileSize (const nvsg::ViewState *viewState, const nvsg::Scene *scene) |
pre-calculate what the file size would be. More... | |
bool | mapViewOfFile (const std::string &file) |
Map a view of file into the applications address space. More... | |
void | unmapViewOfFile () |
Unmap the current view and close the corresponding file. More... | |
Protected Methods | |
bool | calculatingStorageRequirements () const |
Determine whether the current traverser pass is calculating storage requirements. More... | |
uint_t | alloc (void *&ptr, size_t numBytes) |
Allocate a portion of the currently mapped file into the process' address space. More... | |
uint_t | pseudoAlloc (size_t numBytes) |
Add numBytes to the currently calculated file size. More... | |
virtual void | doApply (const nvsg::ViewState *viewState, const nvsg::Scene *scene) |
Controls saving of the scene together with a ViewState. More... | |
virtual void | handleJitterCamera (const nvsg::JitterCamera *p, const nvsg::Node *root) |
Routine to handle a JitterCamera object while traversing the scene graph. More... | |
virtual void | handleParallelCamera (const nvsg::ParallelCamera *p, const nvsg::Node *root) |
Routine to handle a ParallelCamera object while traversing the scene graph. More... | |
virtual void | handlePerspectiveCamera (const nvsg::PerspectiveCamera *p, const nvsg::Node *root) |
Routine to handle a PerspectiveCamera object while traversing the scene graph. More... | |
virtual void | handleStereoCamera (const nvsg::StereoCamera *p, const nvsg::Node *root) |
Routine to handle a StereoCamera object while traversing the scene graph. More... | |
virtual void | handleGeoNode (const nvsg::GeoNode *p) |
Routine to handle a GeoNode while traversing the scene graph. More... | |
virtual void | handleGroup (const nvsg::Group *p) |
Routine to handle a Group node while traversing the scene graph. More... | |
virtual void | handleTransform (const nvsg::Transform *p) |
Routine to handle a Transform node while traversing the scene graph. More... | |
virtual void | handleAnimatedTransform (const nvsg::AnimatedTransform *p) |
Routine to handle a AnimatedTransform node while traversing the scene graph. More... | |
virtual void | handleLOD (const nvsg::LOD *p) |
Routine to handle a LOD (Level Of Detail) node while traversing the scene graph. More... | |
virtual void | handleSwitch (const nvsg::Switch *p) |
Routine to handle a Switch node while traversing the scene graph. More... | |
virtual void | handleDirectedLight (const nvsg::DirectedLight *p) |
Routine to handle a DirectedLight node while traversing the scene graph. More... | |
virtual void | handlePointLight (const nvsg::PointLight *p) |
Routine to handle a PointLight node while traversing the scene graph. More... | |
virtual void | handleSpotLight (const nvsg::SpotLight *p) |
Routine to handle a SpotLight node while traversing the scene graph. More... | |
virtual void | handleStateSet (const nvsg::StateSet *p) |
Routine to handle a StateSet object while traversing the scene graph. More... | |
virtual void | handleCgFx (const nvsg::CgFx *p) |
Routine to handle a CgFx attribute while traversing the scene graph. More... | |
virtual void | handleFaceAttribute (const nvsg::FaceAttribute *p) |
Routine to handle a FaceAttribute attribute while traversing the scene graph. More... | |
virtual void | handleMaterial (const nvsg::Material *p) |
Routine to handle a Material attribute while traversing the scene graph. More... | |
virtual void | handleTextureAttribute (const nvsg::TextureAttribute *p) |
Routine to handle a TextureAttribute attribute while traversing the scene graph. More... | |
virtual void | handleTextureAttributeItem (const nvsg::TextureAttributeItem *p, size_t tu) |
Routine to handle a TextureAttributeItem object while traversing the scene graph. More... | |
virtual void | handleTriangles (const nvsg::Triangles *p) |
Routine to handle a Triangles object while traversing the scene graph. More... | |
virtual void | handleAnimatedTriangles (const nvsg::AnimatedTriangles *p) |
Routine to handle a AnimatedTriangles object while traversing the scene graph. More... | |
virtual void | handleSkinnedTriangles (const nvsg::SkinnedTriangles *p) |
Routine to handle a SkinnedTriangles object while traversing the scene graph. More... | |
virtual void | handleTriStrips (const nvsg::TriStrips *p) |
Routine to handle a TriStrips object while traversing the scene graph. More... | |
virtual void | handleQuads (const nvsg::Quads *p) |
Routine to handle a Quads object while traversing the scene graph. More... | |
virtual void | handleAnimatedQuads (const nvsg::AnimatedQuads *p) |
Routine to handle a AnimatedQuads object while traversing the scene graph. More... | |
virtual void | handleQuadStrips (const nvsg::QuadStrips *p) |
Routine to handle a QuadStrips object while traversing the scene graph. More... | |
virtual void | handleFramedTrafoAnimation (const nvsg::FramedAnimation< nvmath::Trafo > *p) |
Routine to handle a FramedAnimation<Trafo> object while traversing the scene graph. More... | |
virtual void | handleFramedVNVectorAnimation (const nvsg::FramedAnimation< nvsg::VNVector > *p) |
Routine to handle a FramedAnimation<VNVector> object while traversing the scene graph. More... | |
virtual void | handleLinearInterpolatedTrafoAnimation (const nvsg::LinearInterpolatedAnimation< nvmath::Trafo > *p) |
Routine to handle a LinearInterpolatedAnimation<Trafo> object while traversing the scene graph. More... | |
virtual void | handleLinearInterpolatedVNVectorAnimation (const nvsg::LinearInterpolatedAnimation< nvsg::VNVector > *p) |
Routine to handle a LinearInterpolatedAnimation<VNVector> object while traversing the scene graph. More... |
|
Default constructor.
|
|
pre-calculate what the file size would be.
|
|
Map a view of file into the applications address space.
|
|
Unmap the current view and close the corresponding file.
|
|
Determine whether the current traverser pass is calculating storage requirements. While saving a scene, the scene graph will be traversed twice. The first pass is to calculate storage requirements. Only the second pass really writes the scene data to a file that has been mapped into the process' address space by the framework. Handler routines should call this function to determine what the current pass is intended for.
|
|
Allocate a portion of the currently mapped file into the process' address space. The function maps the amount of numBytes bytes of the currently mapped file into the process' address space. The start address of the mapped memory block will be assigned to ptr.
|
|
Add numBytes to the currently calculated file size. The function doesnt allocate anything, it just adds numBytes to the currently calculated file size.
|
|
Controls saving of the scene together with a ViewState.
Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a JitterCamera object while traversing the scene graph. This routine gets called for each JitterCamera object that will be visited while traversing the scene graph. The currently visited JitterCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a ParallelCamera object while traversing the scene graph. This routine gets called for each ParallelCamera object that will be visited while traversing the scene graph. The currently visited ParallelCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a PerspectiveCamera object while traversing the scene graph. This routine gets called for each PerspectiveCamera object that will be visited while traversing the scene graph. The currently visited PerspectiveCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a StereoCamera object while traversing the scene graph. This routine gets called for each StereoCamera object that will be visited while traversing the scene graph. The currently visited StereoCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a GeoNode while traversing the scene graph. This routine gets called for each GeoNode object that will be visited while traversing the scene graph. The currently visited GeoNode object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a Group node while traversing the scene graph. This routine gets called for each Group object that will be visited while traversing the scene graph. The currently visited Group object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a Transform node while traversing the scene graph. This routine gets called for each Transform object that will be visited while traversing the scene graph. The currently visited Transform object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a AnimatedTransform node while traversing the scene graph. This routine gets called for each AnimatedTransform object that will be visited while traversing the scene graph. The currently visited AnimatedTransform object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a LOD (Level Of Detail) node while traversing the scene graph. This routine gets called for each LOD object that will be visited while traversing the scene graph. The currently visited LOD object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a Switch node while traversing the scene graph. This routine gets called for each Switch object that will be visited while traversing the scene graph. The currently visited Switch object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a DirectedLight node while traversing the scene graph. This routine gets called for each DirectedLight object that will be visited while traversing the scene graph. The currently visited DirectedLight object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a PointLight node while traversing the scene graph. This routine gets called for each PointLight object that will be visited while traversing the scene graph. The currently visited PointLight object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a SpotLight node while traversing the scene graph. This routine gets called for each SpotLight object that will be visited while traversing the scene graph. The currently visited SpotLight object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a StateSet object while traversing the scene graph. This routine gets called for each StateSet object that will be visited while traversing the scene graph. The currently visited StateSet object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a CgFx attribute while traversing the scene graph. This routine gets called for each CgFx object that will be visited while traversing the scene graph. The currently visited CgFx object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a FaceAttribute attribute while traversing the scene graph. This routine gets called for each FaceAttribute object that will be visited while traversing the scene graph. The currently visited FaceAttribute object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a Material attribute while traversing the scene graph. This routine gets called for each Material object that will be visited while traversing the scene graph. The currently visited Material object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a TextureAttribute attribute while traversing the scene graph. This routine gets called for each TextureAttribute object that will be visited while traversing the scene graph. The currently visited TextureAttribute object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a TextureAttributeItem object while traversing the scene graph. This routine gets called for each TextureAttributeItem object that will be visited while traversing the scene graph. The currently visited TextureAttributeItem object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a Triangles object while traversing the scene graph. This routine gets called for each Triangles object that will be visited while traversing the scene graph. The currently visited Triangles object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a AnimatedTriangles object while traversing the scene graph. This routine gets called for each AnimatedTriangles object that will be visited while traversing the scene graph. The currently visited AnimatedTriangles object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a SkinnedTriangles object while traversing the scene graph. This routine gets called for each SkinnedTriangles object that will be visited while traversing the scene graph. The currently visited SkinnedTriangles object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a TriStrips object while traversing the scene graph. This routine gets called for each TriStrips object that will be visited while traversing the scene graph. The currently visited TriStrips object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a Quads object while traversing the scene graph. This routine gets called for each Quads object that will be visited while traversing the scene graph. The currently visited Quads object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a AnimatedQuads object while traversing the scene graph. This routine gets called for each AnimatedQuads object that will be visited while traversing the scene graph. The currently visited AnimatedQuads object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a QuadStrips object while traversing the scene graph. This routine gets called for each QuadStrips object that will be visited while traversing the scene graph. The currently visited QuadStrips object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a FramedAnimation<Trafo> object while traversing the scene graph. This routine gets called for each FramedAnimation<Trafo> object that will be visited while traversing the scene graph. The currently visited FramedAnimation<Trafo> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a FramedAnimation<VNVector> object while traversing the scene graph. This routine gets called for each FramedAnimation<VNVector> object that will be visited while traversing the scene graph. The currently visited FramedAnimation<VNVector> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a LinearInterpolatedAnimation<Trafo> object while traversing the scene graph. This routine gets called for each LinearInterpolatedAnimation<Trafo> object that will be visited while traversing the sc ene graph. The currently visited LinearInterpolatedAnimation<Trafo> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |
|
Routine to handle a LinearInterpolatedAnimation<VNVector> object while traversing the scene graph. This routine gets called for each LinearInterpolatedAnimation<VNVector> object that will be visited while traversing the scene graph. The currently visited LinearInterpolatedAnimation<VNVector> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes. \note: The behavior is undefined if p points to an invalid location. Reimplemented from nvtraverser::Traverser. |