Changeset 12293 for OpenSceneGraph/trunk/include/osgViewer/ViewerBase
- Timestamp:
- 04/19/11 13:46:05 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgViewer/ViewerBase
r12292 r12293 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 36 36 { 37 37 public: 38 38 39 39 ViewerBase(); 40 40 ViewerBase(const ViewerBase& vb); 41 42 41 42 43 43 /** Set the Stats object used for collect various frame related timing and scene graph stats.*/ 44 44 virtual void setViewerStats(osg::Stats* stats) = 0; … … 50 50 virtual const osg::Stats* getViewerStats() const = 0; 51 51 52 52 53 53 /** read the viewer configuration from a configuration file.*/ 54 54 virtual bool readConfiguration(const std::string& filename) = 0; 55 55 56 56 /** Get whether at least of one of this viewers windows are realized.*/ 57 57 virtual bool isRealized() const = 0; … … 73 73 /** Set the threading model the rendering traversals will use.*/ 74 74 virtual void setThreadingModel(ThreadingModel threadingModel); 75 75 76 76 /** Get the threading model the rendering traversals will use.*/ 77 77 ThreadingModel getThreadingModel() const { return _threadingModel; } … … 81 81 82 82 /** Set up the threading and processor affinity as per the viewers threading model.*/ 83 virtual void setUpThreading(); 83 virtual void setUpThreading(); 84 84 85 85 /** Return true if viewer threads are running. */ … … 90 90 91 91 /** Start any threads required by the viewer.*/ 92 virtual void startThreading(); 92 virtual void startThreading(); 93 93 94 94 enum BarrierPosition … … 97 97 AfterSwapBuffers 98 98 }; 99 99 100 100 /** Set the position of the end barrier. 101 101 * AfterSwapBuffers may result in slightly higher framerates, but may … … 108 108 BarrierPosition getEndBarrierPosition() const { return _endBarrierPosition; } 109 109 110 111 110 111 112 112 /** Set the done flag to signal the viewer's work is done and should exit the frame loop.*/ 113 113 void setDone(bool done) { _done = done; } … … 133 133 /** get the key event that the viewer checks on each frame to see if the viewer's done flag.*/ 134 134 int getKeyEventSetsDone() const { return _keyEventSetsDone; } 135 135 136 136 /** if the flag is true, the viewer set its done flag when a QUIT_APPLICATION is received, false disables this feature */ 137 137 void setQuitEventSetsDone(bool flag) { _quitEventSetsDone = flag; } 138 138 139 139 /** @return true if the viewer respond to the QUIT_APPLICATION-event */ 140 140 bool getQuitEventSetsDone() const { return _quitEventSetsDone; } … … 142 142 143 143 /** Hint to tell the renderingTraversals() method whether to call relaseContext() on the last 144 * context that was made current by the thread calling renderingTraverals(). Note, when 144 * context that was made current by the thread calling renderingTraverals(). Note, when 145 145 * running multi-threaded viewer no threads will be made current or release current. 146 146 * Setting this hint to false can enable the frame loop to be lazy about calling makeCurrent … … 149 149 * be left on, otherwise the wrong context could be left active, introducing errors in rendering.*/ 150 150 void setReleaseContextAtEndOfFrameHint(bool hint) { _releaseContextAtEndOfFrameHint = hint; } 151 151 152 152 /** Hint to tell the renderingTraversals() method whether to call relaseContext().*/ 153 153 bool getReleaseContextAtEndOfFrameHint() const { return _releaseContextAtEndOfFrameHint; } … … 169 169 /** Get the Update OperationQueue. */ 170 170 osg::OperationQueue* getUpdateOperations() { return _updateOperations.get(); } 171 171 172 172 /** Get the const Update OperationQueue. */ 173 173 const osg::OperationQueue* getUpdateOperations() const { return _updateOperations.get(); } 174 174 175 175 /** Add an update operation.*/ 176 176 void addUpdateOperation(osg::Operation* operation); … … 185 185 /** Get the graphics operation to call on realization of the viewers graphics windows.*/ 186 186 osg::Operation* getRealizeOperation() { return _realizeOperation.get(); } 187 188 187 188 189 189 /** Set the incremental compile operation. 190 190 * Used to manage the OpenGL object compilation and merging of subgraphs in a way that avoids overloading … … 230 230 231 231 virtual void updateTraversal() = 0; 232 232 233 233 virtual void renderingTraversals(); 234 234 … … 260 260 /** Get the keyboard and mouse usage of this viewer.*/ 261 261 virtual void getUsage(osg::ApplicationUsage& usage) const = 0; 262 262 263 263 protected: 264 264
