Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
share/Equalizer/examples/eqPly/view.h
1 
2 /* Copyright (c) 2009-2013, 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 
37 #include <string>
38 
39 namespace eqPly
40 {
41 class View : public eq::View
42 {
43 public:
44  View( eq::Layout* parent );
45  virtual ~View();
46 
47  void setModelID( const eq::uint128_t& id );
48  const eq::uint128_t& getModelID() const { return _modelID; }
49 
50  void setIdleSteps( const int32_t steps );
51  int32_t getIdleSteps() const { return _idleSteps; }
52 
53  void toggleEqualizer();
54 
55 private:
56  class Proxy : public co::Serializable
57  {
58  public:
59  Proxy( View* view ) : _view( view ) {}
60 
61  protected:
63  enum DirtyBits
64  {
65  DIRTY_MODEL = co::Serializable::DIRTY_CUSTOM << 0,
66  DIRTY_IDLE = co::Serializable::DIRTY_CUSTOM << 1
67  };
68 
69  virtual void serialize( co::DataOStream&, const uint64_t );
70  virtual void deserialize( co::DataIStream&, const uint64_t );
71  virtual void notifyNewVersion() { sync(); }
72 
73  private:
74  View* const _view;
75  friend class eqPly::View;
76  };
77 
78  Proxy _proxy;
79  friend class Proxy;
80  eq::uint128_t _modelID;
81  int32_t _idleSteps;
82 };
83 }
84 
85 #endif // EQ_PLY_VIEW_H
virtual ~View()
Destruct this view.
Definition: view.cpp:49
DirtyBits
The changed parts of the object since the last pack().
Definition: object.h:104
A layout groups one or more View, logically belonging together.
Definition: client/layout.h:46
A View is a 2D area of a Layout.