/* state.h, encapsulate current camera view and animation settings An OpenSceneGraph viewer for pyVolution SWW files. copyright (C) 2004-2005 Geoscience Australia */ /* Finite State Machine for animation 0 1 1 begin storing view/orientation/cull settings 0 2 2 if exists, store current settings, commence playback of saved animation path 0 3 0 save animation to disk 1 1 0 stop storing settings 1 2 2 stop storing settings and commence playback 1 3 1 save animation, keep recording 2 2 0 stop playback, return to saved settings 2 1 2 no effect 2 3 2 save animation, continue playing back header comprised of original command line arguments state comprised of: frame elapsedtime modelview matrix timestep cullsteep wireframe */ #ifndef STATE_H #define STATE_H #include #include #include #include #include #include #include #include class State { public: State(); virtual void setTimestep(unsigned int value){ _timestep = value; } virtual void setCulling(bool value){ _culling = value; } virtual void setWireframe(bool value){ _wireframe = value; } virtual void setMatrix(osg::Matrix value); virtual unsigned int getTimestep(){ return _timestep; } virtual osg::Matrix getMatrix(); virtual bool getCulling(){ return _culling; } virtual bool getWireframe(){ return _wireframe; } virtual void write(std::ostream &s); virtual bool read(std::istream& s); virtual ~State(); protected: unsigned int _timestep; osg::Vec3d _position; osg::Quat _orientation; //osg::Matrix _matrix; bool _culling; bool _wireframe; }; class StateList : public std::vector { public: StateList(); bool write(std::ostream& s); bool read(std::string filename); //void ~StateList(); protected: }; #endif // STATE_H