57 std::map< SGAPPEARANCE const*, int >
matmap;
111 void SetName(
const char *aName);
160 virtual bool WriteVRML( std::ostream& aFile,
bool aReuseFlag ) = 0;
define an internal structure to be used by the 3D renders
Defines the generic material appearance of a scenegraph object.
The base class of all Scene Graph nodes.
void SetName(const char *aName)
void ResetNodeIndex(void) noexcept
Reset the global SG* node indices in preparation for write operations.
virtual bool WriteCache(std::ostream &aFile, SGNODE *parentNode)=0
Write this node's data to a binary cache file.
virtual bool AddRefNode(SGNODE *aNode)=0
const char * GetName(void)
virtual bool SetParent(SGNODE *aParent, bool notify=true)=0
Set the parent SGNODE of this object.
virtual SGNODE * FindNode(const char *aNodeName, const SGNODE *aCaller)=0
Search the tree of linked nodes and return a reference to the first node found with the given name.
bool isWritten(void) noexcept
Return true if the object had already been written to a cache file or VRML file.
SGNODE * GetParent(void) const noexcept
Returns a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.
virtual void ReNameNodes(void)=0
Rename a node and all its child nodes in preparation for write operations.
S3D::SGTYPES GetNodeType(void) const noexcept
Return the type of this node instance.
virtual bool AddChildNode(SGNODE *aNode)=0
SGNODE ** m_Association
Handle to the instance held by a wrapper.
void AssociateWrapper(SGNODE **aWrapperRef) noexcept
Associate this object with a handle to itself.
virtual bool WriteVRML(std::ostream &aFile, bool aReuseFlag)=0
Writes this node's data to a VRML file.
std::list< SGNODE * > m_BackPointers
nodes which hold a reference to this.
const char * GetNodeTypeName(S3D::SGTYPES aNodeType) const noexcept
SGNODE * m_Parent
Pointer to parent node; may be NULL for top level transform.
std::string m_Name
name to use for referencing the entity by name.
void addNodeRef(SGNODE *aNode)
Add a pointer to a node which references this node, but does not own.
virtual bool ReadCache(std::istream &aFile, SGNODE *parentNode)=0
Reads binary format data from a cache file.
virtual void unlinkChildNode(const SGNODE *aNode)=0
Remove references to an owned child.
void DisassociateWrapper(SGNODE **aWrapperRef) noexcept
Remove the association between an IFSG* wrapper object and this object.
void delNodeRef(const SGNODE *aNode)
Remove a pointer to a node which references this node, but does not own.
bool m_written
Set to true when the object has been written after a ReNameNodes().
S3D::SGTYPES m_SGtype
Type of Scene Graph node.
bool SwapParent(SGNODE *aNewParent)
Swap the ownership with the given parent.
virtual void unlinkRefNode(const SGNODE *aNode)=0
Remove pointers to a referenced node.
void INIT_SMESH(SMESH &aMesh) noexcept
char const * GetNodeTypeName(S3D::SGTYPES aType) noexcept
Return the name of the given type of node.
bool GetMatIndex(MATLIST &aList, SGNODE *aNode, int &aIndex)
void INIT_SMATERIAL(SMATERIAL &aMaterial)
void FREE_SMESH(SMESH &aMesh) noexcept
void INIT_S3DMODEL(S3DMODEL &aModel) noexcept
void FREE_S3DMODEL(S3DMODEL &aModel)
defines the low level classes common to scene graph nodes
defines the types of intermediate scene graph objects
Store the a model based on meshes and materials.
std::vector< SGAPPEARANCE const * > matorder
std::map< SGAPPEARANCE const *, int > matmap
Per-vertex normal/color/texcoors structure.