eVolve/initData.cpp

00001 
00002 /*
00003  * Copyright (c) 2006-2008, Stefan Eilemann <eile@equalizergraphics.com> 
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License version 2.1 as published
00007  * by the Free Software Foundation.
00008  *  
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00012  * details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00017  
00018  *
00019  * The init data manages static, per-instance application data. In this example,
00020  * it holds the model file name, and manages the instantiation of the frame
00021  * data. The frame data is instantiated seperately for each (pipe) thread, so
00022  * that multiple pipe threads on a node can render different frames
00023  * concurrently.
00024  */
00025 
00026 #include "initData.h"
00027 
00028 using namespace eq::base;
00029 using namespace std;
00030 
00031 namespace eVolve
00032 {
00033 
00034 InitData::InitData()
00035         : _frameDataID(  EQ_UNDEFINED_UINT32 )
00036         , _windowSystem( eq::WINDOW_SYSTEM_NONE )
00037         , _precision( 2 )
00038         , _brightness( 1.0f )
00039         , _alpha( 1.0f )
00040 #ifdef WIN32_VC
00041         , _filename( "../examples/eVolve/Bucky32x32x32_d.raw" )
00042 #else
00043         , _filename( "../share/data/Bucky32x32x32_d.raw" )
00044 #endif
00045 {}
00046 
00047 InitData::~InitData()
00048 {
00049     setFrameDataID( EQ_ID_INVALID );
00050 }
00051 
00052 void InitData::getInstanceData( eq::net::DataOStream& os )
00053 {
00054     os << _frameDataID << _windowSystem << _precision << _brightness << _alpha
00055        << _filename;
00056 }
00057 
00058 void InitData::applyInstanceData( eq::net::DataIStream& is )
00059 {
00060     is >> _frameDataID >> _windowSystem >> _precision >> _brightness >> _alpha
00061        >> _filename;
00062 
00063     EQASSERT( _frameDataID != EQ_ID_INVALID );
00064     EQINFO << "New InitData instance" << endl;
00065 }
00066 }
Generated on Mon Aug 10 18:58:39 2009 for Equalizer 0.9 by  doxygen 1.5.8