lib/client/segment.cpp

00001 
00002 /* Copyright (c) 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 #include "segment.h"
00019 
00020 #include "canvas.h"
00021 #include "config.h"
00022 #include "segmentVisitor.h"
00023 
00024 #include <eq/net/dataIStream.h>
00025 #include <eq/net/dataOStream.h>
00026 
00027 using namespace eq::base;
00028 
00029 namespace eq
00030 {
00031 
00032 Segment::Segment()
00033         : _canvas( 0 )
00034 {
00035 }
00036 
00037 Segment::~Segment()
00038 {
00039     EQASSERT( _canvas == 0 );
00040 }
00041 
00042 void Segment::serialize( net::DataOStream& os, const uint64_t dirtyBits )
00043 {
00044     Frustum::serialize( os, dirtyBits );
00045 
00046     if( dirtyBits & DIRTY_VIEWPORT )
00047         os << _vp;
00048 }
00049 
00050 void Segment::deserialize( net::DataIStream& is, const uint64_t dirtyBits )
00051 {
00052     Frustum::deserialize( is, dirtyBits );
00053 
00054     if( dirtyBits & DIRTY_VIEWPORT )
00055         is >> _vp;
00056 }
00057 
00058 Config* Segment::getConfig()
00059 {
00060     EQASSERT( _canvas );
00061     return _canvas ? _canvas->getConfig() : 0;
00062 }
00063 
00064 const Config* Segment::getConfig() const
00065 {
00066     EQASSERT( _canvas );
00067     return _canvas ? _canvas->getConfig() : 0;
00068 }
00069 
00070 VisitorResult Segment::accept( SegmentVisitor& visitor )
00071 {
00072     return visitor.visit( this );
00073 }
00074 
00075 }
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8