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