- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgPresentation/SlideEventHandler
r12876 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 */ … … 163 163 ActiveOperators(); 164 164 ~ActiveOperators(); 165 165 166 166 void collect(osg::Node* incommingNode, osg::NodeVisitor::TraversalMode tm = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN); 167 167 168 168 void process(); 169 169 170 170 void setPause(bool pause); 171 171 bool getPause() const { return _pause; } 172 172 173 173 void reset(); 174 174 … … 197 197 198 198 SlideEventHandler(osgViewer::Viewer* viewer=0); 199 199 200 200 static SlideEventHandler* instance(); 201 201 202 202 META_Object(osgslideshowApp,SlideEventHandler); 203 203 … … 210 210 211 211 virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&); 212 212 213 213 virtual void getUsage(osg::ApplicationUsage& usage) const; 214 214 215 215 osgViewer::Viewer* getViewer() { return _viewer.get(); } 216 216 … … 225 225 226 226 unsigned int getNumSlides(); 227 227 228 228 int getActiveSlide() const { return _activeSlide; } 229 229 int getActiveLayer() const { return _activeLayer; } … … 240 240 bool nextLayer(); 241 241 bool previousLayer(); 242 242 243 243 bool home(); 244 244 245 245 void setAutoSteppingActive(bool flag = true) { _autoSteppingActive = flag; } 246 246 bool getAutoSteppingActive() const { return _autoSteppingActive; } 247 247 248 248 void setTimeDelayBetweenSlides(double dt) { _timePerSlide = dt; } 249 249 double getTimeDelayBetweenSlides() const { return _timePerSlide; } 250 250 251 251 double getDuration(const osg::Node* node) const; 252 252 … … 267 267 bool getRequestReload() const { return _requestReload; } 268 268 269 269 270 270 protected: 271 271 … … 277 277 void updateAlpha(bool, bool, float x, float y); 278 278 void updateLight(float x, float y); 279 279 280 280 281 281 osg::observer_ptr<osgViewer::Viewer> _viewer; 282 282 283 283 osg::observer_ptr<osg::Switch> _showSwitch; 284 284 int _activePresentation; 285 285 286 286 osg::observer_ptr<osg::Switch> _presentationSwitch; 287 287 int _activeSlide; … … 297 297 bool _pause; 298 298 bool _hold; 299 299 300 300 bool _updateLightActive; 301 301 bool _updateOpacityActive; 302 302 float _previousX, _previousY; 303 303 304 304 bool _cursorOn; 305 305 … … 311 311 312 312 float _timeDelayOnNewSlideWithMovies; 313 313 314 314 double _minimumTimeBetweenKeyPresses; 315 315 double _timeLastKeyPresses; 316 316 317 317 ActiveOperators _activeOperators; 318 318 319 319 osg::ref_ptr<CompileSlideCallback> _compileSlideCallback; 320 320 … … 322 322 323 323 void updateOperators(); 324 324 325 325 }; 326 326
