server/segment.h

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 #ifndef EQSERVER_SEGMENT_H
00019 #define EQSERVER_SEGMENT_H
00020 
00021 #include "paths.h"
00022 #include "types.h"
00023 #include "segmentVisitor.h"  // used in inline method
00024 
00025 #include <eq/client/segment.h>      // base class
00026 #include <eq/client/viewport.h>     // member
00027 
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032     class Canvas;
00033 
00037     class Segment : public eq::Segment
00038     {
00039     public:
00043         EQSERVER_EXPORT Segment();
00044 
00046         Segment( const Segment& from, Config* config );
00047 
00049         virtual ~Segment();
00050 
00056         Config* getConfig();
00057 
00059         const Config* getConfig() const;
00060 
00062         SegmentPath getPath() const;
00063 
00072         void setChannel( Channel* channel ) { _channel = channel; }
00073 
00075         Channel* getChannel()               { return _channel; }
00076         const Channel* getChannel() const   { return _channel; }
00077 
00079         Canvas* getCanvas()               { return _canvas; }
00080         const Canvas* getCanvas() const   { return _canvas; }
00081 
00091         EQSERVER_EXPORT void setViewport( const eq::Viewport& vp );
00092 
00094         const eq::Viewport& getViewport() const { return _vp; }
00095 
00097         void addDestinationChannel( Channel* channel );
00098 
00100         bool removeDestinationChannel( Channel* channel );
00101 
00104         const ChannelVector& getDestinationChannels() const 
00105             { return _destinationChannels; }
00107         
00116         VisitorResult accept( SegmentVisitor& visitor )
00117             { return visitor.visit( this ); }
00118         VisitorResult accept( ConstSegmentVisitor& visitor ) const
00119             { return visitor.visit( this ); }
00121 
00122     protected:
00123 
00124     private:
00125         virtual void getInstanceData( net::DataOStream& os );
00126 
00128         Canvas* _canvas;
00129         friend class Canvas;
00130 
00132         Channel* _channel;
00133 
00135         ChannelVector _destinationChannels;
00136 
00137         union // placeholder for binary-compatible changes
00138         {
00139             char dummy[64];
00140         };
00141 
00143         void _updateView();
00144     };
00145 
00146     std::ostream& operator << ( std::ostream& os, const Segment* segment);
00147 }
00148 }
00149 #endif // EQSERVER_SEGMENT_H
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8