examples/eqPly/config.h

00001 
00002 /* Copyright (c) 2006-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQ_PLY_CONFIG_H
00019 #define EQ_PLY_CONFIG_H
00020 
00021 #include <eq/eq.h>
00022 
00023 // members
00024 #include "localInitData.h"
00025 #include "frameData.h"
00026 #include "tracker.h"
00027 #include "cameraAnimation.h"
00028 
00029 namespace eqPly
00030 {
00031     typedef std::vector< Model* >     ModelVector;
00032     typedef std::vector< ModelDist* > ModelDistVector;
00033 
00041     class Config : public eq::Config
00042     {
00043     public:
00044         Config( eq::base::RefPtr< eq::Server > parent );
00045 
00047         virtual bool init();
00049         virtual bool exit();
00050 
00052         virtual uint32_t startFrame();
00053 
00054         void setInitData( const LocalInitData& data ) { _initData = data; }
00055         const InitData& getInitData() const { return _initData; }
00056 
00058         void mapData( const uint32_t initDataID );
00059 
00061         void unmapData();
00062 
00064         const Model* getModel( const uint32_t id );
00065 
00067         virtual bool handleEvent( const eq::ConfigEvent* event );
00068 
00070         bool needsRedraw();
00071 
00072     protected:
00073         virtual ~Config();
00074 
00075         int         _spinX, _spinY;
00076         int         _advance;
00077         eq::Canvas* _currentCanvas;
00078 
00079         LocalInitData _initData;
00080         FrameData     _frameData;
00081 
00082         Tracker _tracker;
00083 
00084         ModelVector     _models;
00085         ModelDistVector _modelDist;
00086         eq::base::Lock  _modelLock;
00087 
00088         CameraAnimation _animation;
00089 
00090         uint64_t _messageTime;
00091 
00092         bool _redraw;
00093         bool _freeze;
00094 
00095     private:
00096         void _loadModels();
00097         void _loadPath();
00098         void _deregisterData();
00099         bool _handleKeyEvent( const eq::KeyEvent& event );
00100         void _setHeadMatrix( const eq::Matrix4f& matrix );
00101         const eq::Matrix4f& _getHeadMatrix() const;
00102         void _setMessage( const std::string& message );
00103     };
00104 }
00105 
00106 #endif // EQ_PLY_CONFIG_H
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8