examples/eqNBody/channel.h

00001 /*
00002  * Copyright (c) 2009, Philippe Robert <probert@eyescale.ch> 
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 EQNBODY_CHANNEL_H
00019 #define EQNBODY_CHANNEL_H
00020 
00021 #include <eq/eq.h>
00022 
00023 #include "configEvent.h"
00024 #include "controller.h"
00025 #include "dataProxy.h"
00026 #include "frameData.h"
00027 
00028 namespace eqNbody
00029 {
00030     class FrameData;
00031     class InitData;
00032 
00033     class Channel : public eq::Channel
00034     {
00035     public:
00036         Channel( eq::Window* parent ) : eq::Channel( parent ) {}
00037 
00038     protected:
00039         virtual ~Channel() {}
00040 
00041         virtual void frameClear( const uint32_t frameID );
00042         virtual void frameDraw( const uint32_t frameID );
00043         
00044     private:
00045         void _compute(const uint32_t frameID, const FrameData& fd);
00046         void _draw(const uint32_t frameID, const FrameData& fd);
00047         void _update();
00048 
00049         void _initLocalProxy();
00050         void _initCUDAController();
00051 
00052         void _initDataProxies(const FrameData& frameData);
00053         void _syncDataProxies(const FrameData& frameData);
00054         void _sendEvent(ConfigEvent::Type type, unsigned int version, unsigned int pid, const eq::Range& range);
00055         
00056         Controller      _controller;        
00057         DataProxy       _dataProxy[MAX_NGPUS];  
00058         unsigned int    _offset;
00059     };
00060 }
00061 
00062 
00063 
00064 #endif // EQ_PLY_CHANNEL_H
00065 
Generated on Mon Aug 10 18:58:31 2009 for Equalizer 0.9 by  doxygen 1.5.8