examples/eqPly/frameData.h

00001 
00002 /* Copyright (c) 2006-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQ_PLY_FRAMEDATA_H
00019 #define EQ_PLY_FRAMEDATA_H
00020 
00021 #include "eqPly.h"
00022 
00023 namespace eqPly
00024 {
00025     class View;
00026     typedef std::vector< View* > ViewVector;
00027 
00036     class FrameData : public eq::Object
00037     {
00038     public:
00039         FrameData();
00040 
00041         virtual ~FrameData() {};
00042 
00043         void reset();
00044         
00046         //*{
00047         void setModelID( const uint32_t id );
00048 
00049         void setColorMode( const ColorMode color );
00050         void setRenderMode( const mesh::RenderMode mode );
00051 
00052         void setTranslation(   const eq::Vector3f& translation );
00053         void setRotation(      const eq::Vector3f& rotation    );
00054         void setModelRotation( const eq::Vector3f& rotation    );
00055 
00056         void toggleOrtho();
00057         void toggleStatistics();
00058         void toggleHelp();
00059         void toggleWireframe();
00060         void toggleColorMode();
00061         void togglePilotMode();
00062         void toggleRenderMode();
00063 
00064         uint32_t getModelID() const { return _modelID; }
00065         ColorMode getColorMode() const { return _colorMode; }
00066         bool useOrtho() const { return _ortho; }
00067         bool useStatistics() const { return _statistics; }
00068         bool showHelp() const { return _help; }
00069         bool useWireframe() const { return _wireframe; }
00070         bool usePilotMode() const { return _pilotMode; }
00071         mesh::RenderMode getRenderMode() const { return _renderMode; }
00072         //*}
00073 
00075         //*{
00076         void spinCamera( const float x, const float y );
00077         void spinModel(  const float x, const float y );
00078         void spinModel(  const float x, const float y, const float z );
00079         void moveCamera( const float x, const float y, const float z );
00080         void setCameraPosition( const float x, const float y, const float z );
00081 
00082         const eq::Matrix4f& getCameraRotation() const
00083             { return _rotation; }
00084         const eq::Matrix4f& getModelRotation() const
00085             { return _modelRotation; }
00086         const eq::Vector3f& getCameraTranslation() const
00087             { return _translation; }
00088         //*}
00089 
00091         //*{
00092         void setCurrentViewID( const uint32_t id );
00093         uint32_t getCurrentViewID() const { return _currentViewID; }
00094         //*}
00095 
00097         //*{
00098         void setMessage( const std::string& message );
00099         const std::string& getMessage() const { return _message; }
00100         //*}
00101 
00102     protected:
00104         virtual void serialize( eq::net::DataOStream& os,
00105                                 const uint64_t dirtyBits );
00107         virtual void deserialize( eq::net::DataIStream& is,
00108                                   const uint64_t dirtyBits );
00109 
00110         virtual ChangeType getChangeType() const { return DELTA; }
00111 
00113         enum DirtyBits
00114         {
00115             DIRTY_CAMERA  = eq::Object::DIRTY_CUSTOM << 0,
00116             DIRTY_FLAGS   = eq::Object::DIRTY_CUSTOM << 1,
00117             DIRTY_VIEW    = eq::Object::DIRTY_CUSTOM << 2,
00118             DIRTY_MESSAGE = eq::Object::DIRTY_CUSTOM << 3,
00119         };
00120 
00121     private:
00122         eq::Matrix4f _rotation;
00123         eq::Matrix4f _modelRotation;
00124         eq::Vector3f _translation;
00125         
00126         uint32_t         _modelID;
00127         mesh::RenderMode _renderMode;
00128         ColorMode        _colorMode;
00129         bool             _ortho;
00130         bool             _statistics;
00131         bool             _help;
00132         bool             _wireframe;
00133         bool             _pilotMode;
00134 
00135         uint32_t _currentViewID;
00136         std::string _message;
00137     };
00138 }
00139 
00140 
00141 #endif // EQ_PLY_FRAMEDATA_H
00142 
Generated on Mon Aug 10 18:58:33 2009 for Equalizer 0.9 by  doxygen 1.5.8