Changeset 152 for osgVisual/src/util
- Timestamp:
- Nov 9, 2010, 10:56:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/src/util/visual_util.cpp
r151 r152 89 89 } 90 90 91 xmlNode* util::getModuleXMLConfig(std::string configFilename, std::string moduleName, xmlDoc*& doc )91 xmlNode* util::getModuleXMLConfig(std::string configFilename, std::string moduleName, xmlDoc*& doc, bool& disabled) 92 92 { 93 93 doc = NULL; 94 disabled = false; 94 95 xmlNode *root_element = NULL; 95 96 … … 126 127 127 128 // If file is a valid osgVisual config file, check all the root xml node and all of it's children of osgvisualconfiguration for the specified module 128 xmlNode* tmpNode = checkXMLNodeChildrenForModule(root_element, moduleName );129 130 if( !tmpNode ) // if no valid node was found : clenaup. Otherwise: the caller has to clean up.129 xmlNode* tmpNode = checkXMLNodeChildrenForModule(root_element, moduleName, disabled); 130 131 if( !tmpNode ) // if no valid node was found or the module is disabled: clean up. Otherwise: the caller has to clean up. 131 132 { 132 133 xmlFreeDoc(doc); // free the document … … 139 140 } 140 141 141 xmlNode* util::checkXMLNodeChildrenForModule(xmlNode* node, std::string moduleName )142 { 143 for (xmlNode *cur_node = node; cur_node; cur_node = cur_node->next) // iterate through all elements142 xmlNode* util::checkXMLNodeChildrenForModule(xmlNode* node, std::string moduleName, bool& disabled) 143 { 144 for (xmlNode *cur_node = node; cur_node; cur_node = cur_node->next) // iterate through all XML elements 144 145 { 145 146 // Is the node the one we are searching for? … … 170 171 if( attr_name == "enabled" && attr_value == "yes" ) 171 172 { 172 OSG_ ALWAYS<< "Found XML module configuration for " << moduleName << std::endl;173 OSG_DEBUG << "Found XML module configuration for " << moduleName << std::endl; 173 174 return cur_node; 174 175 } 175 176 if( attr_name == "enabled" && attr_value == "no" ) 176 177 { 177 OSG_ALWAYS << "Found XML module configuration for " << moduleName << ", but it is DISABLED." << std::endl; 178 disabled = true; 179 OSG_DEBUG << "Found XML module configuration for " << moduleName << ", but it is DISABLED." << std::endl; 178 180 return NULL; 179 181 } … … 183 185 else // Otherwise: check its children.. 184 186 { 185 xmlNode* tmp_XmlNode = checkXMLNodeChildrenForModule(cur_node->children, moduleName );187 xmlNode* tmp_XmlNode = checkXMLNodeChildrenForModule(cur_node->children, moduleName, disabled); 186 188 if(tmp_XmlNode) 187 189 return tmp_XmlNode;
Note: See TracChangeset
for help on using the changeset viewer.