Equalizer  1.6.1
share/Equalizer/examples/eqPly/view.h
1 
2 /* Copyright (c) 2009-2012, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2010, Cedric Stalder <cedric.stalder@gmail.com>
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * - Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  * - Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * - Neither the name of Eyescale Software GmbH nor the names of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef EQ_PLY_VIEW_H
31 #define EQ_PLY_VIEW_H
32 
33 #include <eq/eq.h>
34 
35 #include "vertexBufferState.h"
36 #include <string>
37 
38 namespace eqPly
39 {
40  class View : public eq::View
41  {
42  public:
43  View( eq::Layout* parent );
44  virtual ~View();
45 
46  void setModelID( const eq::uint128_t& id );
47  eq::uint128_t getModelID() const { return _modelID; }
48 
49  void setIdleSteps( const int32_t steps );
50  int32_t getIdleSteps() const { return _idleSteps; }
51 
52  void toggleEqualizer();
53 
54  private:
55  class Proxy : public co::Serializable
56  {
57  public:
58  Proxy( View* view ) : _view( view ) {}
59 
60  protected:
62  enum DirtyBits
63  {
64  DIRTY_MODEL = co::Serializable::DIRTY_CUSTOM << 0,
65  DIRTY_IDLE = co::Serializable::DIRTY_CUSTOM << 1
66  };
67 
68  virtual void serialize( co::DataOStream&, const uint64_t );
69  virtual void deserialize( co::DataIStream&, const uint64_t );
70  virtual void notifyNewVersion() { sync(); }
71 
72  private:
73  View* const _view;
74  friend class eqPly::View;
75  };
76 
77  Proxy _proxy;
78  friend class Proxy;
79  eq::uint128_t _modelID;
80  int32_t _idleSteps;
81  };
82 }
83 
84 #endif // EQ_PLY_VIEW_H
A View is a 2D area of a Layout.
A layout groups one or more View, logically belonging together.
Definition: client/layout.h:44
virtual ~View()
Destruct this view.
Definition: view.cpp:49
DirtyBits
The changed parts of the object since the last pack().
Definition: object.h:119