Changeset 224 for osgVisual/trunk/src/object
- Timestamp:
- Feb 10, 2011, 10:59:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/object/object_updater.cpp
r223 r224 21 21 object_updater::object_updater(osgVisual::visual_object* object_ ) 22 22 { 23 updater_lat_rad = object_->getName()+"_POS_LAT"; 24 updater_lon_rad = object_->getName()+"_POS_LON"; 25 updater_alt = object_->getName()+"_POS_ALT"; 26 updater_rot_x_rad = object_->getName()+"_ROT_X"; 27 updater_rot_y_rad = object_->getName()+"_ROT_Y"; 28 updater_rot_z_rad = object_->getName()+"_ROT_Z"; 23 29 } 24 30 … … 34 40 // try to search according variable in dataIO with direction TO_OBJ and copy value to visual_object. 35 41 36 if(!updater_lat_ deg.empty())37 object_->lat = osg ::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat_deg, osgVisual::dataIO_slot::TO_OBJ ));38 if(!updater_lon_ deg.empty())39 object_->lon = osg ::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon_deg, osgVisual::dataIO_slot::TO_OBJ ));42 if(!updater_lat_rad.empty()) 43 object_->lat = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat_rad, osgVisual::dataIO_slot::TO_OBJ ); 44 if(!updater_lon_rad.empty()) 45 object_->lon = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon_rad, osgVisual::dataIO_slot::TO_OBJ ); 40 46 if(!updater_alt.empty()) 41 47 object_->alt = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_alt, osgVisual::dataIO_slot::TO_OBJ ); 42 if(!updater_rot_z_ deg.empty())43 object_->azimuthAngle_psi = osg ::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z_deg, osgVisual::dataIO_slot::TO_OBJ ));44 if(!updater_rot_y_ deg.empty())45 object_->pitchAngle_theta = osg ::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y_deg, osgVisual::dataIO_slot::TO_OBJ ));46 if(!updater_rot_x_ deg.empty())47 object_->bankAngle_phi = osg ::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x_deg, osgVisual::dataIO_slot::TO_OBJ ));48 if(!updater_rot_z_rad.empty()) 49 object_->azimuthAngle_psi = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z_rad, osgVisual::dataIO_slot::TO_OBJ ); 50 if(!updater_rot_y_rad.empty()) 51 object_->pitchAngle_theta = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y_rad, osgVisual::dataIO_slot::TO_OBJ ); 52 if(!updater_rot_x_rad.empty()) 53 object_->bankAngle_phi = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x_rad, osgVisual::dataIO_slot::TO_OBJ ); 48 54 if(!updater_label.empty()) 49 55 object_->updateLabelText("default", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ )); … … 71 77 } 72 78 73 void object_updater::setUpdaterSlotNames( osgVisual::visual_object* object_, std::string lat_ deg_, std::string lon_deg_, std::string alt_, std::string rot_x_deg_, std::string rot_y_deg_, std::string rot_z_deg_, std::string label_)79 void object_updater::setUpdaterSlotNames( osgVisual::visual_object* object_, std::string lat_rad_, std::string lon_rad_, std::string alt_, std::string rot_x_rad_, std::string rot_y_rad_, std::string rot_z_rad_, std::string label_) 74 80 { 75 if(lat_deg_!="") 76 updater_lat_deg = lat_deg_; 77 else 78 updater_lat_deg = object_->getName()+"_POS_LAT"; 79 80 if(lon_deg_!="") 81 updater_lon_deg = lon_deg_; 82 else 83 updater_lon_deg = object_->getName()+"_POS_LON"; 84 81 if(lat_rad_!="") 82 updater_lat_rad = lat_rad_; 83 if(lon_rad_!="") 84 updater_lon_rad = lon_rad_; 85 85 if(alt_!="") 86 86 updater_alt = alt_; 87 else 88 updater_alt = object_->getName()+"_POS_ALT"; 89 90 if(rot_x_deg_!="") 91 updater_rot_x_deg = rot_x_deg_; 92 else 93 updater_rot_x_deg = object_->getName()+"_ROT_X"; 94 95 if(rot_y_deg_!="") 96 updater_rot_y_deg = rot_y_deg_; 97 else 98 updater_rot_y_deg = object_->getName()+"_ROT_Y"; 99 100 if(rot_z_deg_!="") 101 updater_rot_z_deg = rot_z_deg_; 102 else 103 updater_rot_z_deg = object_->getName()+"_ROT_Z"; 87 if(rot_x_rad_!="") 88 updater_rot_x_rad = rot_x_rad_; 89 if(rot_y_rad_!="") 90 updater_rot_y_rad = rot_y_rad_; 91 if(rot_z_rad_!="") 92 updater_rot_z_rad = rot_z_rad_; 104 93 105 94 if(label_!="") … … 108 97 { 109 98 updater_label = object_->getName()+"_LABEL"; 110 object_->addLabel(" autoupdated", " ");99 object_->addLabel("default", " "); 111 100 } 112 101 }
Note: See TracChangeset
for help on using the changeset viewer.