Equalizer
1.4.1
|
00001 00002 /* Copyright (c) 2011-2012, Stefan Eilemann <eile@eyescale.ch> 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 EQSEQUEL_VIEWDATA_H 00019 #define EQSEQUEL_VIEWDATA_H 00020 00021 #include <seq/api.h> 00022 #include <seq/types.h> 00023 #include <co/serializable.h> // base class 00024 00025 namespace seq 00026 { 00028 class ViewData : public co::Serializable 00029 { 00030 public: 00032 SEQ_API ViewData(); 00033 00035 SEQ_API virtual ~ViewData(); 00036 00047 SEQ_API virtual bool handleEvent( const eq::ConfigEvent* event ); 00048 00050 SEQ_API void spinModel( const float x, const float y, const float z ); 00051 00053 SEQ_API void moveModel( const float x, const float y, const float z ); 00054 00065 SEQ_API void showStatistics( const bool on ); 00066 00076 SEQ_API void setOrtho( const bool on ); 00077 00086 virtual SEQ_API bool update(); 00088 00092 const Matrix4f& getModelMatrix() const { return _modelMatrix; } 00093 00095 bool getStatistics() const { return _statistics; } 00097 00099 bool useOrtho() const { return _ortho; } 00101 00102 protected: 00103 virtual SEQ_API void serialize( co::DataOStream& os, 00104 const uint64_t dirtyBits ); 00105 virtual SEQ_API void deserialize( co::DataIStream& is, 00106 const uint64_t dirtyBits ); 00107 00108 private: 00110 enum DirtyBits 00111 { 00112 DIRTY_MODELMATRIX = co::Serializable::DIRTY_CUSTOM << 0, // 1 00113 DIRTY_STATISTICS = co::Serializable::DIRTY_CUSTOM << 1, // 2 00114 DIRTY_ORTHO = co::Serializable::DIRTY_CUSTOM << 2 // 4 00115 }; 00116 00117 Matrix4f _modelMatrix; 00118 int32_t _spinX, _spinY; 00119 int32_t _advance; 00120 bool _statistics; 00121 bool _ortho; 00122 }; 00123 } 00124 #endif // EQSEQUEL_VIEWDATA_H