Equalizer 1.0
|
00001 00002 /* Copyright (c) 2006-2010, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 2007-2009, Maxim Makhinya 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions are met: 00007 * 00008 * - Redistributions of source code must retain the above copyright notice, this 00009 * list of conditions and the following disclaimer. 00010 * - Redistributions in binary form must reproduce the above copyright notice, 00011 * this list of conditions and the following disclaimer in the documentation 00012 * and/or other materials provided with the distribution. 00013 * - Neither the name of Eyescale Software GmbH nor the names of its 00014 * contributors may be used to endorse or promote products derived from this 00015 * software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00021 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00022 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00023 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00024 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00025 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00026 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00027 * POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00030 #ifndef EVOLVE_FRAMEDATA_H 00031 #define EVOLVE_FRAMEDATA_H 00032 00033 #include "eVolve.h" 00034 00035 #include <eq/eq.h> 00036 00037 namespace eVolve 00038 { 00039 class FrameData : public eq::fabric::Serializable 00040 { 00041 public: 00042 00043 FrameData(); 00044 00045 void reset(); 00046 00048 //*{ 00049 void setOrtho( const bool ortho ); 00050 void adjustQuality( const float delta ); 00051 void toggleOrtho( ); 00052 void toggleHelp(); 00053 void toggleStatistics(); 00054 00055 void spinCamera( const float x, const float y ); 00056 void moveCamera( const float x, const float y, const float z ); 00057 00058 void setTranslation( const eq::Vector3f& translation ); 00059 void setRotation( const eq::Vector3f& rotation ); 00060 00061 bool showHelp() const { return _help; } 00062 bool useOrtho( ) const { return _ortho; } 00063 bool useStatistics() const { return _statistics; } 00064 00065 const eq::Vector3f& getTranslation() const { return _translation; } 00066 const eq::Matrix4f& getRotation() const { return _rotation; } 00067 float getQuality() const { return _quality; } 00068 //*} 00069 00071 //*{ 00072 void setCurrentViewID( const eq::uint128_t& id ); 00073 00074 eq::uint128_t getCurrentViewID() const { return _currentViewID; } 00075 //*} 00076 00078 //*{ 00079 void setMessage( const std::string& message ); 00080 const std::string& getMessage() const { return _message; } 00081 //*} 00082 00083 protected: 00085 virtual void serialize( co::DataOStream& os, 00086 const uint64_t dirtyBits ); 00087 00089 virtual void deserialize( co::DataIStream& is, 00090 const uint64_t dirtyBits ); 00091 00092 00093 virtual ChangeType getChangeType() const { return DELTA; } 00094 00096 enum DirtyBits 00097 { 00098 DIRTY_CAMERA = eq::fabric::Serializable::DIRTY_CUSTOM << 0, 00099 DIRTY_FLAGS = eq::fabric::Serializable::DIRTY_CUSTOM << 1, 00100 DIRTY_VIEW = eq::fabric::Serializable::DIRTY_CUSTOM << 2, 00101 DIRTY_MESSAGE = eq::fabric::Serializable::DIRTY_CUSTOM << 3, 00102 }; 00103 00104 private: 00105 00106 eq::Matrix4f _rotation; 00107 eq::Vector3f _translation; 00108 bool _ortho; 00109 bool _statistics; 00110 bool _help; 00111 float _quality; 00112 eq::uint128_t _currentViewID; 00113 std::string _message; 00114 }; 00115 } 00116 00117 00118 #endif // EVOLVE_FRAMEDATA_H 00119