Equalizer
1.4.1
|
00001 00002 /* Copyright (c) 2006-2012, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 2010, Cedric Stalder <cedric.stalder@gmail.com> 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions are met: 00007 * 00008 * - Redistributions of source code must retain the above copyright notice, this 00009 * list of conditions and the following disclaimer. 00010 * - Redistributions in binary form must reproduce the above copyright notice, 00011 * this list of conditions and the following disclaimer in the documentation 00012 * and/or other materials provided with the distribution. 00013 * - Neither the name of Eyescale Software GmbH nor the names of its 00014 * contributors may be used to endorse or promote products derived from this 00015 * software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00021 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00022 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00023 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00024 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00025 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00026 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00027 * POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00030 #ifndef EQ_PLY_CONFIG_H 00031 #define EQ_PLY_CONFIG_H 00032 00033 // members 00034 #include "localInitData.h" 00035 #include "frameData.h" 00036 #include "tracker.h" 00037 #include "cameraAnimation.h" 00038 00039 #include <eq/eq.h> 00040 #include <eq/admin/base.h> 00041 00042 namespace eqPly 00043 { 00044 class View; 00045 00053 class Config : public eq::Config 00054 { 00055 public: 00056 Config( eq::ServerPtr parent ); 00057 00059 virtual bool init(); 00061 virtual bool exit(); 00062 00064 virtual uint32_t startFrame(); 00065 00066 void setInitData( const LocalInitData& data ) { _initData = data; } 00067 const InitData& getInitData() const { return _initData; } 00068 00070 bool loadData( const eq::uint128_t& initDataID ); 00071 00073 const Model* getModel( const eq::uint128_t& id ); 00074 00076 virtual bool handleEvent( const eq::ConfigEvent* event ); 00077 00079 bool isIdleAA(); 00080 00082 bool needRedraw(); 00083 00085 uint32_t getAnimationFrame(); 00086 00087 protected: 00088 virtual ~Config(); 00089 00091 virtual co::uint128_t sync( 00092 const co::uint128_t& version = co::VERSION_HEAD ); 00093 00094 private: 00095 int _spinX, _spinY; 00096 int _advance; 00097 eq::Canvas* _currentCanvas; 00098 00099 LocalInitData _initData; 00100 FrameData _frameData; 00101 00102 Tracker _tracker; 00103 00104 Models _models; 00105 ModelDists _modelDist; 00106 lunchbox::Lock _modelLock; 00107 00108 CameraAnimation _animation; 00109 00110 uint64_t _messageTime; 00111 00112 bool _redraw; 00113 bool _useIdleAA; 00114 00115 int32_t _numFramesAA; 00116 00117 eq::admin::ServerPtr _admin; 00118 00119 void _loadModels(); 00120 void _registerModels(); 00121 void _loadPath(); 00122 void _deregisterData(); 00123 00124 bool _needNewFrame(); 00125 bool _handleKeyEvent( const eq::KeyEvent& event ); 00126 00127 void _switchCanvas(); 00128 void _switchView(); 00129 void _switchViewMode(); 00130 void _switchModel(); 00131 void _freezeLoadBalancing( const bool onOff ); 00132 void _adjustEyeBase( const float delta ); 00133 void _adjustTileSize( const int delta ); 00134 void _adjustModelScale( const float factor ); 00135 void _switchLayout( int32_t increment ); 00136 void _toggleEqualizer(); 00137 00138 void _setHeadMatrix( const eq::Matrix4f& matrix ); 00139 const eq::Matrix4f& _getHeadMatrix() const; 00140 void _changeFocusDistance( const float delta ); 00141 void _setFocusMode( const eq::FocusMode mode ); 00142 00144 eq::admin::ServerPtr _getAdminServer(); 00145 void _closeAdminServer(); 00146 00147 View* _getCurrentView(); 00148 const View* _getCurrentView() const; 00149 00150 void _setMessage( const std::string& message ); 00151 void _updateData(); 00152 }; 00153 } 00154 00155 #endif // EQ_PLY_CONFIG_H