- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgPresentation/PickEventHandler
r12139 r13041 1 /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield 1 /* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield 2 2 * 3 * This software is open source and may be redistributed and/or modified under 3 * This software is open source and may be redistributed and/or modified under 4 4 * the terms of the GNU General Public License (GPL) version 2.0. 5 5 * The full license is in LICENSE.txt file included with this distribution,. 6 * 6 * 7 7 * This software is distributed in the hope that it will be useful, 8 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 10 * include LICENSE.txt for more details. 11 11 */ … … 31 31 PickEventHandler(const std::string& str, osgPresentation::Operation operation, bool relativeJump=true, int slideNum=0, int layerNum=0); 32 32 PickEventHandler(const osgPresentation::KeyPosition& keyPos, bool relativeJump=true, int slideNum=0, int layerNum=0); 33 33 34 34 void setOperation(osgPresentation::Operation operation) { _operation = operation; } 35 35 osgPresentation::Operation getOperation() const { return _operation; } 36 36 37 37 void setCommand(const std::string& str) { _command = str; } 38 38 const std::string& getCommand() const { return _command; } 39 39 40 40 void setKeyPosition(const osgPresentation::KeyPosition& keyPos) { _keyPos = keyPos; } 41 41 const osgPresentation::KeyPosition& getKeyPosition() const { return _keyPos; } 42 42 43 43 void setRelativeJump(int slideDelta, int layerDelta); 44 44 void setAbsoluteJump(int slideNum, int layerNum); 45 45 46 46 bool getRelativeJump() const { return _relativeJump; } 47 47 int getSlideNum() const { return _slideNum; } 48 48 int getLayerNum() const { return _layerNum; } 49 49 50 50 bool requiresJump() const { return _relativeJump ? (_slideNum!=0 || _layerNum!=0) : true; } 51 51 52 52 virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv); 53 53 54 54 virtual void accept(osgGA::GUIEventHandlerVisitor& v); 55 55 56 56 virtual void getUsage(osg::ApplicationUsage& usage) const; 57 57 58 58 void doOperation(); 59 59 60 60 std::string _command; 61 61 osgPresentation::KeyPosition _keyPos; 62 62 osgPresentation::Operation _operation; 63 63 64 64 bool _relativeJump; 65 65 int _slideNum;
