[221] | 1 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer |
---|
[31] | 2 | * |
---|
| 3 | * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under |
---|
| 4 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
---|
| 5 | * (at your option) any later version. The full license is in LICENSE file |
---|
| 6 | * included with this distribution, and on the openscenegraph.org website. |
---|
| 7 | * |
---|
| 8 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
| 9 | * You have to aquire licenses for all used proprietary modules. |
---|
| 10 | * |
---|
| 11 | * This library is distributed in the hope that it will be useful, |
---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | * OpenSceneGraph Public License for more details. |
---|
| 15 | */ |
---|
| 16 | |
---|
[86] | 17 | |
---|
[31] | 18 | #include <visual_core.h> |
---|
| 19 | |
---|
| 20 | using namespace osgVisual; |
---|
| 21 | |
---|
| 22 | visual_core::visual_core(osg::ArgumentParser& arguments_) : arguments(arguments_) |
---|
| 23 | { |
---|
| 24 | OSG_NOTIFY( osg::ALWAYS ) << "visual_core instantiated." << std::endl; |
---|
[86] | 25 | } |
---|
[31] | 26 | |
---|
[86] | 27 | visual_core::~visual_core(void) |
---|
| 28 | { |
---|
| 29 | OSG_NOTIFY( osg::ALWAYS ) << "visual_core destroyed." << std::endl; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | void visual_core::initialize() |
---|
| 33 | { |
---|
| 34 | OSG_NOTIFY( osg::ALWAYS ) << "Initialize visual_core..." << std::endl; |
---|
| 35 | |
---|
[144] | 36 | // Check for config file to provide it to all modules during initialization. |
---|
| 37 | if( arguments.read("-c", configFilename) || arguments.read("--config", configFilename) ) |
---|
| 38 | { |
---|
| 39 | if( !osgDB::fileExists(configFilename) ) |
---|
| 40 | configFilename = ""; |
---|
| 41 | else |
---|
| 42 | OSG_ALWAYS << "Using configuration file: " << configFilename << std::endl; |
---|
| 43 | } |
---|
| 44 | |
---|
[86] | 45 | // Configure osg to use KdTrees |
---|
| 46 | osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES); |
---|
| 47 | |
---|
[31] | 48 | // Setup pathes |
---|
| 49 | osgDB::Registry::instance()->getDataFilePathList().push_back( "D:\\DA\\osgVisual\\models" ); |
---|
| 50 | |
---|
| 51 | // Setup viewer |
---|
| 52 | viewer = new osgViewer::Viewer(arguments); |
---|
| 53 | |
---|
| 54 | // Setup coordinate system node |
---|
[87] | 55 | rootNode = new osg::CoordinateSystemNode; // todo memleakf |
---|
[31] | 56 | rootNode->setEllipsoidModel(new osg::EllipsoidModel()); |
---|
| 57 | |
---|
| 58 | // Test memory leak (todo) |
---|
[116] | 59 | double* test = new double[1000]; |
---|
[31] | 60 | |
---|
[55] | 61 | //osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint( 8 ); |
---|
[31] | 62 | |
---|
| 63 | // Show model |
---|
| 64 | viewer->setSceneData( rootNode ); |
---|
| 65 | |
---|
[71] | 66 | osg::Group* distortedSceneGraph = NULL; |
---|
[31] | 67 | #ifdef USE_DISTORTION |
---|
| 68 | // Initialize distortion |
---|
[144] | 69 | distortion = new visual_distortion( viewer, arguments, configFilename ); |
---|
[151] | 70 | distortedSceneGraph = distortion->initialize( rootNode, viewer->getCamera()->getClearColor() ); |
---|
[31] | 71 | #endif |
---|
| 72 | |
---|
| 73 | #ifdef USE_SKY_SILVERLINING |
---|
| 74 | // Initialize sky |
---|
[182] | 75 | bool disabled = false; // to ask if the skyp is disabled or enabled |
---|
| 76 | sky = new visual_skySilverLining( viewer, configFilename, disabled ); |
---|
| 77 | if(disabled) |
---|
| 78 | sky = NULL; |
---|
| 79 | if(sky.valid()) |
---|
| 80 | sky->init(distortedSceneGraph, rootNode); // Without distortion: distortedSceneGraph=NULL |
---|
[31] | 81 | #endif |
---|
| 82 | |
---|
| 83 | // Initialize DataIO interface |
---|
[185] | 84 | visual_dataIO::getInstance()->init(viewer, configFilename); |
---|
[31] | 85 | |
---|
[144] | 86 | // Add manipulators for user interaction - after dataIO to be able to skip it in slaves rendering machines. |
---|
[231] | 87 | manipulators = new core_manipulator(); |
---|
| 88 | manipulators->init( viewer, arguments, configFilename, rootNode); |
---|
[73] | 89 | |
---|
[31] | 90 | // create the windows and run the threads. |
---|
| 91 | viewer->realize(); |
---|
| 92 | |
---|
[189] | 93 | loadTerrain(arguments); |
---|
| 94 | |
---|
[127] | 95 | // All modules are initialized - now check arguments for any unused parameter. |
---|
| 96 | checkCommandlineArgumentsForFinalErrors(); |
---|
| 97 | |
---|
[31] | 98 | // Run visual main loop |
---|
| 99 | mainLoop(); |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | void visual_core::mainLoop() |
---|
| 103 | { |
---|
[134] | 104 | int framestoScenerySetup = 5; |
---|
[31] | 105 | // run main loop |
---|
| 106 | while( !viewer->done() ) |
---|
| 107 | { |
---|
[134] | 108 | // setup scenery |
---|
| 109 | if(framestoScenerySetup-- == 0) |
---|
| 110 | setupScenery(); |
---|
| 111 | |
---|
[31] | 112 | // next frame please.... |
---|
| 113 | viewer->advance(); |
---|
| 114 | |
---|
| 115 | /*double hat, hot, lat, lon, height; |
---|
| 116 | util::getWGS84ofCamera( viewer->getCamera(), rootNode, lat, lon, height); |
---|
| 117 | if (util::queryHeightOfTerrain( hot, rootNode, lat, lon) && util::queryHeightAboveTerrainInWGS84( hat, rootNode, lat, lon, height ) ) |
---|
| 118 | OSG_NOTIFY( osg::ALWAYS ) << "HOT is: " << hot << ", HAT is: " << hat << std::endl;*/ |
---|
| 119 | |
---|
[70] | 120 | // perform all queued events |
---|
| 121 | viewer->eventTraversal(); |
---|
| 122 | |
---|
[31] | 123 | // update the scene by traversing it with the the update visitor which will |
---|
| 124 | // call all node update callbacks and animations. |
---|
| 125 | viewer->updateTraversal(); |
---|
| 126 | |
---|
| 127 | // Render the Frame. |
---|
| 128 | viewer->renderingTraversals(); |
---|
| 129 | |
---|
| 130 | } // END WHILE |
---|
| 131 | } |
---|
| 132 | |
---|
| 133 | void visual_core::shutdown() |
---|
| 134 | { |
---|
| 135 | OSG_NOTIFY( osg::ALWAYS ) << "Shutdown visual_core..." << std::endl; |
---|
| 136 | |
---|
[87] | 137 | // Shutdown Dbug HUD |
---|
| 138 | if(hud.valid()) |
---|
| 139 | hud->shutdown(); |
---|
[31] | 140 | // Unset scene data |
---|
| 141 | viewer->setSceneData( NULL ); |
---|
| 142 | |
---|
| 143 | #ifdef USE_SKY_SILVERLINING |
---|
| 144 | // Shutdown sky |
---|
| 145 | if( sky.valid() ) |
---|
| 146 | sky->shutdown(); |
---|
| 147 | #endif |
---|
| 148 | |
---|
| 149 | #ifdef USE_DISTORTION |
---|
| 150 | // Shutdown distortion |
---|
| 151 | if( distortion.valid() ) |
---|
| 152 | distortion->shutdown(); |
---|
| 153 | #endif |
---|
| 154 | |
---|
[87] | 155 | // Shutdown data |
---|
| 156 | rootNode = NULL; |
---|
| 157 | |
---|
[31] | 158 | // Shutdown dataIO |
---|
| 159 | visual_dataIO::getInstance()->shutdown(); |
---|
| 160 | |
---|
[231] | 161 | // Shutdown manipulators |
---|
| 162 | if(manipulators.valid()) |
---|
| 163 | manipulators->shutdown(); |
---|
[86] | 164 | |
---|
| 165 | // Destroy osgViewer |
---|
| 166 | viewer = NULL; |
---|
[31] | 167 | } |
---|
| 168 | |
---|
| 169 | bool visual_core::loadTerrain(osg::ArgumentParser& arguments_) |
---|
| 170 | { |
---|
[192] | 171 | osg::ref_ptr<osg::Node> model = osgDB::readNodeFiles(util::getTerrainFromXMLConfig(configFilename)); |
---|
[31] | 172 | if( model.valid() ) |
---|
| 173 | { |
---|
| 174 | rootNode->addChild( model.get() ); |
---|
| 175 | return true; |
---|
| 176 | } |
---|
| 177 | else |
---|
| 178 | { |
---|
[58] | 179 | OSG_NOTIFY( osg::FATAL ) << "Load terrain: No data loaded" << std::endl; |
---|
[31] | 180 | return false; |
---|
| 181 | } |
---|
| 182 | |
---|
| 183 | return false; |
---|
| 184 | } |
---|
| 185 | |
---|
[188] | 186 | void visual_core::parseScenery(xmlNode* a_node) |
---|
[125] | 187 | { |
---|
[128] | 188 | OSG_ALWAYS << "parseScenery()" << std::endl; |
---|
[125] | 189 | |
---|
[188] | 190 | a_node = a_node->children; |
---|
| 191 | |
---|
| 192 | for (xmlNode *cur_node = a_node; cur_node; cur_node = cur_node->next) |
---|
| 193 | { |
---|
| 194 | std::string node_name=reinterpret_cast<const char*>(cur_node->name); |
---|
| 195 | |
---|
[194] | 196 | // terrain is parsend seperately |
---|
| 197 | // animationpath is parsend seperately |
---|
[188] | 198 | |
---|
| 199 | if(cur_node->type == XML_ELEMENT_NODE && node_name == "models") |
---|
| 200 | { |
---|
[202] | 201 | for (xmlNode *modelNode = cur_node->children; modelNode; modelNode = modelNode->next) |
---|
| 202 | { |
---|
[203] | 203 | std::string name=reinterpret_cast<const char*>(modelNode->name); |
---|
[227] | 204 | if(modelNode->type == XML_ELEMENT_NODE && name == "model") |
---|
[203] | 205 | { |
---|
| 206 | visual_object::createNodeFromXMLConfig(rootNode, modelNode); |
---|
| 207 | } |
---|
[227] | 208 | if(modelNode->type == XML_ELEMENT_NODE && name == "trackmodel") |
---|
[225] | 209 | { |
---|
[226] | 210 | // Extract track-ID and track the model |
---|
[227] | 211 | xmlAttr *attr = modelNode->properties; |
---|
[226] | 212 | while ( attr ) |
---|
| 213 | { |
---|
| 214 | std::string attr_name=reinterpret_cast<const char*>(attr->name); |
---|
| 215 | std::string attr_value=reinterpret_cast<const char*>(attr->children->content); |
---|
[231] | 216 | if( attr_name == "id" ) manipulators->trackNode( util::strToInt(attr_value) ); |
---|
[234] | 217 | if( attr_name == "updater_slot" ) manipulators->setTrackingIdUpdaterSlot(attr_value); |
---|
[226] | 218 | attr = attr->next; |
---|
| 219 | } |
---|
| 220 | |
---|
[225] | 221 | } |
---|
[202] | 222 | } |
---|
[188] | 223 | } |
---|
| 224 | |
---|
[211] | 225 | #ifdef USE_SKY_SILVERLINING |
---|
[188] | 226 | if(cur_node->type == XML_ELEMENT_NODE && node_name == "datetime") |
---|
| 227 | { |
---|
[189] | 228 | int hour, minute; |
---|
| 229 | int day=0,month=0,year=0; |
---|
| 230 | |
---|
| 231 | xmlAttr *attr = cur_node->properties; |
---|
| 232 | while ( attr ) |
---|
| 233 | { |
---|
| 234 | std::string attr_name=reinterpret_cast<const char*>(attr->name); |
---|
| 235 | std::string attr_value=reinterpret_cast<const char*>(attr->children->content); |
---|
[219] | 236 | if( attr_name == "day" ) day = util::strToInt(attr_value); |
---|
| 237 | if( attr_name == "month" ) month = util::strToInt(attr_value); |
---|
| 238 | if( attr_name == "year" ) year = util::strToInt(attr_value); |
---|
| 239 | if( attr_name == "hour" ) hour = util::strToInt(attr_value); |
---|
| 240 | if( attr_name == "minute" ) minute = util::strToInt(attr_value); |
---|
| 241 | |
---|
[189] | 242 | attr = attr->next; |
---|
| 243 | } |
---|
| 244 | if(sky.valid()) |
---|
| 245 | { |
---|
| 246 | if(day!=0 && month!=0 && year!=0) |
---|
| 247 | sky->setDate(year, month, day); |
---|
| 248 | sky->setTime(hour,minute,00); |
---|
| 249 | } |
---|
[188] | 250 | } |
---|
| 251 | |
---|
| 252 | if(cur_node->type == XML_ELEMENT_NODE && node_name == "visibility") |
---|
| 253 | { |
---|
[195] | 254 | float range = 50000, turbidity=2.2; |
---|
| 255 | xmlAttr *attr = cur_node->properties; |
---|
| 256 | while ( attr ) |
---|
| 257 | { |
---|
| 258 | std::string attr_name=reinterpret_cast<const char*>(attr->name); |
---|
| 259 | std::string attr_value=reinterpret_cast<const char*>(attr->children->content); |
---|
[219] | 260 | if( attr_name == "range" ) range = util::strToDouble(attr_value); |
---|
| 261 | if( attr_name == "turbidity" ) turbidity = util::strToDouble(attr_value); |
---|
| 262 | |
---|
[195] | 263 | attr = attr->next; |
---|
| 264 | } |
---|
[211] | 265 | |
---|
[195] | 266 | if(sky.valid()) |
---|
| 267 | { |
---|
| 268 | sky->setVisibility( range ); |
---|
| 269 | sky->setTurbidity( turbidity ); |
---|
| 270 | } |
---|
[188] | 271 | } |
---|
| 272 | |
---|
[200] | 273 | if(cur_node->type == XML_ELEMENT_NODE && node_name == "clouds") |
---|
[188] | 274 | { |
---|
[198] | 275 | if(sky.valid()) |
---|
| 276 | sky->configureCloudlayerbyXML( cur_node ); |
---|
[188] | 277 | } |
---|
| 278 | |
---|
| 279 | if(cur_node->type == XML_ELEMENT_NODE && node_name == "windlayer") |
---|
| 280 | { |
---|
[195] | 281 | float bottom = 0.0, top=5000.0, speed=25.0, direction=0.0; |
---|
| 282 | xmlAttr *attr = cur_node->properties; |
---|
| 283 | while ( attr ) |
---|
| 284 | { |
---|
| 285 | std::string attr_name=reinterpret_cast<const char*>(attr->name); |
---|
| 286 | std::string attr_value=reinterpret_cast<const char*>(attr->children->content); |
---|
[219] | 287 | if( attr_name == "bottom" ) bottom = util::strToDouble(attr_value); |
---|
| 288 | if( attr_name == "top" ) top = util::strToDouble(attr_value); |
---|
| 289 | if( attr_name == "speed" ) speed = util::strToDouble(attr_value); |
---|
| 290 | if( attr_name == "direction" ) direction = util::strToDouble(attr_value); |
---|
| 291 | |
---|
[195] | 292 | attr = attr->next; |
---|
| 293 | } |
---|
| 294 | if(sky.valid()) |
---|
| 295 | { |
---|
| 296 | sky->addWindVolume( bottom, top, speed, direction ); |
---|
| 297 | } |
---|
[188] | 298 | } |
---|
[212] | 299 | |
---|
| 300 | // Track Node |
---|
| 301 | |
---|
[211] | 302 | #endif |
---|
[188] | 303 | }// FOR all nodes END |
---|
| 304 | |
---|
[129] | 305 | } |
---|
| 306 | |
---|
[67] | 307 | bool visual_core::checkCommandlineArgumentsForFinalErrors() |
---|
[31] | 308 | { |
---|
| 309 | // Setup Application Usage |
---|
| 310 | arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); |
---|
| 311 | arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the new FSD visualization tool, written by Torben Dannhauer"); |
---|
[212] | 312 | arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [OSG options] -c XML-Configurationfile"); |
---|
[31] | 313 | arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); |
---|
[212] | 314 | arguments.getApplicationUsage()->addCommandLineOption("-c or --config","XML configuration filename"); |
---|
[31] | 315 | |
---|
[212] | 316 | |
---|
[31] | 317 | // if user request help write it out to cout. |
---|
| 318 | if (arguments.read("-h") || arguments.read("--help")) |
---|
| 319 | { |
---|
| 320 | arguments.getApplicationUsage()->write(std::cout); |
---|
| 321 | //cause the viewer to exit and shut down clean. |
---|
| 322 | viewer->setDone(true); |
---|
| 323 | } |
---|
| 324 | |
---|
| 325 | // report any errors if they have occurred when parsing the program arguments. |
---|
| 326 | if (arguments.errors()) |
---|
| 327 | { |
---|
| 328 | arguments.writeErrorMessages(std::cout); |
---|
| 329 | //cause the viewer to exit and shut down clean. |
---|
| 330 | viewer->setDone(true); |
---|
| 331 | } |
---|
| 332 | |
---|
| 333 | // any option left unread are converted into errors to write out later. |
---|
| 334 | arguments.reportRemainingOptionsAsUnrecognized(); |
---|
| 335 | |
---|
| 336 | // report any errors if they have occurred when parsing the program arguments. |
---|
| 337 | if (arguments.errors()) |
---|
| 338 | { |
---|
| 339 | arguments.writeErrorMessages(std::cout); |
---|
| 340 | return false; |
---|
| 341 | } |
---|
| 342 | return true; |
---|
| 343 | } |
---|
| 344 | |
---|
| 345 | void visual_core::setupScenery() |
---|
| 346 | { |
---|
[194] | 347 | // Parse Scenery from Configuration file |
---|
| 348 | xmlDoc* tmpDoc; |
---|
| 349 | xmlNode* sceneryNode = util::getSceneryXMLConfig(configFilename, tmpDoc); |
---|
| 350 | parseScenery(sceneryNode); |
---|
| 351 | if(sceneryNode) |
---|
| 352 | { |
---|
| 353 | xmlFreeDoc(tmpDoc); xmlCleanupParser(); |
---|
| 354 | } |
---|
[122] | 355 | |
---|
[194] | 356 | |
---|
[31] | 357 | //testObj = new visual_object( rootNode, "testStab", objectMountedCameraManip ); |
---|
| 358 | //testObj->setNewPosition( osg::DegreesToRadians(47.7123), osg::DegreesToRadians(12.84088), 600 ); |
---|
| 359 | ///* using a huge cylinder to test position & orientation */ |
---|
| 360 | //testObj->setGeometry( util::getDemoCylinder(5000.0, 20.0 ) ); |
---|
| 361 | //testObj->addUpdater( new object_updater(testObj) ); |
---|
[235] | 362 | //testObj->setTrackingId(2); |
---|
[31] | 363 | |
---|
[115] | 364 | //osg::ref_ptr<visual_object> testObj2 = new visual_object( rootNode, "neuschwanstein" ); // todo memleak |
---|
| 365 | ////testObj2->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 600 ); |
---|
| 366 | //testObj2->setNewPosition( osg::DegreesToRadians(47.557523564234), osg::DegreesToRadians(10.749646398595), 950 ); |
---|
| 367 | //testObj2->loadGeometry( "../models/neuschwanstein.osgb" ); |
---|
[216] | 368 | ////testObj2->addUpdater( new object_updater(testObj2) ); |
---|
[235] | 369 | //testObj2->setTrackingId(3); |
---|
[31] | 370 | |
---|
[212] | 371 | //osg::ref_ptr<visual_object> testObj3 = new visual_object( rootNode, "SAENGER1" ); // todo memleak |
---|
| 372 | //testObj3->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 600 ); |
---|
| 373 | //testObj3->loadGeometry( "../models/saenger1.flt" ); |
---|
[216] | 374 | //testObj3->addUpdater( new object_updater(testObj3) ); |
---|
[235] | 375 | //testObj3->setTrackingId(4); |
---|
[31] | 376 | |
---|
[224] | 377 | osg::ref_ptr<visual_object> testObj4 = new visual_object( rootNode, "SAENGER2" ); // todo memleak |
---|
[31] | 378 | testObj4->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 650 ); |
---|
| 379 | testObj4->loadGeometry( "../models/saenger2.flt" ); |
---|
[216] | 380 | testObj4->addUpdater( new object_updater(testObj4) ); |
---|
[215] | 381 | testObj4->addLabel("testLabel", "Object4 :)",osg::Vec4(1.0f,0.25f,1.0f,1.0f)); |
---|
[240] | 382 | testObj4->setTrackingId(2); |
---|
[31] | 383 | |
---|
[212] | 384 | //osg::ref_ptr<visual_object> testObj5 = new visual_object( rootNode, "SAENGER" ); // todo memleak |
---|
| 385 | //testObj5->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 550 ); |
---|
| 386 | //testObj5->loadGeometry( "../models/saengerCombine.flt" ); |
---|
| 387 | ////testObj5->setScale( 2 ); |
---|
[216] | 388 | //testObj5->addUpdater( new object_updater(testObj5) ); |
---|
[235] | 389 | //testObj5->setTrackingId(6); |
---|
[31] | 390 | |
---|
[235] | 391 | manipulators->trackNode( testObj4 ); |
---|
[31] | 392 | |
---|
| 393 | // Load EDDF |
---|
| 394 | //std::string filename = "D:\\DA\\EDDF_test\\eddf.ive"; |
---|
| 395 | //if( !osgDB::fileExists(filename) ) |
---|
| 396 | //{ |
---|
| 397 | // OSG_NOTIFY(osg::ALWAYS) << "Warning: EDDF Model not loaded. File '" << filename << "' does not exist. Skipping."; |
---|
| 398 | //} |
---|
| 399 | //// read model |
---|
| 400 | //osg::ref_ptr<osg::Node> tmpModel = osgDB::readNodeFile( filename ); |
---|
| 401 | //if (tmpModel.valid()) |
---|
| 402 | // rootNode->addChild( tmpModel ); |
---|
| 403 | |
---|
| 404 | |
---|
| 405 | visual_draw2D::getInstance()->init( rootNode, viewer ); |
---|
| 406 | //osg::ref_ptr<visual_hud> hud = new visual_hud(); |
---|
[87] | 407 | hud = new visual_debug_hud(); |
---|
[31] | 408 | hud->init( viewer, rootNode ); |
---|
| 409 | |
---|
[122] | 410 | |
---|
[31] | 411 | |
---|
| 412 | //osg::ref_ptr<visual_draw3D> test = new visual_draw3D(); |
---|
| 413 | //test->init( rootNode, viewer ); |
---|
| 414 | |
---|
[69] | 415 | //// Creating Testclasses |
---|
| 416 | //osg::ref_ptr<osgVisual::dataIO_transportContainer> test = new osgVisual::dataIO_transportContainer(); |
---|
| 417 | //osg::ref_ptr<osgVisual::dataIO_executer> testEx = new osgVisual::dataIO_executer(); |
---|
| 418 | //osg::ref_ptr<osgVisual::dataIO_slot> testSlot = new osgVisual::dataIO_slot(); |
---|
| 419 | //test->setFrameID( 22 ); |
---|
| 420 | //test->setName("ugamoep"); |
---|
| 421 | //testEx->setexecuterID( osgVisual::dataIO_executer::IS_COLLISION ); |
---|
| 422 | //testSlot->setVariableName(std::string("HalloName")); |
---|
| 423 | //testSlot->setdataDirection( osgVisual::dataIO_slot::TO_OBJ ); |
---|
| 424 | //testSlot->setvarType( osgVisual::dataIO_slot::DOUBLE ); |
---|
| 425 | //testSlot->setValue( 0.12345 ); |
---|
| 426 | //test->addExecuter( testEx ); |
---|
| 427 | //test->addSlot( testSlot ); |
---|
[31] | 428 | |
---|
[69] | 429 | visual_dataIO::getInstance()->setSlotData("TestSlot1", osgVisual::dataIO_slot::TO_OBJ, 0.12345); |
---|
[155] | 430 | |
---|
[31] | 431 | } |
---|