Equalizer  1.4.1
share/Equalizer/examples/eVolve/frameData.h
00001 
00002 /* Copyright (c) 2006-2011, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *               2007-2011, Maxim Makhinya  <maxmah@gmail.com>
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 co::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 toggleBackground();
00052         void toggleNormalsQuality();
00053         void toggleColorMode();
00054         void toggleOrtho();
00055         void toggleHelp();
00056         void toggleStatistics();
00057 
00058         void spinCamera( const float x, const float y );
00059         void moveCamera( const float x, const float y, const float z );
00060 
00061         void setTranslation( const eq::Vector3f& translation );
00062         void setRotation(    const eq::Vector3f& rotation    );
00063 
00064         bool showHelp()      const { return _help;       }
00065         bool useOrtho( )     const { return _ortho;      }
00066         bool useStatistics() const { return _statistics; }
00067 
00068         const eq::Vector3f& getTranslation() const { return _translation; }
00069         const eq::Matrix4f& getRotation()    const { return _rotation;    }
00070         float getQuality() const { return _quality; }
00071         ColorMode getColorMode() const { return _colorMode; }
00072         BackgroundMode getBackgroundMode() const { return _bgMode; }
00073         NormalsQuality getNormalsQuality() const { return _normalsQuality; }
00074         //*}
00075 
00077         //*{
00078         void setCurrentViewID( const eq::uint128_t& id );
00079 
00080         eq::uint128_t getCurrentViewID() const { return _currentViewID; }
00081         //*}
00082 
00084         //*{
00085         void setMessage( const std::string& message );
00086         const std::string& getMessage() const { return _message; }
00087         //*}
00088 
00089     protected:
00091         virtual void serialize(         co::DataOStream& os,
00092                                   const uint64_t              dirtyBits );
00093 
00095         virtual void deserialize(       co::DataIStream& is,
00096                                   const uint64_t              dirtyBits );
00097 
00098 
00099         virtual ChangeType getChangeType() const { return DELTA; }
00100 
00102         enum DirtyBits
00103         {
00104             DIRTY_CAMERA  = co::Serializable::DIRTY_CUSTOM << 0,
00105             DIRTY_FLAGS   = co::Serializable::DIRTY_CUSTOM << 1,
00106             DIRTY_VIEW    = co::Serializable::DIRTY_CUSTOM << 2,
00107             DIRTY_MESSAGE = co::Serializable::DIRTY_CUSTOM << 3,
00108         };
00109 
00110     private:
00111 
00112         eq::Matrix4f    _rotation;
00113         eq::Vector3f    _translation;
00114         bool            _ortho;
00115         ColorMode       _colorMode;
00116         BackgroundMode  _bgMode;
00117         NormalsQuality  _normalsQuality;
00118         bool            _statistics;
00119         bool            _help;
00120         float           _quality;
00121         eq::uint128_t   _currentViewID;
00122         std::string     _message;
00123     };
00124 }
00125 
00126 
00127 #endif // EVOLVE_FRAMEDATA_H
00128 
Generated on Mon Nov 26 2012 14:41:48 for Equalizer 1.4.1 by  doxygen 1.7.6.1