Equalizer  1.2.1
share/Equalizer/examples/eqPly/config.h
00001 
00002 /* Copyright (c) 2006-2011, 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 #include <eq/eq.h>
00034 #include <eq/admin/base.h>
00035 
00036 // members
00037 #include "localInitData.h"
00038 #include "frameData.h"
00039 #include "tracker.h"
00040 #include "cameraAnimation.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 mapData( const eq::uint128_t& initDataID );
00071 
00073         void unmapData();
00074 
00076         const Model* getModel( const eq::uint128_t& id );
00077 
00079         virtual bool handleEvent( const eq::ConfigEvent* event );
00080 
00082         bool isIdleAA();
00083 
00085         bool needRedraw();
00086 
00088         uint32_t getAnimationFrame();
00089 
00090     protected:
00091         virtual ~Config();
00092 
00094         virtual co::uint128_t sync( 
00095                              const co::uint128_t& version = co::VERSION_HEAD );
00096 
00097     private:
00098         int         _spinX, _spinY;
00099         int         _advance;
00100         eq::Canvas* _currentCanvas;
00101 
00102         LocalInitData _initData;
00103         FrameData     _frameData;
00104 
00105         Tracker _tracker;
00106 
00107         Models     _models;
00108         ModelDists _modelDist;
00109         co::base::Lock  _modelLock;
00110 
00111         CameraAnimation _animation;
00112 
00113         uint64_t _messageTime;
00114 
00115         bool _redraw;
00116         bool _useIdleAA;
00117 
00118         int32_t _numFramesAA;
00119 
00120         eq::admin::ServerPtr _admin;
00121 
00122         void _loadModels();
00123         void _registerModels();
00124         void _loadPath();
00125         void _deregisterData();
00126 
00127         bool _needNewFrame();
00128         bool _handleKeyEvent( const eq::KeyEvent& event );
00129 
00130         void _switchCanvas();
00131         void _switchView();
00132         void _switchViewMode();
00133         void _switchModel();
00134         void _freezeLoadBalancing( const bool onOff );
00135         void _adjustTileSize( const int delta );
00136         void _switchLayout( int32_t increment );
00137         void _toggleEqualizer();
00138 
00139         void _setHeadMatrix( const eq::Matrix4f& matrix );
00140         const eq::Matrix4f& _getHeadMatrix() const;
00141         void _changeFocusDistance( const float delta );
00142         void _setFocusMode( const eq::FocusMode mode );
00143 
00145         eq::admin::ServerPtr _getAdminServer();
00146         void _closeAdminServer();
00147 
00148         View* _getCurrentView();
00149         const View* _getCurrentView() const;
00150 
00151         void _setMessage( const std::string& message );
00152         void _updateData();
00153     };
00154 }
00155 
00156 #endif // EQ_PLY_CONFIG_H
Generated on Fri Jun 8 2012 15:44:29 for Equalizer 1.2.1 by  doxygen 1.8.0