48#define DROP_REFS( aType, aList ) \
51 std::vector<aType*>::iterator sL = aList.begin(); \
52 std::vector<aType*>::iterator eL = aList.end(); \
55 ( (SGNODE*) *sL )->delNodeRef( this ); \
65#define DEL_OBJS( aType, aList ) \
68 std::vector<aType*>::iterator sL = aList.begin(); \
69 std::vector<aType*>::iterator eL = aList.end(); \
72 ( (SGNODE*) *sL )->SetParent( nullptr, false ); \
82#define UNLINK_NODE( aNodeID, aType, aNode, aOwnedList, aRefList, isChild ) \
85 if( aNodeID == aNode->GetNodeType() ) \
87 std::vector<aType*>* oSL; \
88 std::vector<aType*>::iterator sL; \
89 std::vector<aType*>::iterator eL; \
97 if( (SGNODE*) *sL == aNode ) \
112 if( (SGNODE*) *sL == aNode ) \
114 delNodeRef( this ); \
128#define ADD_NODE( aNodeID, aType, aNode, aOwnedList, aRefList, isChild ) \
131 if( aNodeID == aNode->GetNodeType() ) \
133 std::vector<aType*>::iterator sL; \
134 sL = std::find( aOwnedList.begin(), aOwnedList.end(), aNode ); \
135 if( sL != aOwnedList.end() ) \
137 sL = std::find( aRefList.begin(), aRefList.end(), aNode ); \
138 if( sL != aRefList.end() ) \
142 SGNODE* ppn = (SGNODE*) aNode->GetParent(); \
143 if( nullptr != ppn ) \
147 std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; \
148 std::cerr << " * [BUG] object '" << aNode->GetName(); \
149 std::cerr << "' has multiple parents '" << ppn->GetName() << "', '"; \
150 std::cerr << m_Name << "'\n"; \
154 aOwnedList.push_back( (aType*) aNode ); \
155 aNode->SetParent( this, false ); \
166 aRefList.push_back( (aType*) aNode ); \
167 aNode->addNodeRef( this ); \
175#define FIND_NODE( aType, aName, aNodeList, aCallingNode ) \
178 std::vector<aType*>::iterator sLA = aNodeList.begin(); \
179 std::vector<aType*>::iterator eLA = aNodeList.end(); \
180 SGNODE* psg = nullptr; \
181 while( sLA != eLA ) \
183 if( (SGNODE*) *sLA != aCallingNode ) \
185 psg = (SGNODE*) ( *sLA )->FindNode( aName, this ); \
186 if( nullptr != psg ) \
219 std::vector< SGVECTOR >& norms );
An object to maintain a coordinate index list.
Define a vertex coordinate set for a scenegraph object.
Define a set of vertex normals for a scene graph object.
bool ReadVector(std::istream &aFile, SGVECTOR &aVector)
bool ReadPoint(std::istream &aFile, SGPOINT &aPoint)
bool WritePoint(std::ostream &aFile, const SGPOINT &aPoint)
bool WriteColor(std::ostream &aFile, const SGCOLOR &aColor)
bool CalcTriangleNormals(std::vector< SGPOINT > coords, std::vector< int > &index, std::vector< SGVECTOR > &norms)
void FormatColor(std::string &result, const SGCOLOR &aColor)
void FormatFloat(std::string &result, double value)
S3D::SGTYPES ReadTag(std::istream &aFile, std::string &aName)
Read the text tag of a binary cache file which is the NodeTag and unique ID number combined.
bool WriteVector(std::ostream &aFile, const SGVECTOR &aVector)
void FormatVector(std::string &result, const SGVECTOR &aVector)
void FormatPoint(std::string &result, const SGPOINT &point)
bool degenerate(glm::dvec3 *pts) noexcept
bool ReadColor(std::istream &aFile, SGCOLOR &aColor)
void FormatOrientation(std::string &result, const SGVECTOR &axis, double rotation)
defines the low level classes common to scene graph nodes
defines the types of intermediate scene graph objects
wxString result
Test unit parsing edge cases and error handling.