diff --git a/applications/present3D/deprecated/ExportHTML.h b/applications/present3D/deprecated/ExportHTML.h index df17cfd67..0ede43379 100644 --- a/applications/present3D/deprecated/ExportHTML.h +++ b/applications/present3D/deprecated/ExportHTML.h @@ -1,19 +1,19 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under + * This software is open source and may be redistributed and/or modified under * the terms of the GNU General Public License (GPL) version 2.0. * The full license is in LICENSE.txt file included with this distribution,. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * include LICENSE.txt for more details. */ #ifndef EXPORTHTML_H #define EXPORTHTML_H 1 -#include +#include #include class ExportHTML diff --git a/applications/present3D/deprecated/ReadShowFile.cpp b/applications/present3D/deprecated/ReadShowFile.cpp index b8820cb2c..15bd9e40c 100644 --- a/applications/present3D/deprecated/ReadShowFile.cpp +++ b/applications/present3D/deprecated/ReadShowFile.cpp @@ -1,19 +1,19 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under + * This software is open source and may be redistributed and/or modified under * the terms of the GNU General Public License (GPL) version 2.0. * The full license is in LICENSE.txt file included with this distribution,. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * include LICENSE.txt for more details. */ #include "ReadShowFile.h" #include "ShowEventHandler.h" -#include +#include #include #include @@ -35,7 +35,7 @@ class AddVolumeEditingCallbackVisitor : public osg::NodeVisitor public: AddVolumeEditingCallbackVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} - + void apply(osg::Group& group) { osgVolume::VolumeTile* volumeTile = dynamic_cast(&group); @@ -51,7 +51,7 @@ public: traverse(group); } } - + }; bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, FileNameList& normalFiles) @@ -62,7 +62,7 @@ bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, F if (!arguments.isOption(pos)) { std::string ext = osgDB::getFileExtension(arguments[pos]); - if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d")) + if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d")) { xmlFiles.push_back(arguments[pos]); } @@ -73,7 +73,7 @@ bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, F } } return (!xmlFiles.empty() || !normalFiles.empty()); -} +} bool p3d::readEnvVars(osg::ArgumentParser& arguments) { @@ -94,23 +94,23 @@ bool p3d::readEnvVars(osg::ArgumentParser& arguments) { osgDB::getDataFilePathList().push_front(path); } - + if (p3d::readEnvVars(file)) readVars = true; } } } } - + return readVars; } bool p3d::readEnvVars(const std::string& fileName) { std::string ext = osgDB::getFileExtension(fileName); - if (!osgDB::equalCaseInsensitive(ext,"xml") && + if (!osgDB::equalCaseInsensitive(ext,"xml") && !osgDB::equalCaseInsensitive(ext,"p3d")) return false; - - + + osg::ref_ptr doc = new osgDB::XmlNode; osgDB::XmlNode* root = 0; @@ -146,7 +146,7 @@ bool p3d::readEnvVars(const std::string& fileName) } bool readVars = false; - + for(osgDB::XmlNode::Children::iterator itr = root->children.begin(); itr != root->children.end(); ++itr) @@ -182,7 +182,7 @@ osgDB::Options* createOptions(const osgDB::ReaderWriter::Options* options) osg::ref_ptr p3d::readHoldingSlide(const std::string& filename) { std::string ext = osgDB::getFileExtension(filename); - if (!osgDB::equalCaseInsensitive(ext,"xml") && + if (!osgDB::equalCaseInsensitive(ext,"xml") && !osgDB::equalCaseInsensitive(ext,"p3d")) return 0; osg::ref_ptr options = createOptions(0); @@ -260,12 +260,12 @@ osg::ref_ptr p3d::readShowFiles(osg::ArgumentParser& arguments,const } } } - + if (nodeList.empty()) { return NULL; } - + osg::ref_ptr root; if (nodeList.size()==1) @@ -274,7 +274,7 @@ osg::ref_ptr p3d::readShowFiles(osg::ArgumentParser& arguments,const } else // size >1 { - + osg::Switch* sw = new osg::Switch; for(NodeList::iterator itr=nodeList.begin(); itr!=nodeList.end(); @@ -283,7 +283,7 @@ osg::ref_ptr p3d::readShowFiles(osg::ArgumentParser& arguments,const sw->addChild((*itr).get()); } sw->setSingleChildOn(0); - + sw->setEventCallback(new p3d::ShowEventHandler()); root = sw; @@ -292,7 +292,7 @@ osg::ref_ptr p3d::readShowFiles(osg::ArgumentParser& arguments,const if (root.valid()) { osg::notify(osg::INFO)<<"Got node now adding callback"<accept(avecv); } diff --git a/applications/present3D/deprecated/present3D.cpp b/applications/present3D/deprecated/present3D.cpp index a00a3ab91..656f68bee 100644 --- a/applications/present3D/deprecated/present3D.cpp +++ b/applications/present3D/deprecated/present3D.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include "ReadShowFile.h" diff --git a/include/osgPresentation/AnimationMaterial b/include/osgPresentation/deprecated/AnimationMaterial similarity index 100% rename from include/osgPresentation/AnimationMaterial rename to include/osgPresentation/deprecated/AnimationMaterial diff --git a/include/osgPresentation/CompileSlideCallback b/include/osgPresentation/deprecated/CompileSlideCallback similarity index 100% rename from include/osgPresentation/CompileSlideCallback rename to include/osgPresentation/deprecated/CompileSlideCallback diff --git a/include/osgPresentation/KeyEventHandler b/include/osgPresentation/deprecated/KeyEventHandler similarity index 97% rename from include/osgPresentation/KeyEventHandler rename to include/osgPresentation/deprecated/KeyEventHandler index dc178af8b..0aa0cc26d 100644 --- a/include/osgPresentation/KeyEventHandler +++ b/include/osgPresentation/deprecated/KeyEventHandler @@ -18,7 +18,7 @@ #include -#include +#include namespace osgPresentation { @@ -33,7 +33,7 @@ class OSGPRESENTATION_EXPORT KeyEventHandler : public osgGA::GUIEventHandler void setKey(int key) { _key = key; } int getKey() const { return _key; } - + void setOperation(osgPresentation::Operation operation) { _operation = operation; } osgPresentation::Operation getOperation() const { return _operation; } @@ -55,7 +55,7 @@ class OSGPRESENTATION_EXPORT KeyEventHandler : public osgGA::GUIEventHandler void doOperation(); int _key; - + std::string _command; osgPresentation::KeyPosition _keyPos; osgPresentation::Operation _operation; diff --git a/include/osgPresentation/PickEventHandler b/include/osgPresentation/deprecated/PickEventHandler similarity index 97% rename from include/osgPresentation/PickEventHandler rename to include/osgPresentation/deprecated/PickEventHandler index 32031be83..329d7955c 100644 --- a/include/osgPresentation/PickEventHandler +++ b/include/osgPresentation/deprecated/PickEventHandler @@ -18,7 +18,7 @@ #include -#include +#include namespace osgPresentation { @@ -42,7 +42,7 @@ class OSGPRESENTATION_EXPORT PickEventHandler : public osgGA::GUIEventHandler void setJumpData(const JumpData& jumpData) { _jumpData = jumpData; } const JumpData& getJumpData() const { return _jumpData; } - + virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv); virtual void accept(osgGA::GUIEventHandlerVisitor& v); diff --git a/include/osgPresentation/PropertyManager b/include/osgPresentation/deprecated/PropertyManager similarity index 100% rename from include/osgPresentation/PropertyManager rename to include/osgPresentation/deprecated/PropertyManager diff --git a/include/osgPresentation/SlideEventHandler b/include/osgPresentation/deprecated/SlideEventHandler similarity index 98% rename from include/osgPresentation/SlideEventHandler rename to include/osgPresentation/deprecated/SlideEventHandler index c46bfee5c..09801aee1 100644 --- a/include/osgPresentation/SlideEventHandler +++ b/include/osgPresentation/deprecated/SlideEventHandler @@ -21,15 +21,15 @@ #include #include -#include -#include +#include +#include namespace osgPresentation { // forward declare class SlideEventHandler; - + /// Operations related to click to run/load/key events. enum Operation { @@ -46,7 +46,7 @@ struct JumpData relativeJump(true), slideNum(0), layerNum(0) {} - + JumpData(bool in_relativeJump, int in_slideNum, int in_layerNum): relativeJump(in_relativeJump), slideNum(in_slideNum), @@ -230,7 +230,7 @@ protected: void processOutgoing(SlideEventHandler* seh); void processIncomming(SlideEventHandler* seh); void processMaintained(SlideEventHandler* seh); - + bool _pause; OperatorList _previous; diff --git a/include/osgPresentation/SlideShowConstructor b/include/osgPresentation/deprecated/SlideShowConstructor similarity index 98% rename from include/osgPresentation/SlideShowConstructor rename to include/osgPresentation/deprecated/SlideShowConstructor index 5c4a39398..d5d59555b 100644 --- a/include/osgPresentation/SlideShowConstructor +++ b/include/osgPresentation/deprecated/SlideShowConstructor @@ -31,10 +31,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace osgPresentation { @@ -67,7 +67,7 @@ public: enum CoordinateFrame { SLIDE, MODEL }; - + LayerAttributes* getOrCreateLayerAttributes(osg::Node* node); void setDuration(osg::Node* node,double duration) @@ -253,7 +253,7 @@ public: osg::Vec4 backgroundColor; double fps; double duration; - + bool imageSequence; osg::ImageSequence::Mode imageSequencePagingMode; @@ -271,7 +271,7 @@ public: OFF, ON }; - + BlendingHint blendingHint; double delayTime; @@ -420,7 +420,7 @@ public: CURRENT_SLIDE, CURRENT_LAYER }; - + void addEventHandler(PresentationContext presentationContext, osg::ref_ptr handler); void keyToDoOperation(PresentationContext presentationContext, int key, Operation operation, const JumpData& jumpData=JumpData()); @@ -456,7 +456,7 @@ public: void addModel(const std::string& filename, const PositionData& positionData, const ModelData& modelData); void setUpVolumeScalarProperty(osgVolume::VolumeTile* tile, osgVolume::ScalarProperty* property, const std::string& source); - + void addVolume(const std::string& filename, const PositionData& positionData, const VolumeData& volumeData); osg::Group* takePresentation() { return _root.release(); } @@ -469,7 +469,7 @@ public: void pushCurrentLayer(); void popCurrentLayer(); - + osg::Group* getCurrentLayer() { return _currentLayer.get(); } void setLoopPresentation(bool loop) { _loopPresentation = loop; } @@ -555,7 +555,7 @@ protected: osg::ref_ptr _propertyManager; osg::ref_ptr _propertyEventCallback; - + osg::ref_ptr _root; osg::ref_ptr _presentationSwitch; diff --git a/include/osgPresentation/Timeout b/include/osgPresentation/deprecated/Timeout similarity index 98% rename from include/osgPresentation/Timeout rename to include/osgPresentation/deprecated/Timeout index 8a9f376e2..a3dc8547d 100644 --- a/include/osgPresentation/Timeout +++ b/include/osgPresentation/deprecated/Timeout @@ -16,7 +16,7 @@ #include -#include +#include namespace osgPresentation { @@ -38,7 +38,7 @@ protected: virtual ~HUDSettings(); }; - + class OSGPRESENTATION_EXPORT Timeout : public osg::Transform { public: @@ -50,14 +50,14 @@ class OSGPRESENTATION_EXPORT Timeout : public osg::Transform META_Node(osgPresentation, Timeout); - + void setIdleDurationBeforeTimeoutDisplay(double t) { _idleDurationBeforeTimeoutDisplay = t; } double getIdleDurationBeforeTimeoutDisplay() const { return _idleDurationBeforeTimeoutDisplay; } void setIdleDurationBeforeTimeoutAction(double t) { _idleDurationBeforeTimeoutAction = t; } double getIdleDurationBeforeTimeoutAction() const { return _idleDurationBeforeTimeoutAction; } - + void setKeyStartsTimoutDisplay(int key) { _keyStartsTimoutDisplay = key; } int getKeyStartsTimoutDisplay() const { return _keyStartsTimoutDisplay; } @@ -67,7 +67,7 @@ class OSGPRESENTATION_EXPORT Timeout : public osg::Transform void setKeyRunTimoutAction(int key) { _keyRunTimeoutAction = key; } int getKeyRunTimoutAction() const { return _keyRunTimeoutAction; } - + void setDisplayBroadcastKeyPosition(const osgPresentation::KeyPosition& keyPos) { _displayBroadcastKeyPos = keyPos; } const osgPresentation::KeyPosition& getDisplayBroadcastKeyPosition() const { return _displayBroadcastKeyPos; } diff --git a/src/osgPlugins/osc/OscReceivingDevice.cpp b/src/osgPlugins/osc/OscReceivingDevice.cpp index f0982e407..2af939c08 100644 --- a/src/osgPlugins/osc/OscReceivingDevice.cpp +++ b/src/osgPlugins/osc/OscReceivingDevice.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "osc/OscPrintReceivedElements.h" #include "osc/OscHostEndianness.h" @@ -93,7 +93,7 @@ public: { } virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m); - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << ": add all transmitted arguments as ValueObjects to an USER-event"; @@ -102,7 +102,7 @@ public: } private: void addArgumentToUdc(osg::UserDataContainer* udc, const std::string& key, const osc::ReceivedMessageArgumentIterator& itr); - + template bool addNativeTypeFromVector(osg::UserDataContainer* udc, const std::string& key, const std::vector& arr) { @@ -128,9 +128,9 @@ private: } return false; } - + bool _treatFirstArgumentAsValueName; - + }; @@ -141,18 +141,18 @@ bool StandardRequestHandler::operator()(const std::string& request_path, const s { std::string path = osgDB::getFilePath(full_request_path); std::string last_elem = osgDB::getSimpleFileName(full_request_path); - + osg::ref_ptr ea = getDevice()->getOrCreateUserDataEvent(); osg::UserDataContainer* udc = ea->getOrCreateUserDataContainer(); - - + + ea->setName(_treatFirstArgumentAsValueName ? full_request_path : path); udc->setName(ea->getName()); - + if (m.ArgumentCount() == 0) { return true; } - + // if we have only one argument, get it and save it to the udc else if (m.ArgumentCount() == 1) { @@ -210,7 +210,7 @@ bool StandardRequestHandler::operator()(const std::string& request_path, const s return true; } } - + for(osc::ReceivedMessageArgumentIterator itr = start; itr != m.ArgumentsEnd(); ++itr, ++i) { std::ostringstream ss; @@ -219,7 +219,7 @@ bool StandardRequestHandler::operator()(const std::string& request_path, const s } } return true; - + } catch(osc::Exception& e) { @@ -237,46 +237,46 @@ void StandardRequestHandler::addArgumentToUdc(osg::UserDataContainer* udc, const case osc::TRUE_TYPE_TAG: udc->setUserValue(key, true); break; - + case osc::FALSE_TYPE_TAG: udc->setUserValue(key, false); break; - + case osc::INT32_TYPE_TAG: udc->setUserValue(key, (int)((*itr).AsInt32Unchecked())); break; - + case osc::FLOAT_TYPE_TAG: udc->setUserValue(key, (*itr).AsFloatUnchecked()); break; - + case osc::CHAR_TYPE_TAG: udc->setUserValue(key, (*itr).AsCharUnchecked()); break; - + case osc::RGBA_COLOR_TYPE_TAG: // TODO: should we convert the color to an osg::Vec4? udc->setUserValue(key, static_cast((*itr).AsRgbaColorUnchecked())); break; - + case osc::INT64_TYPE_TAG: // TODO 64bit ints not supported by ValueObject udc->setUserValue(key, static_cast((*itr).AsInt64Unchecked())); break; - + case osc::TIME_TAG_TYPE_TAG: // TODO 64bit ints not supported by ValueObject udc->setUserValue(key, static_cast((*itr).AsTimeTagUnchecked())); break; - + case osc::DOUBLE_TYPE_TAG: udc->setUserValue(key, (*itr).AsDoubleUnchecked()); break; - + case osc::STRING_TYPE_TAG: udc->setUserValue(key, std::string((*itr).AsStringUnchecked())); break; - + case osc::SYMBOL_TYPE_TAG: udc->setUserValue(key, std::string((*itr).AsSymbol())); break; @@ -297,25 +297,25 @@ public: : OscReceivingDevice::RequestHandler("/osgga/mouse/set_input_range") { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { float x_min(-1.0f), y_min(-1.0f), x_max(1.0f), y_max(1.0f); osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> x_min >> y_min >> x_max >> y_max >> osc::EndMessage; - + getDevice()->getEventQueue()->setMouseInputRange(x_min, y_min, x_max, y_max); - + return true; } catch(osc::Exception e) { handleException(e); } - + return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float x_min, float y_min, float x_max, float y_max): sets the mouse-input-range" << std::dec; @@ -329,26 +329,26 @@ public: : OscReceivingDevice::RequestHandler("/osgga/mouse/y_orientation_increasing_upwards") { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { bool increasing_upwards(false); osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >>increasing_upwards >> osc::EndMessage; - + getDevice()->getEventQueue()->getCurrentEventState()->setMouseYOrientation( increasing_upwards ? osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS : osgGA::GUIEventAdapter::Y_INCREASING_DOWNWARDS); - + return true; } catch(osc::Exception e) { handleException(e); } - + return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float x_min, float y_min, float x_max, float y_max): sets the mouse-input-range" << std::dec; @@ -363,28 +363,28 @@ public: , _handleKeyPress(handle_key_press) { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { osc::int32 keycode(0); osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> keycode >> osc::EndMessage; - + if (_handleKeyPress) getDevice()->getEventQueue()->keyPress(keycode, getLocalTime()); else getDevice()->getEventQueue()->keyRelease(keycode, getLocalTime()); - + return true; } catch(osc::Exception e) { handleException(e); } - + return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(int keycode): send KEY_" << (_handleKeyPress ? "DOWN" : "UP"); @@ -400,26 +400,26 @@ public: : OscReceivingDevice::RequestHandler("/osgga/key/press_and_release") { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { osc::int32 keycode(0); osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> keycode >> osc::EndMessage; - + getDevice()->getEventQueue()->keyPress(keycode, getLocalTime()); getDevice()->getEventQueue()->keyRelease(keycode, getLocalTime()); - + return true; } catch(osc::Exception e) { handleException(e); } - + return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(int keycode): send KEY_DOWN and KEY_UP"; @@ -439,16 +439,16 @@ public: , _lastY(0.0f) { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { - + try { osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> _lastX >> _lastY >> osc::EndMessage; - + getDevice()->getEventQueue()->mouseMotion(_lastX, _lastY, getLocalTime()); - + return true; } catch (osc::Exception e) { @@ -456,7 +456,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float x, float y): send mouse motion"; @@ -474,23 +474,23 @@ public: : OscReceivingDevice::RequestHandler("/osgga/mouse/scroll") { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { - + try { osc::int32 sm(osgGA::GUIEventAdapter::SCROLL_NONE); float delta_x(0.0f), delta_y(0.0f); - + osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> sm >> delta_x >> delta_y >> osc::EndMessage; - + if (sm != osgGA::GUIEventAdapter::SCROLL_NONE) getDevice()->getEventQueue()->mouseScroll((osgGA::GUIEventAdapter::ScrollingMotion)sm, getLocalTime()); - + if ((delta_x != 0.0f) || (delta_y != 0.0f)) getDevice()->getEventQueue()->mouseScroll2D(delta_x, delta_y, getLocalTime()); - + return true; } catch (osc::Exception e) { @@ -498,7 +498,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(int scroll_motion, float x, float y): send mouse scroll-motion"; @@ -515,20 +515,20 @@ public: , _btnNum(atoi(btn_name.c_str())) { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { float down(0.0f); - + try { osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> down >> osc::EndMessage; - + if (down > 0) getDevice()->getEventQueue()->mouseButtonPress(_mmHandler->getLastX(), _mmHandler->getLastY(), _btnNum, getLocalTime()); else getDevice()->getEventQueue()->mouseButtonRelease(_mmHandler->getLastX(), _mmHandler->getLastY(), _btnNum, getLocalTime()); - + return true; } catch (osc::Exception e) { @@ -536,7 +536,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float down): toggle mouse button"; @@ -550,7 +550,7 @@ private: class MouseButtonRequestHandler : public OscReceivingDevice::RequestHandler { public: enum Mode { PRESS, RELEASE, DOUBLE_PRESS}; - + MouseButtonRequestHandler(Mode mode) : OscReceivingDevice::RequestHandler("") , _mode(mode) @@ -567,12 +567,12 @@ public: break; } } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { float x(0.0f), y(0.0f); osc::int32 btn(0); - + try { osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> x >> y >> btn >> osc::EndMessage; @@ -587,7 +587,7 @@ public: getDevice()->getEventQueue()->mouseDoubleButtonPress(x,y, btn, getLocalTime()); break; } - + return true; } catch (osc::Exception e) { @@ -595,7 +595,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float x, float y, int btn): send mouse "; @@ -608,7 +608,7 @@ public: out << "double press"; break; } } - + private: Mode _mode; }; @@ -620,16 +620,16 @@ public: : OscReceivingDevice::RequestHandler("/osgga/pen/pressure") { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { float pressure(0.0f); osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> pressure >> osc::EndMessage; - + getDevice()->getEventQueue()->penPressure(pressure, getLocalTime()); - + return true; } catch (osc::Exception e) { @@ -637,7 +637,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float pressure): send pen pressure"; @@ -651,17 +651,17 @@ public: , _handleEnter(handle_enter) { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { osc::int32 pt(osgGA::GUIEventAdapter::UNKNOWN); - + osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> pt >> osc::EndMessage; - + getDevice()->getEventQueue()->penProximity((osgGA::GUIEventAdapter::TabletPointerType)pt, _handleEnter, getLocalTime()); - + return true; } catch (osc::Exception e) { @@ -669,7 +669,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(int table_pointer_type): send pen proximity " << (_handleEnter ? "enter":"leave"); @@ -685,16 +685,16 @@ public: : OscReceivingDevice::RequestHandler("/osgga/pen/orientation") { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m) { try { float rotation(0.0f), tilt_x(0.0f), tilt_y(0.0f); osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> rotation >> tilt_x >> tilt_y >> osc::EndMessage; - + getDevice()->getEventQueue()->penOrientation(tilt_x, tilt_y, rotation, getLocalTime()); - + return true; } catch (osc::Exception e) { @@ -702,7 +702,7 @@ public: } return false; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << "(float rotation, float tilt_x, float tilt_y): send pen orientation"; @@ -732,34 +732,34 @@ OscReceivingDevice::OscReceivingDevice(const std::string& server_address, int li OSG_NOTICE << "(big endian)"; #endif OSG_NOTICE << std::endl; - + _socket = new UdpListeningReceiveSocket(IpEndpointName( server_address.c_str(), listening_port ), this); - + addRequestHandler(new OscDevice::KeyCodeRequestHandler(false)); addRequestHandler(new OscDevice::KeyCodeRequestHandler(true)); addRequestHandler(new OscDevice::KeyPressAndReleaseRequestHandler()); - + addRequestHandler(new OscDevice::SetMouseInputRangeRequestHandler()); addRequestHandler(new OscDevice::SetMouseOrientationRequestHandler()); - + OscDevice::MouseMotionRequestHandler* mm_handler = new OscDevice::MouseMotionRequestHandler(); addRequestHandler(mm_handler); addRequestHandler(new OscDevice::MouseButtonRequestHandler(OscDevice::MouseButtonRequestHandler::PRESS)); addRequestHandler(new OscDevice::MouseButtonRequestHandler(OscDevice::MouseButtonRequestHandler::RELEASE)); addRequestHandler(new OscDevice::MouseButtonRequestHandler(OscDevice::MouseButtonRequestHandler::DOUBLE_PRESS)); addRequestHandler(new OscDevice::MouseScrollRequestHandler()); - + addRequestHandler(new OscDevice::MouseButtonToggleRequestHandler("1", mm_handler)); addRequestHandler(new OscDevice::MouseButtonToggleRequestHandler("2", mm_handler)); addRequestHandler(new OscDevice::MouseButtonToggleRequestHandler("3", mm_handler)); - + addRequestHandler(new OscDevice::PenPressureRequestHandler()); addRequestHandler(new OscDevice::PenOrientationRequestHandler()); addRequestHandler(new OscDevice::PenProximityRequestHandler(true)); addRequestHandler(new OscDevice::PenProximityRequestHandler(false)); - + addRequestHandler(new OscDevice::StandardRequestHandler("/osg/set_user_value", true)); - + addRequestHandler(new OscDevice::StandardRequestHandler("", false)); setSchedulePriority(OpenThreads::Thread::THREAD_PRIORITY_LOW); start(); @@ -783,10 +783,10 @@ void OscReceivingDevice::run() void OscReceivingDevice::ProcessMessage( const osc::ReceivedMessage& m, const IpEndpointName& remoteEndpoint ) { std::string in_request_path(m.AddressPattern()); - + if (in_request_path == "/osc/msg_id") return; - + std::string request_path = in_request_path + "/"; std::size_t pos(std::string::npos); @@ -796,17 +796,17 @@ void OscReceivingDevice::ProcessMessage( const osc::ReceivedMessage& m, const Ip if (pos != std::string::npos) { std::string mangled_path = request_path.substr(0, pos); - + std::pair range = _map.equal_range(mangled_path); - + for(RequestHandlerMap::iterator i = range.first; i != range.second; ++i) { // OSG_INFO << "OscDevice :: handling " << mangled_path << " with " << i->second << std::endl; - + if (i->second->operator()(mangled_path, in_request_path, m) && !handled) handled = true; } - + } } while ((pos != std::string::npos) && (pos > 0) && !handled); @@ -817,7 +817,7 @@ void OscReceivingDevice::ProcessBundle( const osc::ReceivedBundle& b, { // find msg-id MsgIdType msg_id(0); - + for( osc::ReceivedBundle::const_iterator i = b.ElementsBegin(); i != b.ElementsEnd(); ++i ){ const osc::ReceivedMessage& m = osc::ReceivedMessage(*i); std::string address_pattern(m.AddressPattern()); @@ -836,7 +836,7 @@ void OscReceivingDevice::ProcessBundle( const osc::ReceivedBundle& b, _lastMsgId = 0; } _lastMsgTimeStamp = now; - + if (msg_id <= _lastMsgId) { // already handled // OSG_WARN << "OscReceiver :: message with lower id received: " << msg_id << std::endl; @@ -849,8 +849,8 @@ void OscReceivingDevice::ProcessBundle( const osc::ReceivedBundle& b, _lastMsgId = msg_id; } } - - + + for( osc::ReceivedBundle::const_iterator i = b.ElementsBegin(); i != b.ElementsEnd(); ++i ){ if( i->IsBundle() ) ProcessBundle( osc::ReceivedBundle(*i), remoteEndpoint ); @@ -873,16 +873,16 @@ void OscReceivingDevice::ProcessPacket( const char *data, int size, const IpEndp catch(...) { OSG_WARN << "OscDevice :: could not process UDP-packet because of an exception!" << std::endl; } - + if (_userDataEvent.valid()) { char address[IpEndpointName::ADDRESS_AND_PORT_STRING_LENGTH]; - + remoteEndpoint.AddressAndPortAsString(address); - + _userDataEvent->setUserValue("osc/remote_end_point", std::string(address)); - + getEventQueue()->addEvent(_userDataEvent.get()); _userDataEvent = NULL; } @@ -901,7 +901,7 @@ void OscReceivingDevice::describeTo(std::ostream& out) const { out << "OscDevice :: listening on " << _listeningAddress << ":" << _listeningPort << std::endl; out << std::endl; - + for(RequestHandlerMap::const_iterator i = _map.begin(); i != _map.end(); ++i) { const RequestHandler* handler(i->second.get()); diff --git a/src/osgPlugins/osc/ReaderWriterOscDevice.cpp b/src/osgPlugins/osc/ReaderWriterOscDevice.cpp index 4972185fc..70ddc8845 100644 --- a/src/osgPlugins/osc/ReaderWriterOscDevice.cpp +++ b/src/osgPlugins/osc/ReaderWriterOscDevice.cpp @@ -14,8 +14,8 @@ /* * ReadMe - * - * the osc-plugin can return an osgGA::Device which handles various osc-messages + * + * the osc-plugin can return an osgGA::Device which handles various osc-messages * and puts them into the event-queue of the app * you can set arbitrary values via /osg/set_user_value, these values * are set on the attached UserDataConntainer (see below) @@ -26,21 +26,21 @@ * osgGA::Device* device = dynamic_cast(osgDB::readObjectFile(filename)); * * and add that device to your viewer - * The plugin supports the following option: documentRegisteredHandlers, which will + * The plugin supports the following option: documentRegisteredHandlers, which will * dump all registered handlers to the console. The device registers some convenient * handlers to remote control a p3d-presentation. - * - * you can feed a osgPresentation::PropertyManager into the plugin and set values on it via + * + * you can feed a osgPresentation::PropertyManager into the plugin and set values on it via * "/p3d/set_value key value" or "/p3d/set_value/key value" * Additionally the plugin listens for - * "/osg/set_user_value key value" or "/osg/set_user_value/key value" and set the transmitted value on the + * "/osg/set_user_value key value" or "/osg/set_user_value/key value" and set the transmitted value on the * UserDataContainer of the device. * * - * The plugin supports forwarding most of the events per osc to another host. - * It uses a special event-handler, which forwards the events. To get this + * The plugin supports forwarding most of the events per osc to another host. + * It uses a special event-handler, which forwards the events. To get this * event-handler, do something like this: - * + * * std::string filename = ":.sender.osc"; * osgGA::GUIEventHandler* event_handler = dynamic_cast(osgDB::readObjectFile(filename)); * @@ -59,7 +59,7 @@ #include #include "OscSendingDevice.hpp" #include "OscReceivingDevice.hpp" -#include +#include @@ -74,8 +74,8 @@ class ReaderWriterOsc : public osgDB::ReaderWriter supportsOption("documentRegisteredHandlers", "dump a documentation of all registered REST-handler to the console"); supportsOption("numMessagesPerEvent", "set the number of osc-messages to send for one event (sender-only)"); supportsOption("delayBetweenSendsInMillisecs", "when sending multiple msgs per event you can specify an optional delay between the sends (sender-only)"); - - + + } virtual const char* className() const { return "OSC Virtual Device Integration plugin"; } @@ -85,26 +85,26 @@ class ReaderWriterOsc : public osgDB::ReaderWriter if (osgDB::getFileExtension(file) == "osc") { std::string file_name = osgDB::getNameLessExtension(file); - + if (osgDB::getFileExtension(file_name) == "sender") { file_name = osgDB::getNameLessExtension(file_name); - + std::string server_address = file_name.substr(0,file_name.find(':')); std::string server_port = file_name.substr(file_name.find(':') + 1); - + unsigned int num_messages_per_event = 1; if (options && !options->getPluginStringData("numMessagesPerEvent").empty()) { std::string num_messages_per_event_str = options->getPluginStringData("numMessagesPerEvent"); num_messages_per_event = osg::maximum(1, atoi(num_messages_per_event_str.c_str())); } - + unsigned int delay_between_sends_in_millisecs = 0; if (options && !options->getPluginStringData("delayBetweenSendsInMillisecs").empty()) { std::string delay_between_sends_in_millisecs_str = options->getPluginStringData("delayBetweenSendsInMillisecs"); delay_between_sends_in_millisecs = atoi(delay_between_sends_in_millisecs_str.c_str()); } - + return new OscSendingDevice(server_address, atoi(server_port.c_str()), num_messages_per_event, delay_between_sends_in_millisecs); } else @@ -123,37 +123,37 @@ class ReaderWriterOsc : public osgDB::ReaderWriter port = 8000; } try { - + osg::ref_ptr device = new OscReceivingDevice(server_address, port); - - + + device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/slide/first", osgGA::GUIEventAdapter::KEY_Home)); device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/slide/last", osgGA::GUIEventAdapter::KEY_End)); - + device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/slide/next", osgGA::GUIEventAdapter::KEY_Right)); device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/slide/previous", osgGA::GUIEventAdapter::KEY_Left)); device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/layer/next", osgGA::GUIEventAdapter::KEY_Down)); device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/layer/previous", osgGA::GUIEventAdapter::KEY_Up)); - + device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/slideorlayer/next", osgGA::GUIEventAdapter::KEY_Page_Down)); device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/slideorlayer/previous", osgGA::GUIEventAdapter::KEY_Page_Up)); - + device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/unpause", 'o')); device->addRequestHandler(new SendKeystrokeRequestHandler("/p3d/pause", 'p')); - + device->addRequestHandler(new SendKeystrokeRequestHandler("/osgviewer/home", ' ')); device->addRequestHandler(new SendKeystrokeRequestHandler("/osgviewer/stats", 's')); - - - - + + + + if ((options && (options->getPluginStringData("documentRegisteredHandlers") == "true"))) { std::cout << *device << std::endl; } - - + + return device.release(); } catch(const osc::Exception& e) @@ -173,9 +173,9 @@ class ReaderWriterOsc : public osgDB::ReaderWriter } } - + } - + return ReadResult::FILE_NOT_HANDLED; } diff --git a/src/osgPlugins/p3d/ReaderWriterP3D.cpp b/src/osgPlugins/p3d/ReaderWriterP3D.cpp index a0e56a7ba..1f7a662cc 100644 --- a/src/osgPlugins/p3d/ReaderWriterP3D.cpp +++ b/src/osgPlugins/p3d/ReaderWriterP3D.cpp @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -401,7 +401,7 @@ bool ReaderWriterP3DXML::getKeyProperty(osgDB::XmlNode*cur, const char* token, i OSG_NOTICE<<" empty()"<second.find("0x",0,2)!=std::string::npos) { std::istringstream iss(itr->second); @@ -1031,7 +1031,7 @@ bool ReaderWriterP3DXML::parseProperties(osgDB::XmlNode* root, osg::UserDataCont float value; std::stringstream str(cur->contents); str>>value; - + udc.setUserValue(name, value); readProperties = true; @@ -1256,8 +1256,8 @@ void ReaderWriterP3DXML::parseVolume(osgPresentation::SlideShowConstructor& cons else if (operation=="REPLACE_ALPHA_WITH_LUMINANCE") volumeData.colorSpaceOperation = osg::REPLACE_ALPHA_WITH_LUMINANCE; else if (operation=="REPLACE_RGB_WITH_LUMINANCE") volumeData.colorSpaceOperation = osg::REPLACE_RGB_WITH_LUMINANCE; } - - + + // check for any transfer function required std::string transferFunctionFile; @@ -1561,10 +1561,10 @@ void ReaderWriterP3DXML::parseTimeout(osgPresentation::SlideShowConstructor& con timeout->setKeyRunTimoutAction(keyPosition._key); } } - + } - + constructor.popCurrentLayer(); // return the } @@ -1796,7 +1796,7 @@ void ReaderWriterP3DXML::parseLayer(osgPresentation::SlideShowConstructor& const else if (cur->name == "forward_mouse_event_to_device") { osgPresentation::JumpData jumpData; - + OSG_ALWAYS<<"forward_mouse_event_to_device ["<contents<<"]"<contents,osgPresentation::FORWARD_EVENT, jumpData); } @@ -1889,7 +1889,7 @@ void ReaderWriterP3DXML::parseLayer(osgPresentation::SlideShowConstructor& const OSG_NOTICE<<"key_to_jump failed."<name == "clean_layer") @@ -2215,7 +2215,7 @@ void ReaderWriterP3DXML::parseSlide (osgPresentation::SlideShowConstructor& cons OSG_NOTICE<<"getCurrentSlide() returns NULL, unable to set name "<getReaderWriterForProtocolAndExtension( osgDB::getServerProtocol(filename), osgDB::getFileExtension(filename)); - + if (!rw) return osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED; switch(type) @@ -2587,7 +2587,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin, osg::ref_ptr local_opt = options ? static_cast(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; local_opt->setReadFileCallback(new MyReadFileCallback); local_opt->setFindFileCallback(new MyFindFileCallback); - + return readNode(input, local_opt.get()); } diff --git a/src/osgPlugins/p3d/ReaderWriterPaths.cpp b/src/osgPlugins/p3d/ReaderWriterPaths.cpp index 144a149f2..408870f86 100644 --- a/src/osgPlugins/p3d/ReaderWriterPaths.cpp +++ b/src/osgPlugins/p3d/ReaderWriterPaths.cpp @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/src/osgPresentation/CMakeLists.txt b/src/osgPresentation/CMakeLists.txt index 92e9dcd60..d7af9b5a9 100644 --- a/src/osgPresentation/CMakeLists.txt +++ b/src/osgPresentation/CMakeLists.txt @@ -9,28 +9,28 @@ SET(LIB_NAME osgPresentation) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(TARGET_H ${HEADER_PATH}/Export - ${HEADER_PATH}/AnimationMaterial - ${HEADER_PATH}/CompileSlideCallback ${HEADER_PATH}/Cursor - ${HEADER_PATH}/PickEventHandler - ${HEADER_PATH}/PropertyManager - ${HEADER_PATH}/KeyEventHandler - ${HEADER_PATH}/SlideEventHandler - ${HEADER_PATH}/SlideShowConstructor - ${HEADER_PATH}/Timeout + ${HEADER_PATH}/deprecated/AnimationMaterial + ${HEADER_PATH}/deprecated/CompileSlideCallback + ${HEADER_PATH}/deprecated/PickEventHandler + ${HEADER_PATH}/deprecated/PropertyManager + ${HEADER_PATH}/deprecated/KeyEventHandler + ${HEADER_PATH}/deprecated/SlideEventHandler + ${HEADER_PATH}/deprecated/SlideShowConstructor + ${HEADER_PATH}/deprecated/Timeout ) # FIXME: For OS X, need flag for Framework or dylib SET(TARGET_SRC - AnimationMaterial.cpp - CompileSlideCallback.cpp Cursor.cpp - PickEventHandler.cpp - PropertyManager.cpp - KeyEventHandler.cpp - SlideEventHandler.cpp - SlideShowConstructor.cpp - Timeout.cpp + deprecated/AnimationMaterial.cpp + deprecated/CompileSlideCallback.cpp + deprecated/PickEventHandler.cpp + deprecated/PropertyManager.cpp + deprecated/KeyEventHandler.cpp + deprecated/SlideEventHandler.cpp + deprecated/SlideShowConstructor.cpp + deprecated/Timeout.cpp ${OPENSCENEGRAPH_VERSIONINFO_RC} ) diff --git a/src/osgPresentation/AnimationMaterial.cpp b/src/osgPresentation/deprecated/AnimationMaterial.cpp similarity index 99% rename from src/osgPresentation/AnimationMaterial.cpp rename to src/osgPresentation/deprecated/AnimationMaterial.cpp index b09dffd35..d1de72787 100644 --- a/src/osgPresentation/AnimationMaterial.cpp +++ b/src/osgPresentation/deprecated/AnimationMaterial.cpp @@ -10,7 +10,7 @@ * include LICENSE.txt for more details. */ -#include +#include #include #include diff --git a/src/osgPresentation/CompileSlideCallback.cpp b/src/osgPresentation/deprecated/CompileSlideCallback.cpp similarity index 96% rename from src/osgPresentation/CompileSlideCallback.cpp rename to src/osgPresentation/deprecated/CompileSlideCallback.cpp index 58db7f22a..647e7245a 100644 --- a/src/osgPresentation/CompileSlideCallback.cpp +++ b/src/osgPresentation/deprecated/CompileSlideCallback.cpp @@ -10,7 +10,7 @@ * include LICENSE.txt for more details. */ -#include +#include #include diff --git a/src/osgPresentation/KeyEventHandler.cpp b/src/osgPresentation/deprecated/KeyEventHandler.cpp similarity index 97% rename from src/osgPresentation/KeyEventHandler.cpp rename to src/osgPresentation/deprecated/KeyEventHandler.cpp index bbeed5ba5..6118276e0 100644 --- a/src/osgPresentation/KeyEventHandler.cpp +++ b/src/osgPresentation/deprecated/KeyEventHandler.cpp @@ -10,8 +10,8 @@ * include LICENSE.txt for more details. */ -#include -#include +#include +#include #include #include diff --git a/src/osgPresentation/PickEventHandler.cpp b/src/osgPresentation/deprecated/PickEventHandler.cpp similarity index 97% rename from src/osgPresentation/PickEventHandler.cpp rename to src/osgPresentation/deprecated/PickEventHandler.cpp index 16f629c0d..749e6c29e 100644 --- a/src/osgPresentation/PickEventHandler.cpp +++ b/src/osgPresentation/deprecated/PickEventHandler.cpp @@ -10,8 +10,8 @@ * include LICENSE.txt for more details. */ -#include -#include +#include +#include #include #include @@ -77,17 +77,17 @@ bool PickEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA osg::ref_ptr cloned_ea = osg::clone(&ea); const osg::BoundingBox bb(hitr->drawable->getBound()); const osg::Vec3& p(hitr->localIntersectionPoint); - + float transformed_x = (p.x() - bb.xMin()) / (bb.xMax() - bb.xMin()); float transformed_y = (p.z() - bb.zMin()) / (bb.zMax() - bb.zMin()); - + cloned_ea->setX(ea.getXmin() + transformed_x * (ea.getXmax() - ea.getXmin())); cloned_ea->setY(ea.getYmin() + transformed_y * (ea.getYmax() - ea.getYmin())); cloned_ea->setMouseYOrientation(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS); - + // std::cout << transformed_x << "/" << transformed_x << " -> " << cloned_ea->getX() << "/" <getY() << std::endl; - - + + // dispatch cloned event to devices osgViewer::View::Devices& devices = viewer->getDevices(); for(osgViewer::View::Devices::iterator i = devices.begin(); i != devices.end(); ++i) @@ -98,7 +98,7 @@ bool PickEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA } } } - else + else { if (ea.getEventType()==osgGA::GUIEventAdapter::PUSH) { diff --git a/src/osgPresentation/PropertyManager.cpp b/src/osgPresentation/deprecated/PropertyManager.cpp similarity index 99% rename from src/osgPresentation/PropertyManager.cpp rename to src/osgPresentation/deprecated/PropertyManager.cpp index 4e99d6d71..6bc87fc0e 100644 --- a/src/osgPresentation/PropertyManager.cpp +++ b/src/osgPresentation/deprecated/PropertyManager.cpp @@ -10,7 +10,7 @@ * include LICENSE.txt for more details. */ -#include +#include #include using namespace osgPresentation; diff --git a/src/osgPresentation/SlideEventHandler.cpp b/src/osgPresentation/deprecated/SlideEventHandler.cpp similarity index 99% rename from src/osgPresentation/SlideEventHandler.cpp rename to src/osgPresentation/deprecated/SlideEventHandler.cpp index fe52c723c..746bb2d0c 100644 --- a/src/osgPresentation/SlideEventHandler.cpp +++ b/src/osgPresentation/deprecated/SlideEventHandler.cpp @@ -10,8 +10,9 @@ * include LICENSE.txt for more details. */ -#include -#include +#include +#include +#include #include #include @@ -27,7 +28,6 @@ #include -#include #include diff --git a/src/osgPresentation/SlideShowConstructor.cpp b/src/osgPresentation/deprecated/SlideShowConstructor.cpp similarity index 99% rename from src/osgPresentation/SlideShowConstructor.cpp rename to src/osgPresentation/deprecated/SlideShowConstructor.cpp index 807727372..712197bbb 100644 --- a/src/osgPresentation/SlideShowConstructor.cpp +++ b/src/osgPresentation/deprecated/SlideShowConstructor.cpp @@ -10,7 +10,11 @@ * include LICENSE.txt for more details. */ -#include +#include +#include +#include +#include + #include #include @@ -51,10 +55,6 @@ #include #include -#include -#include -#include - #include #include #include diff --git a/src/osgPresentation/Timeout.cpp b/src/osgPresentation/deprecated/Timeout.cpp similarity index 98% rename from src/osgPresentation/Timeout.cpp rename to src/osgPresentation/deprecated/Timeout.cpp index b88130a0c..a0e116853 100644 --- a/src/osgPresentation/Timeout.cpp +++ b/src/osgPresentation/deprecated/Timeout.cpp @@ -11,7 +11,7 @@ * OpenSceneGraph Public License for more details. */ -#include +#include #include #include @@ -28,7 +28,7 @@ public: LEAVE, RESET }; - + OperationVisitor(Operation op) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _operation(op), _sleepTime(0.0) {} void apply(osg::Node& node) @@ -83,7 +83,7 @@ public: double sleepTime() const { return _sleepTime; } Operation _operation; - double _sleepTime; + double _sleepTime; }; @@ -104,7 +104,7 @@ bool HUDSettings::getModelViewMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) matrix.makeLookAt(osg::Vec3d(0.0,0.0,0.0),osg::Vec3d(0.0,_slideDistance,0.0),osg::Vec3d(0.0,0.0,1.0)); if (nv) - { + { if (nv->getTraversalMask()==_leftMask) { matrix.postMultTranslate(osg::Vec3(_eyeOffset,0.0,0.0)); @@ -114,7 +114,7 @@ bool HUDSettings::getModelViewMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) matrix.postMultTranslate(osg::Vec3(-_eyeOffset,0.0,0.0)); } } - + return true; } @@ -288,13 +288,13 @@ void Timeout::traverse(osg::NodeVisitor& nv) } } } - + if (needToRecordEventTime) { _timeOfLastEvent = nv.getFrameStamp()->getReferenceTime(); } - + double timeSinceLastEvent = nv.getFrameStamp() ? nv.getFrameStamp()->getReferenceTime()-_timeOfLastEvent : 0.0; if (timeSinceLastEvent>_idleDurationBeforeTimeoutDisplay) @@ -369,9 +369,9 @@ void Timeout::traverse(osg::NodeVisitor& nv) OSG_NOTICE<<"Doing timeout broadcast key event"<<_actionBroadcastKeyPos._key<