Changeset 183 for osgVisual/trunk/src/dataIO
- Timestamp:
- Jan 7, 2011, 5:41:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/dataIO/visual_dataIO.cpp
r160 r183 49 49 void visual_dataIO::init(osgViewer::Viewer* viewer_, osg::ArgumentParser& arguments_, std::string configFileName) 50 50 { 51 OSG_NOTIFY( osg::ALWAYS ) << "visual_dataIO initialize.." << std::endl;51 OSG_NOTIFY( osg::ALWAYS ) << "visual_dataIO initialize.."; 52 52 53 53 // Init variables … … 56 56 // Process XML configuration 57 57 this->configFileName = configFileName; 58 if(!processXMLConfiguration()) 58 xmlNode *extLinkConfig=NULL; 59 if(!processXMLConfiguration(extLinkConfig)) 59 60 OSG_FATAL << "ERROR: visual_dataIO::init() - Failed to initialize dataIO via XML configuration!"; 60 61 62 // Create Cluster.63 #ifdef USE_CLUSTER_ASIO_TCP_IOSTREAM64 cluster = new dataIO_clusterAsioTcpIostream();65 #endif66 #ifdef USE_CLUSTER_ENET67 cluster = new dataIO_clusterENet();68 cluster->enableHardSync( false ); /** \todo : rebuild this structure in cluster.h and move it this way to a general implementation. */69 #endif70 #ifdef USE_CLUSTER_DUMMY71 cluster = new dataIO_clusterDummy();72 #endif73 if(cluster.valid())74 //cluster->init(arguments_, clusterMode, slotContainer, true, false);75 cluster->init(arguments_, viewer_, clusterMode, slotContainer, false, false);76 61 77 62 // Create extLink. … … 85 70 86 71 87 88 72 // Install callbacks to perform DataIO activities every frame: 89 73 //// EventCallback at the absolute beginning of the frame … … 97 81 } 98 82 99 bool visual_dataIO::processXMLConfiguration( )83 bool visual_dataIO::processXMLConfiguration(xmlNode* extLinkConfig_) 100 84 { 101 85 // Init XML … … 103 87 bool disabled; 104 88 xmlNode* config = util::getModuleXMLConfig( configFileName, "dataio", tmpDoc, disabled ); 89 xmlNode* clusterConfig = NULL; 105 90 106 91 if( disabled) 107 92 OSG_NOTIFY( osg::ALWAYS ) << "..disabled by XML configuration file. dataIO can't be disabled. Ignoring." << std::endl; 93 else 94 OSG_NOTIFY( osg::ALWAYS ) << std::endl; 108 95 109 96 // extract configuration values … … 152 139 if(cur_node->type == XML_ELEMENT_NODE && node_name == "cluster") 153 140 { 154 // Check Attributes to determine if the dummy implementation or any other implementation must be instantiated155 156 // Pass XML attributes to cluster to analyse and configure it by cluster itself141 // Pass cluster configuration to the used cluster implementation. 142 // The implementation will use the configuration if it matches, otherwise falls back to dummy cluster 143 clusterConfig = cur_node; 157 144 } 158 145 … … 166 153 167 154 } // FOR all nodes END 155 156 157 158 // Create Cluster. 159 #ifdef USE_CLUSTER_ASIO_TCP_IOSTREAM 160 cluster = new dataIO_clusterAsioTcpIostream(); 161 #endif 162 #ifdef USE_CLUSTER_ENET 163 cluster = new dataIO_clusterENet(); 164 #endif 165 if( !cluster.valid() || !clusterConfig || !cluster->init(clusterConfig, viewer, clusterMode, slotContainer, false) ) 166 { 167 cluster = new dataIO_clusterDummy(); 168 cluster->init(clusterConfig, viewer, clusterMode, slotContainer, false); 169 } 170 171 168 172 169 173 // clean up … … 176 180 return false; 177 181 } 178 179 182 return true; 180 183 }
Note: See TracChangeset
for help on using the changeset viewer.