examples/eqPly/channel.h

00001 
00002 /* Copyright (c) 2006-2010, 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_CHANNEL_H
00019 #define EQ_PLY_CHANNEL_H
00020 
00021 #include "eqPly.h"
00022 
00023 #include "typedefs.h"
00024 
00025 #include <eq/eq.h>
00026 
00027 
00028 namespace eqPly
00029 {
00030     class FrameData;
00031     class InitData;
00032 
00033     static const uint32_t primeNumberTable[100] = {
00034                     739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
00035                     811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
00036                     877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
00037                     947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013,
00038                     1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069,
00039                     1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
00040                     1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
00041                     1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291,
00042                     1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373,
00043                     1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451
00044                     };
00045 
00049     class Channel : public eq::Channel
00050     {
00051     public:
00052         Channel( eq::Window* parent );
00053 
00054     protected:
00055         virtual ~Channel() {}
00056 
00057         virtual bool configInit( const uint32_t initID );
00058         virtual bool configExit();
00059         virtual void frameClear( const uint32_t frameID );
00060         virtual void frameDraw( const uint32_t frameID );
00061         virtual void frameAssemble( const uint32_t frameID );
00062         virtual void frameReadback( const uint32_t frameID );
00063         virtual void frameStart( const uint32_t frameID,
00064                                  const uint32_t frameNumber );
00065         virtual void frameFinish( const uint32_t frameID,
00066                                   const uint32_t frameNumber );
00067         virtual void frameViewStart( const uint32_t frameID );
00068         virtual void frameViewFinish( const uint32_t frameID );
00069 
00071         virtual void applyFrustum() const;
00072 
00073     private:
00074         void _drawModel( const Model* model );
00075         void _drawOverlay();
00076         void _drawHelp();
00077         void _updateNearFar( const mesh::BoundingSphere& boundingSphere );
00078         void _initFrustum( eq::FrustumCullerf& frustum, 
00079                            const mesh::BoundingSphere& boundingSphere );
00080 
00081         bool _isDone() const;
00082 
00083         void _initJitter();
00084         bool _initAccum();
00085 
00087         eq::Vector2i _getJitterStep() const;
00088         eq::Vector2f _getJitter() const;
00089 
00090         const FrameData& _getFrameData() const;
00091         const Model*     _getModel();
00092 
00093         const Model* _model;
00094         uint32_t     _modelID;
00095 
00096         struct Accum
00097         {
00098             Accum() : buffer( 0 ), step( 0 ), stepsDone( 0 ), transfer( false )
00099                 {}
00100 
00101             eq::util::Accum* buffer;
00102             int32_t step;
00103             uint32_t stepsDone;
00104             bool transfer;
00105         }
00106             _accum[ eq::EYE_ALL ];
00107 
00108         eq::PixelViewport _currentPVP;
00109     };
00110 }
00111 
00112 
00113 
00114 #endif // EQ_PLY_CHANNEL_H
00115 
Generated on Sat Feb 6 12:59:45 2010 for Equalizer 0.9.1 by  doxygen 1.6.1