Changeset 10396
- Timestamp:
- 06/24/09 18:03:49 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 added
- 10 removed
- 11 modified
- 10 moved
-
applications/present3D/CMakeLists.txt (modified) (2 diffs)
-
applications/present3D/ExportHTML.h (modified) (1 diff)
-
applications/present3D/ReadShowFile.cpp (modified) (9 diffs)
-
applications/present3D/ReaderWriterP3D.cpp (modified) (1 diff)
-
applications/present3D/ReaderWriterPaths.cpp (modified) (1 diff)
-
applications/present3D/present3D.cpp (modified) (2 diffs)
-
include/osgDB/Options (modified) (1 diff)
-
include/osgPresentation (added)
-
include/osgPresentation/AnimationMaterial (moved) (moved from OpenSceneGraph/trunk/applications/present3D/AnimationMaterial.h) (2 diffs, 1 prop)
-
include/osgPresentation/CompileSlideCallback (moved) (moved from OpenSceneGraph/trunk/applications/present3D/CompileSlideCallback.h) (1 diff, 1 prop)
-
include/osgPresentation/PickEventHandler (moved) (moved from OpenSceneGraph/trunk/applications/present3D/PickEventHandler.h) (1 diff, 1 prop)
-
include/osgPresentation/SlideEventHandler (moved) (moved from OpenSceneGraph/trunk/applications/present3D/SlideEventHandler.h) (5 diffs, 1 prop)
-
include/osgPresentation/SlideShowConstructor (moved) (moved from OpenSceneGraph/trunk/applications/present3D/SlideShowConstructor.h) (3 diffs, 1 prop)
-
src/CMakeLists.txt (modified) (1 diff)
-
src/osgPlugins/p3d/AnimationMaterial.cpp (deleted)
-
src/osgPlugins/p3d/AnimationMaterial.h (deleted)
-
src/osgPlugins/p3d/CMakeLists.txt (modified) (1 diff)
-
src/osgPlugins/p3d/CompileSlideCallback.cpp (deleted)
-
src/osgPlugins/p3d/CompileSlideCallback.h (deleted)
-
src/osgPlugins/p3d/PickEventHandler.cpp (deleted)
-
src/osgPlugins/p3d/PickEventHandler.h (deleted)
-
src/osgPlugins/p3d/ReaderWriterP3D.cpp (modified) (4 diffs)
-
src/osgPlugins/p3d/ReaderWriterPaths.cpp (modified) (2 diffs)
-
src/osgPlugins/p3d/SlideEventHandler.cpp (deleted)
-
src/osgPlugins/p3d/SlideEventHandler.h (deleted)
-
src/osgPlugins/p3d/SlideShowConstructor.cpp (deleted)
-
src/osgPlugins/p3d/SlideShowConstructor.h (deleted)
-
src/osgPresentation (added)
-
src/osgPresentation/AnimationMaterial.cpp (moved) (moved from OpenSceneGraph/trunk/applications/present3D/AnimationMaterial.cpp) (2 diffs, 1 prop)
-
src/osgPresentation/CompileSlideCallback.cpp (moved) (moved from OpenSceneGraph/trunk/applications/present3D/CompileSlideCallback.cpp) (1 diff, 1 prop)
-
src/osgPresentation/PickEventHandler.cpp (moved) (moved from OpenSceneGraph/trunk/applications/present3D/PickEventHandler.cpp) (1 diff, 1 prop)
-
src/osgPresentation/SlideEventHandler.cpp (moved) (moved from OpenSceneGraph/trunk/applications/present3D/SlideEventHandler.cpp) (5 diffs, 1 prop)
-
src/osgPresentation/SlideShowConstructor.cpp (moved) (moved from OpenSceneGraph/trunk/applications/present3D/SlideShowConstructor.cpp) (7 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/applications/present3D/CMakeLists.txt
r10389 r10396 1 1 SET(TARGET_SRC 2 AnimationMaterial.cpp3 2 Cluster.cpp 4 CompileSlideCallback.cpp5 3 ExportHTML.cpp 6 PickEventHandler.cpp7 4 PointsEventHandler.cpp 8 5 present3D.cpp 9 ReaderWriterP3D.cpp10 ReaderWriterPaths.cpp11 6 ReadShowFile.cpp 12 7 ShowEventHandler.cpp 13 SlideEventHandler.cpp14 SlideShowConstructor.cpp15 8 ) 16 9 17 10 SET(TARGET_H 18 AnimationMaterial.h19 11 Cluster.h 20 CompileSlideCallback.h21 12 ExportHTML.h 22 PickEventHandler.h23 13 PointsEventHandler.h 24 14 ReadShowFile.h 25 15 ShowEventHandler.h 26 SlideEventHandler.h27 SlideShowConstructor.h28 16 ) 29 17 … … 53 41 ENDIF() 54 42 55 SET(TARGET_ADDED_LIBRARIES osgVolume osgFX )43 SET(TARGET_ADDED_LIBRARIES osgVolume osgFX osgPresentation) 56 44 57 45 IF (NOT DYNAMIC_OPENSCENEGRAPH) -
OpenSceneGraph/trunk/applications/present3D/ExportHTML.h
r10117 r10396 14 14 #define EXPORTHTML_H 1 15 15 16 #include "SlideEventHandler.h"16 #include <osgPresentation/SlideEventHandler> 17 17 #include <osgViewer/Viewer> 18 18 -
OpenSceneGraph/trunk/applications/present3D/ReadShowFile.cpp
r10122 r10396 14 14 #include "ShowEventHandler.h" 15 15 16 #include <osgPresentation/SlideEventHandler> 17 16 18 #include <osg/ImageStream> 17 19 #include <osg/Shape> … … 161 163 } 162 164 165 osgDB::Options* createOptions(const osgDB::ReaderWriter::Options* options) 166 { 167 osg::ref_ptr<osgDB::Options> local_options = options ? options->cloneOptions() : 0; 168 if (!local_options) 169 { 170 local_options = osgDB::Registry::instance()->getOptions() ? 171 osgDB::Registry::instance()->getOptions()->cloneOptions() : 172 new osgDB::Options; 173 } 174 175 local_options->setPluginStringData("P3D_EVENTHANDLER","none"); 176 return local_options.release(); 177 } 178 163 179 osg::Node* p3d::readHoldingSlide(const std::string& filename) 164 180 { … … 170 186 options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE); 171 187 options->setOptionString("holding_slide"); 172 173 osgDB::ReaderWriter::ReadResult readResult = osgDB::Registry::instance()->readNode(filename, options.get()); 174 if (readResult.validNode()) return readResult.takeNode(); 175 else return 0; 188 options->setPluginStringData("P3D_EVENTHANDLER","none"); 189 190 return osgDB::readNodeFile(filename, options.get()); 176 191 } 177 192 … … 181 196 if (!osgDB::equalCaseInsensitive(ext,"xml") && 182 197 !osgDB::equalCaseInsensitive(ext,"p3d")) return 0; 183 return osgDB::readNodeFile(filename, options); 198 199 osg::ref_ptr<osgDB::Options> local_options = createOptions(options); 200 return osgDB::readNodeFile(filename, local_options.get()); 184 201 } 185 202 186 203 osg::Node* p3d::readShowFiles(osg::ArgumentParser& arguments,const osgDB::ReaderWriter::Options* options) 187 204 { 205 osg::ref_ptr<osgDB::Options> local_options = createOptions(options); 188 206 189 207 typedef std::vector< osg::ref_ptr<osg::Node> > NodeList; … … 193 211 while (arguments.read("--image",filename)) 194 212 { 195 osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), options);213 osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get()); 196 214 if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image.get())); 197 215 } … … 199 217 while (arguments.read("--movie",filename)) 200 218 { 201 osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), options);219 osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get()); 202 220 osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get()); 203 221 if (image.valid()) … … 210 228 while (arguments.read("--dem",filename)) 211 229 { 212 osg::HeightField* hf = readHeightFieldFile(filename.c_str(), options);230 osg::HeightField* hf = readHeightFieldFile(filename.c_str(), local_options.get()); 213 231 if (hf) 214 232 { … … 225 243 { 226 244 // not an option so assume string is a filename. 227 osg::Node *node = osgDB::readNodeFile( arguments[pos], options);245 osg::Node *node = osgDB::readNodeFile( arguments[pos], local_options); 228 246 229 247 if(node) … … 232 250 nodeList.push_back(node); 233 251 } 234 235 252 } 236 253 } -
OpenSceneGraph/trunk/applications/present3D/ReaderWriterP3D.cpp
r10378 r10396 21 21 #include <osgWidget/PdfReader> 22 22 23 #include "SlideShowConstructor.h"23 #include <osgPresentation/SlideShowConstructor> 24 24 25 25 #include <stdio.h> -
OpenSceneGraph/trunk/applications/present3D/ReaderWriterPaths.cpp
r10378 r10396 21 21 #include <osgWidget/PdfReader> 22 22 23 #include "SlideShowConstructor.h"24 #include "AnimationMaterial.h"23 #include <osgPresentation/SlideShowConstructor> 24 #include <osgPresentation/AnimationMaterial> 25 25 26 26 #include <stdio.h> -
OpenSceneGraph/trunk/applications/present3D/present3D.cpp
r10389 r10396 37 37 #include <osgGA/StateSetManipulator> 38 38 39 #include <osgPresentation/SlideEventHandler> 40 #include <osgPresentation/SlideShowConstructor> 41 39 42 #include "ReadShowFile.h" 40 #include "SlideEventHandler.h"41 43 #include "PointsEventHandler.h" 42 #include "SlideShowConstructor.h"43 44 #include "Cluster.h" 44 45 #include "ExportHTML.h" … … 347 348 while (arguments.read("--loop")) loopPresentation = true; 348 349 350 349 351 // register the slide event handler - which moves the presentation from slide to slide, layer to layer. 350 352 osgPresentation::SlideEventHandler* seh = new osgPresentation::SlideEventHandler(&viewer); -
OpenSceneGraph/trunk/include/osgDB/Options
r10227 r10396 85 85 META_Object(osgDB,Options); 86 86 87 Options* cloneOptions() const { return new Options(*this); } 88 87 89 /** Set the general Options string.*/ 88 90 void setOptionString(const std::string& str) { _str = str; } -
OpenSceneGraph/trunk/include/osgPresentation/AnimationMaterial
r10113 r10396 17 17 #include <osg/NodeCallback> 18 18 19 #include <osgPresentation/Export> 20 19 21 #include <map> 20 22 #include <float.h> 21 23 22 namespace ss3d{24 namespace osgPresentation { 23 25 24 26 /** AnimationMaterial for specify the time varying transformation pathway to use when update camera and model objects. … … 26 28 * be attached directly to Transform nodes to move subgraphs around the scene. 27 29 */ 28 class AnimationMaterial : public virtual osg::Object30 class OSGPRESENTATION_EXPORT AnimationMaterial : public virtual osg::Object 29 31 { 30 32 public: -
OpenSceneGraph/trunk/include/osgPresentation/CompileSlideCallback
r10113 r10396 15 15 16 16 #include <osgViewer/Viewer> 17 #include <osgPresentation/Export> 17 18 18 namespace ss3d{19 namespace osgPresentation { 19 20 20 class CompileSlideCallback : public osg::Camera::DrawCallback21 class OSGPRESENTATION_EXPORT CompileSlideCallback : public osg::Camera::DrawCallback 21 22 { 22 23 public: -
OpenSceneGraph/trunk/include/osgPresentation/PickEventHandler
r10117 r10396 19 19 #include <osgGA/GUIEventHandler> 20 20 21 #include "SlideEventHandler.h"21 #include <osgPresentation/SlideEventHandler> 22 22 23 23 namespace osgPresentation 24 24 { 25 25 26 class PickEventHandler : public osgGA::GUIEventHandler26 class OSGPRESENTATION_EXPORT PickEventHandler : public osgGA::GUIEventHandler 27 27 { 28 28 public: -
OpenSceneGraph/trunk/include/osgPresentation/SlideEventHandler
r10132 r10396 20 20 #include <osgViewer/Viewer> 21 21 22 #include "CompileSlideCallback.h"22 #include <osgPresentation/CompileSlideCallback> 23 23 24 24 namespace osgPresentation … … 73 73 }; 74 74 75 struct LayerAttributes : public virtual osg::Referenced75 struct OSGPRESENTATION_EXPORT LayerAttributes : public virtual osg::Referenced 76 76 { 77 77 LayerAttributes():_duration(0),_relativeJump(true),_slideNum(0),_layerNum(0) {} … … 158 158 }; 159 159 160 class ActiveOperators160 class OSGPRESENTATION_EXPORT ActiveOperators 161 161 { 162 162 public: … … 192 192 }; 193 193 194 class SlideEventHandler : public osgGA::GUIEventHandler194 class OSGPRESENTATION_EXPORT SlideEventHandler : public osgGA::GUIEventHandler 195 195 { 196 196 public: … … 320 320 ActiveOperators _activeOperators; 321 321 322 osg::ref_ptr< ss3d::CompileSlideCallback>_compileSlideCallback;322 osg::ref_ptr<CompileSlideCallback> _compileSlideCallback; 323 323 324 324 void updateOperators(); -
OpenSceneGraph/trunk/include/osgPresentation/SlideShowConstructor
r10207 r10396 26 26 #include <osgDB/FileUtils> 27 27 28 #include "AnimationMaterial.h"29 #include "SlideEventHandler.h"28 #include <osgPresentation/AnimationMaterial> 29 #include <osgPresentation/SlideEventHandler> 30 30 31 31 namespace osgPresentation 32 32 { 33 33 34 class SlideShowConstructor34 class OSGPRESENTATION_EXPORT SlideShowConstructor 35 35 { 36 36 public: … … 129 129 animation_material_time_offset(0.0), 130 130 animation_material_time_multiplier(1.0), 131 animation_material_loop_mode( ss3d::AnimationMaterial::NO_LOOPING) {}131 animation_material_loop_mode(AnimationMaterial::NO_LOOPING) {} 132 132 133 133 bool requiresPosition() const … … 170 170 double animation_material_time_offset; 171 171 double animation_material_time_multiplier; 172 ss3d::AnimationMaterial::LoopModeanimation_material_loop_mode;172 AnimationMaterial::LoopMode animation_material_loop_mode; 173 173 std::string animation_material_filename; 174 174 std::string fade; -
OpenSceneGraph/trunk/src/CMakeLists.txt
r9949 r10396 12 12 osgManipulator 13 13 osgParticle 14 osgPresentation 14 15 osgShadow 15 16 osgSim -
OpenSceneGraph/trunk/src/osgPlugins/p3d/CMakeLists.txt
r10203 r10396 1 1 SET(TARGET_SRC 2 SlideShowConstructor.cpp3 2 ReaderWriterP3D.cpp 4 3 ReaderWriterPaths.cpp 5 PickEventHandler.cpp6 AnimationMaterial.cpp7 SlideEventHandler.cpp8 CompileSlideCallback.cpp9 )10 SET(TARGET_H11 SlideShowConstructor.h12 PickEventHandler.h13 AnimationMaterial.h14 SlideEventHandler.h15 CompileSlideCallback.h16 4 ) 17 5 18 SET(TARGET_ADDED_LIBRARIES osgGA osgText osgVolume osgFX osgViewer )6 SET(TARGET_ADDED_LIBRARIES osgGA osgText osgVolume osgFX osgViewer osgPresentation) 19 7 20 8 #### end var setup ### -
OpenSceneGraph/trunk/src/osgPlugins/p3d/ReaderWriterP3D.cpp
r10378 r10396 21 21 #include <osgWidget/PdfReader> 22 22 23 #include "SlideShowConstructor.h"23 #include <osgPresentation/SlideShowConstructor> 24 24 25 25 #include <stdio.h> … … 648 648 { 649 649 osg::notify(_notifyLevel)<<"animation_material_loop_mode "<<str<<std::endl; 650 if (str=="LOOP") value.animation_material_loop_mode= ss3d::AnimationMaterial::LOOP;651 else if (str=="SWING") value.animation_material_loop_mode= ss3d::AnimationMaterial::SWING;652 else if (str=="NO_LOOPING") value.animation_material_loop_mode= ss3d::AnimationMaterial::NO_LOOPING;650 if (str=="LOOP") value.animation_material_loop_mode=osgPresentation::AnimationMaterial::LOOP; 651 else if (str=="SWING") value.animation_material_loop_mode=osgPresentation::AnimationMaterial::SWING; 652 else if (str=="NO_LOOPING") value.animation_material_loop_mode=osgPresentation::AnimationMaterial::NO_LOOPING; 653 653 propertiesRead = true; 654 654 } … … 1742 1742 doc->read(input); 1743 1743 1744 1745 osg::notify(osg::NOTICE)<<"P3D parsing"<<std::endl; 1744 osg::notify(osg::INFO)<<"P3D xml file read, now building presentation scene graph."<<std::endl; 1746 1745 1747 1746 // doc->write(std::cout); … … 1965 1964 osg::ref_ptr<osg::Node> presentation_node = constructor.takePresentation(); 1966 1965 1967 osgPresentation::SlideEventHandler* seh = new osgPresentation::SlideEventHandler; 1968 seh->set(presentation_node.get()); 1969 presentation_node->setEventCallback(seh); 1970 1966 1967 if (!options || options->getPluginStringData("P3D_EVENTHANDLER")!="none") 1968 { 1969 osgPresentation::SlideEventHandler* seh = new osgPresentation::SlideEventHandler; 1970 seh->set(presentation_node.get()); 1971 presentation_node->setEventCallback(seh); 1972 } 1971 1973 return presentation_node.release(); 1972 1974 } -
OpenSceneGraph/trunk/src/osgPlugins/p3d/ReaderWriterPaths.cpp
r10378 r10396 21 21 #include <osgWidget/PdfReader> 22 22 23 #include "SlideShowConstructor.h"24 #include "AnimationMaterial.h"23 #include <osgPresentation/SlideShowConstructor> 24 #include <osgPresentation/AnimationMaterial> 25 25 26 26 #include <stdio.h> … … 126 126 osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_material(std::istream& fin, const osgDB::Options* options) const 127 127 { 128 osg::ref_ptr< ss3d::AnimationMaterial> animationMaterial = new ss3d::AnimationMaterial;128 osg::ref_ptr<osgPresentation::AnimationMaterial> animationMaterial = new osgPresentation::AnimationMaterial; 129 129 animationMaterial->read(fin); 130 130 -
OpenSceneGraph/trunk/src/osgPresentation/AnimationMaterial.cpp
r10113 r10396 11 11 */ 12 12 13 #include "AnimationMaterial.h" 13 #include <osgPresentation/AnimationMaterial> 14 14 15 #include <osg/MatrixTransform> 15 16 #include <osg/PositionAttitudeTransform> … … 17 18 #include <osg/io_utils> 18 19 19 using namespace ss3d;20 using namespace osgPresentation; 20 21 21 22 void AnimationMaterial::insert(double time,osg::Material* material) -
OpenSceneGraph/trunk/src/osgPresentation/CompileSlideCallback.cpp
r10113 r10396 11 11 */ 12 12 13 #include "CompileSlideCallback.h"13 #include <osgPresentation/CompileSlideCallback> 14 14 15 15 #include <osgUtil/GLObjectsVisitor> 16 16 17 using namespace ss3d;17 using namespace osgPresentation; 18 18 19 19 void CompileSlideCallback::operator()(const osg::Camera & camera) const -
OpenSceneGraph/trunk/src/osgPresentation/PickEventHandler.cpp
r10207 r10396 11 11 */ 12 12 13 #include "PickEventHandler.h"14 #include "SlideEventHandler.h"13 #include <osgPresentation/PickEventHandler> 14 #include <osgPresentation/SlideEventHandler> 15 15 16 16 #include <osgViewer/Viewer> -
OpenSceneGraph/trunk/src/osgPresentation/SlideEventHandler.cpp
r10207 r10396 11 11 */ 12 12 13 #include "SlideEventHandler.h"14 #include "SlideShowConstructor.h"13 #include <osgPresentation/SlideEventHandler> 14 #include <osgPresentation/SlideShowConstructor> 15 15 16 16 #include <osg/AnimationPath> … … 26 26 #include <osgGA/AnimationPathManipulator> 27 27 28 #include "AnimationMaterial.h"28 #include <osgPresentation/AnimationMaterial> 29 29 30 30 #include <iostream> … … 139 139 osg::AnimationPathCallback* apc = dynamic_cast<osg::AnimationPathCallback*>(_callback.get()); 140 140 osgUtil::TransformCallback* tc = dynamic_cast<osgUtil::TransformCallback*>(_callback.get()); 141 ss3d::AnimationMaterialCallback* amc = dynamic_cast<ss3d::AnimationMaterialCallback*>(_callback.get());141 AnimationMaterialCallback* amc = dynamic_cast<AnimationMaterialCallback*>(_callback.get()); 142 142 if (apc) 143 143 { … … 161 161 osg::AnimationPathCallback* apc = dynamic_cast<osg::AnimationPathCallback*>(_callback.get()); 162 162 osgUtil::TransformCallback* tc = dynamic_cast<osgUtil::TransformCallback*>(_callback.get()); 163 ss3d::AnimationMaterialCallback* amc = dynamic_cast<ss3d::AnimationMaterialCallback*>(_callback.get());163 AnimationMaterialCallback* amc = dynamic_cast<AnimationMaterialCallback*>(_callback.get()); 164 164 if (apc) 165 165 { … … 1295 1295 if (!_compileSlideCallback) 1296 1296 { 1297 _compileSlideCallback = new ss3d::CompileSlideCallback();1297 _compileSlideCallback = new CompileSlideCallback(); 1298 1298 1299 1299 osgViewer::Viewer::Cameras cameras; -
OpenSceneGraph/trunk/src/osgPresentation/SlideShowConstructor.cpp
r10207 r10396 11 11 */ 12 12 13 #include "SlideShowConstructor.h"13 #include <osgPresentation/SlideShowConstructor> 14 14 15 15 #include <osg/Geometry> … … 48 48 #include <algorithm> 49 49 50 #include "AnimationMaterial.h"51 #include "PickEventHandler.h"50 #include <osgPresentation/AnimationMaterial> 51 #include <osgPresentation/PickEventHandler> 52 52 53 53 using namespace osgPresentation; … … 1572 1572 osg::Node* SlideShowConstructor::attachMaterialAnimation(osg::Node* model, const PositionData& positionData) 1573 1573 { 1574 ss3d::AnimationMaterial* animationMaterial = 0;1574 AnimationMaterial* animationMaterial = 0; 1575 1575 1576 1576 if (!positionData.animation_material_filename.empty()) … … 1583 1583 if (!animation_filestream.eof()) 1584 1584 { 1585 animationMaterial = new ss3d::AnimationMaterial;1585 animationMaterial = new AnimationMaterial; 1586 1586 animationMaterial->read(animation_filestream); 1587 1587 } … … 1589 1589 #else 1590 1590 osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(positionData.animation_material_filename, _options.get()); 1591 animationMaterial = dynamic_cast< ss3d::AnimationMaterial*>(object.get());1591 animationMaterial = dynamic_cast<AnimationMaterial*>(object.get()); 1592 1592 #endif 1593 1593 … … 1597 1597 std::istringstream iss(positionData.fade); 1598 1598 1599 animationMaterial = new ss3d::AnimationMaterial;1599 animationMaterial = new AnimationMaterial; 1600 1600 while (!iss.fail() && !iss.eof()) 1601 1601 { … … 1616 1616 animationMaterial->setLoopMode(positionData.animation_material_loop_mode); 1617 1617 1618 ss3d::AnimationMaterialCallback* animationMaterialCallback = new ss3d::AnimationMaterialCallback(animationMaterial);1618 AnimationMaterialCallback* animationMaterialCallback = new AnimationMaterialCallback(animationMaterial); 1619 1619 animationMaterialCallback->setTimeOffset(positionData.animation_material_time_offset); 1620 1620 animationMaterialCallback->setTimeMultiplier(positionData.animation_material_time_multiplier);
