1 #ifndef __NodeInfo_hh__
2 #define __NodeInfo_hh__
4 #include <bias_config.h>
5 #include <Base/Debug/Error.hh>
6 #include <Base/Debug/Exception.hh>
8 #include <Base/Common/XMLBase.hh>
10 #include <GLviewer/OpenSceneGraphHelper.hh>
11 #include <GLviewer/Scenes/SceneOpenSceneGraphDefines.hh>
42 BEXCEPTION(
"String2NodeType(): Invalid string \""+val+
"\"");
93 TopLevelTag =
"NodeInfo";
104 std::string NodeInfoStr
117 std::stringstream ss;
142 std::stringstream ss;
170 TopLevelTag =
"NodeInfoMap";
180 unsigned int dummycouter = 1;
184 osg::Node* invalidcrap =
185 (osg::Node* ) (
long)dummycouter;
187 temp.
XMLIn(Cur,XMLObject);
188 (*this)[invalidcrap] = temp;
198 std::map< osg::Node*, NodeInfo >::const_iterator it;
199 for(it=begin(); it!=end(); it++)
201 (*it).second.XMLAdd(Node,XMLObject);
208 return(find(node)!=end());
void addAttribute(const xmlNodePtr Node, const std::string &AttributeName, bool AttributeValue)
Add an attribute to a node.
virtual int XMLGetClassName(std::string &TopLevelTag, double &Version) const
derived classes must implement this, so that it returns the name of the class for the top level tag i...
NodeInfoMap * pNodeInfoMap
xmlNodePtr getNextChild()
Get the next child of the parent specified in the last getFirstChild() call, the class remembers the ...
enum eNodeType GetNodeType(const osg::ref_ptr< osg::Node > node)
bool NodeHasNodeInfo(osg::Node *node) const
container for scene root and ptr to nodeinfomap
struct containing details of a OSG::Node when used in a wxTreeCtrlOpenSGWx
bool getAttributeValueBool(const xmlAttrPtr Attribute) const
Get the value of a given Attribute, with type-cast overloads for different attribute types...
static std::string NodeTypeXMLStrings[]
virtual int XMLOut(const xmlNodePtr Node, BIAS::XMLIO &XMLObject) const
derived classes must implement this to write the code of (*this) into the XML tree.
std::string getAttributeValueString(const xmlAttrPtr Attribute) const
enum eNodeType String2NodeType(const std::string &val)
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
xmlNodePtr getFirstChild(const xmlNodePtr ParentNode)
Get the first child of a given parent, or NULL for no childs.
bool AreKeyPointersValid()
bool areKeyPointersValid_
osg::ref_ptr< osg::Node > RootNode
virtual int XMLIn(const xmlNodePtr Node, BIAS::XMLIO &XMLObject)
derived classes must implement this to read everything in Node into (*this).
virtual int XMLOut(const xmlNodePtr Node, BIAS::XMLIO &XMLObject) const
derived classes must implement this to write the code of (*this) into the XML tree.
Base class with interface for xml output.
unsigned long long MarkerID
virtual int XMLGetClassName(std::string &TopLevelTag, double &Version) const
derived classes must implement this, so that it returns the name of the class for the top level tag i...
virtual int XMLIn(const xmlNodePtr Node, BIAS::XMLIO &XMLObject)
derived classes must implement this to read everything in Node into (*this).
std::string NodeType2String(const enum eNodeType &t)
static bool HasInfo(const osg::ref_ptr< osg::Node > node, const std::string &key, std::string &value)
Checks if the node contains additional information in form of a key value pair.