Changeset 186 for osgVisual/trunk/src/dataIO
- Timestamp:
- Jan 8, 2011, 8:13:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/dataIO/visual_dataIO.cpp
r185 r186 54 54 viewer = viewer_; 55 55 56 // Process XML configuration 56 // Process XML configuration - all XML dependen initializations are performed in processXMLConfiguration() 57 57 this->configFileName = configFileName; 58 xmlNode *extLinkConfig=NULL; 59 if(!processXMLConfiguration(extLinkConfig)) 58 if(!processXMLConfiguration()) 60 59 OSG_FATAL << "ERROR: visual_dataIO::init() - Failed to initialize dataIO via XML configuration!"; 61 60 62 // Create extLink.63 #ifdef USE_EXTLINK_DUMMY64 extLink = new dataIO_extLinkDummy( dataSlots );65 #endif66 #ifdef USE_EXTLINK_VCL67 extLink = new dataIO_extLinkVCL( dataSlots );68 #endif69 extLink->init();70 71 72 61 // Install callbacks to perform DataIO activities every frame: 73 62 //// EventCallback at the absolute beginning of the frame … … 81 70 } 82 71 83 bool visual_dataIO::processXMLConfiguration( xmlNode* extLinkConfig_)72 bool visual_dataIO::processXMLConfiguration() 84 73 { 85 74 // Init XML … … 87 76 bool disabled; 88 77 xmlNode* config = util::getModuleXMLConfig( configFileName, "dataio", tmpDoc, disabled ); 89 xmlNode* clusterConfig = NULL ;78 xmlNode* clusterConfig = NULL, *extLinkConfig = NULL; 90 79 91 80 if( disabled) … … 147 136 if(cur_node->type == XML_ELEMENT_NODE && node_name == "extlink") 148 137 { 149 // Check Attributes to determine if the dummy implementation or any other implementation must be instantiated150 151 // Pass XML attributes to extlink to analyse and configure it by extLink itself138 // Pass extLink configuration to the used extLink implementation. 139 // The implementation will use the configuration if it matches, otherwise falls back to dummy extLink 140 extLinkConfig = cur_node; 152 141 } 153 142 154 143 } // FOR all nodes END 155 156 144 157 145 … … 169 157 } 170 158 159 // Create extLink. 160 #ifdef USE_EXTLINK_VCL 161 extLink = new dataIO_extLinkVCL( dataSlots ); 162 #endif 163 if( !extLink.valid() || !extLinkConfig || !extLink->init(extLinkConfig) ) 164 { 165 extLink = new dataIO_extLinkDummy( dataSlots ); 166 extLink->init(extLinkConfig); 167 } 171 168 172 169
Note: See TracChangeset
for help on using the changeset viewer.