Changeset 215 for osgVisual/trunk/src


Ignore:
Timestamp:
Feb 1, 2011, 8:14:45 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/core/visual_core.cpp

    r214 r215  
    481481        //
    482482
    483         osg::ref_ptr<visual_object> testObj4 = new visual_object( rootNode, "SAENGER2" );       // todo memleak
     483        osg::ref_ptr<visual_object> testObj4 = new visual_object( rootNode, "SAENGER23" );      // todo memleak
    484484        testObj4->setNewPosition( osg::DegreesToRadians(47.8123), osg::DegreesToRadians(12.94088), 650 );
    485485        testObj4->loadGeometry( "../models/saenger2.flt" );
    486486        testObj4->addUpdater( new object_updater(testObj4) );   // todo memleak
    487         testObj4->addLabel("testLabel", "LabelTest!!\nnächste Zeile :)",osg::Vec4(1.0f,0.25f,1.0f,1.0f));
     487        testObj4->addLabel("testLabel", "Object4 :)",osg::Vec4(1.0f,0.25f,1.0f,1.0f));
    488488
    489489        //osg::ref_ptr<visual_object> testObj5 = new visual_object( rootNode, "SAENGER" );      // todo memleak
     
    545545        if(trackedObject)
    546546        {
    547                 if(trackedObject->getGeometry())
    548                         node = trackedObject->getGeometry();
    549                 else
    550                         node = trackedObject;
     547                node = trackedObject->getGeometry();
    551548
    552549                // Object mounted manipulator ( Only working with visual_object, not with osg::Node )
  • osgVisual/trunk/src/extLink/dataIO_extLinkVCL.cpp

    r186 r215  
    236236                osgVisual::dataIO_slot* tmpSlot = osgVisual::visual_dataIO::getInstance()->setSlotData( entryName, direction_, 0 );
    237237                extLinkSlots.push_back( tmpSlot );
     238
    238239        }       // FOR each ENTRY END
    239240}
  • osgVisual/trunk/src/object/object_updater.cpp

    r210 r215  
    3434        //      try to search according variable in dataIO with direction TO_OBJ and copy value to visual_object.
    3535
    36        
    37         object_->lat = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat, osgVisual::dataIO_slot::TO_OBJ ));
    38         object_->lon = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon, osgVisual::dataIO_slot::TO_OBJ ));
    39         object_->alt = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_alt, osgVisual::dataIO_slot::TO_OBJ );
    40         object_->azimuthAngle_psi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z, osgVisual::dataIO_slot::TO_OBJ ));
    41         object_->pitchAngle_theta = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y, osgVisual::dataIO_slot::TO_OBJ ));
    42         object_->bankAngle_phi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x, osgVisual::dataIO_slot::TO_OBJ ));
    43         object_->updateLabelText("autoupdated", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ ));
     36        if(!updater_lat.empty())
     37                object_->lat = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat, osgVisual::dataIO_slot::TO_OBJ ));
     38        if(!updater_lon.empty())
     39                object_->lon = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon, osgVisual::dataIO_slot::TO_OBJ ));
     40        if(!updater_alt.empty())
     41                object_->alt = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_alt, osgVisual::dataIO_slot::TO_OBJ );
     42        if(!updater_rot_z.empty())
     43                object_->azimuthAngle_psi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z, osgVisual::dataIO_slot::TO_OBJ ));
     44        if(!updater_rot_y.empty())
     45                object_->pitchAngle_theta = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y, osgVisual::dataIO_slot::TO_OBJ ));
     46        if(!updater_rot_x.empty())
     47                object_->bankAngle_phi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x, osgVisual::dataIO_slot::TO_OBJ ));
     48        if(!updater_label.empty())
     49                object_->updateLabelText("autoupdated", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ ));
    4450
    4551        // Finally execute nested PreUpdater
  • osgVisual/trunk/src/object/visual_object.cpp

    r210 r215  
    5959        geometry = new osg::Group();
    6060        this->addChild( geometry );
     61        unsetGeometry();        // adds an osg::Node as geometry to make the visual_object trackable for node trackers.
    6162
    6263        // Labelnode hinzufügen
     
    7576                return NULL;
    7677
    77         OSG_NOTIFY( osg::ALWAYS ) << __FUNCTION__ << "Try to creating a new Model.." << std::endl;
     78        OSG_NOTIFY( osg::ALWAYS ) << __FUNCTION__ << " - Try to creating a new Model.." << std::endl;
    7879       
    7980        // Prepare Variables
     
    342343
    343344
    344 
    345 
    346345        osgVisual::visual_object* object = new osgVisual::visual_object( sceneRoot_, objectname );
    347346        object->lat = lat;
     
    462461        // remove old geometry
    463462        geometry->removeChildren(0, geometry->getNumChildren());
     463
     464        // Set std OSG Node to allow tracking of an osgVisual without
     465        geometry->addChild( new osg::Node() );
    464466}
    465467
Note: See TracChangeset for help on using the changeset viewer.