Equalizer  1.10.1
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viewData.h
1 
2 /* Copyright (c) 2011-2012, Stefan Eilemann <eile@eyescale.ch>
3  * 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQSEQUEL_VIEWDATA_H
20 #define EQSEQUEL_VIEWDATA_H
21 
22 #include <seq/api.h>
23 #include <seq/types.h>
24 #include <co/serializable.h> // base class
25 
26 namespace seq
27 {
29  class ViewData : public co::Serializable
30  {
31  public:
33  SEQ_API ViewData();
34 
36  SEQ_API virtual ~ViewData();
37 
40 #ifndef EQ_2_0_API
41 
50  SEQ_API virtual bool handleEvent( const eq::ConfigEvent* event );
51 #endif
52 
61  SEQ_API virtual bool handleEvent( eq::EventICommand command );
62 
64  SEQ_API void spinModel( const float x, const float y, const float z );
65 
67  SEQ_API void moveModel( const float x, const float y, const float z );
68 
79  SEQ_API void showStatistics( const bool on );
80 
90  SEQ_API void setOrtho( const bool on );
91 
100  virtual SEQ_API bool update();
102 
106  const Matrix4f& getModelMatrix() const { return _modelMatrix; }
107 
109  bool getStatistics() const { return _statistics; }
111 
113  bool useOrtho() const { return _ortho; }
115 
116  protected:
117  virtual SEQ_API void serialize( co::DataOStream& os,
118  const uint64_t dirtyBits );
119  virtual SEQ_API void deserialize( co::DataIStream& is,
120  const uint64_t dirtyBits );
121 
122  private:
124  enum DirtyBits
125  {
126  DIRTY_MODELMATRIX = co::Serializable::DIRTY_CUSTOM << 0, // 1
127  DIRTY_STATISTICS = co::Serializable::DIRTY_CUSTOM << 1, // 2
128  DIRTY_ORTHO = co::Serializable::DIRTY_CUSTOM << 2 // 4
129  };
130 
131  bool _handleEvent( const eq::Event& event );
132 
133  Matrix4f _modelMatrix;
134  int32_t _spinX, _spinY;
135  int32_t _advance;
136  bool _statistics;
137  bool _ortho;
138  };
139 }
140 #endif // EQSEQUEL_VIEWDATA_H
SEQ_API void showStatistics(const bool on)
Enable or disable statistics rendering.
Defines export visibility macros for library Sequel.
SEQ_API ViewData()
Construct a new view data.
virtual SEQ_API bool update()
Update the view data.
bool getStatistics() const
Definition: viewData.h:109
A command specialization for config events.
Definition: eventICommand.h:38
Stores per-view data.
Definition: viewData.h:29
bool useOrtho() const
Definition: viewData.h:113
SEQ_API void moveModel(const float x, const float y, const float z)
Move the model matrix by the given increments.
virtual SEQ_API bool handleEvent(const eq::ConfigEvent *event)
Handle the given event.
SEQ_API void setOrtho(const bool on)
Enable or disable orthographic rendering.
virtual SEQ_API ~ViewData()
Destruct this view data.
const Matrix4f & getModelMatrix() const
Definition: viewData.h:106
SEQ_API void spinModel(const float x, const float y, const float z)
Rotate the model matrix by the given increments.