Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
share/Equalizer/examples/eVolve/config.h
1 
2 /* Copyright (c) 2006-2013, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2012, Daniel Nachbaur <danielnachbaur@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 EVOLVE_CONFIG_H
31 #define EVOLVE_CONFIG_H
32 
33 #include <eq/eq.h>
34 
35 #include "localInitData.h" // member
36 #include "frameData.h" // member
37 
38 namespace eVolve
39 {
40  class Config : public eq::Config
41  {
42  public:
43  Config( eq::ServerPtr parent );
44 
46  virtual bool init();
48  virtual bool exit();
49 
51  virtual uint32_t startFrame();
52 
53  void setInitData( const LocalInitData& data ) { _initData = data; }
54  const InitData& getInitData() const { return _initData; }
55 
57  bool loadInitData( const eq::uint128_t& initDataID );
58 
59  protected:
60  virtual ~Config();
61 
63  virtual bool handleEvent( const eq::ConfigEvent* event );
64 
65  int _spinX, _spinY;
66 
67  eq::Canvas* _currentCanvas;
68 
69  LocalInitData _initData;
70  FrameData _frameData;
71 
72  uint64_t _messageTime;
73 
74  private:
75  void _resetMessage();
76  void _setMessage( const std::string& message );
77  void _switchLayout( int32_t increment );
78  void _deregisterData();
79  bool _handleKeyEvent( const eq::KeyEvent& event );
80 
81  static void _applyRotation( float m[16], const float dx,
82  const float dy );
83  };
84 }
85 
86 #endif // EVOLVE_CONFIG_H
virtual ~Config()
Destruct a config.
A configuration is a visualization session driven by an application.
A canvas represents a logical 2D projection surface.
Definition: client/canvas.h:50
virtual bool exit()
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
virtual uint32_t startFrame()
virtual bool handleEvent(const eq::ConfigEvent *event)
virtual bool init()
bool loadInitData(const eq::uint128_t &initDataID)
Map per-config data to the local node process.