Equalizer  1.11.0
Parallel Rendering Framework
viewData.h
1 
2 /* Copyright (c) 2011-2016, Stefan Eilemann <eile@eyescale.ch>
3  * 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 <eq/fabric/vmmlib.h>
25 #include <co/serializable.h> // base class
26 
27 namespace seq
28 {
30 class ViewData : public co::Serializable
31 {
32 public:
34  SEQ_API ViewData();
35 
37  SEQ_API virtual ~ViewData();
38 
41 #ifndef EQ_2_0_API
42 
51  SEQ_API virtual bool handleEvent( const eq::ConfigEvent* event );
52 #endif
53 
62  SEQ_API virtual bool handleEvent( eq::EventICommand command );
63 
65  SEQ_API void spinModel( const float x, const float y, const float z );
66 
68  SEQ_API void moveModel( const float x, const float y, const float z );
69 
80  SEQ_API void showStatistics( const bool on );
81 
91  SEQ_API void setOrtho( const bool on );
92 
101  virtual SEQ_API bool update();
103 
107  const Matrix4f& getModelMatrix() const { return _modelMatrix; }
108 
110  bool getStatistics() const { return _statistics; }
112 
114  bool useOrtho() const { return _ortho; }
116 
117 protected:
118  virtual SEQ_API void serialize( co::DataOStream& os,
119  const uint64_t dirtyBits );
120  virtual SEQ_API void deserialize( co::DataIStream& is,
121  const uint64_t dirtyBits );
122 
123 private:
125  enum DirtyBits
126  {
127  DIRTY_MODELMATRIX = co::Serializable::DIRTY_CUSTOM << 0, // 1
128  DIRTY_STATISTICS = co::Serializable::DIRTY_CUSTOM << 1, // 2
129  DIRTY_ORTHO = co::Serializable::DIRTY_CUSTOM << 2 // 4
130  };
131 
132  bool _handleEvent( const eq::Event& event );
133 
134  Matrix4f _modelMatrix;
135  int32_t _spinX, _spinY;
136  int32_t _advance;
137  bool _statistics;
138  bool _ortho;
139 };
140 }
141 #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:110
A command specialization for config events.
Definition: eventICommand.h:38
Stores per-view data.
Definition: viewData.h:30
bool useOrtho() const
Definition: viewData.h:114
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:107
SEQ_API void spinModel(const float x, const float y, const float z)
Rotate the model matrix by the given increments.
Sequel - A simple interface to the Equalizer parallel rendering framework.
Definition: application.h:26