server/canvas.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_CANVAS_H
00019 #define EQSERVER_CANVAS_H
00020 
00021 #include "types.h"
00022 #include "visitorResult.h"  // enum
00023 
00024 #include <eq/client/canvas.h>
00025 
00026 #include <eq/base/base.h>
00027 #include <string>
00028 
00029 namespace eq
00030 {
00031 namespace server
00032 {
00033     class CanvasVisitor;
00034     class ConstCanvasVisitor;
00035     struct CanvasPath;
00036     struct SegmentPath;
00037 
00041     class Canvas : public eq::Frustum
00042     {
00043     public:
00047         EQSERVER_EXPORT Canvas();
00048 
00050         Canvas( const Canvas& from, Config* config );
00051 
00053         virtual ~Canvas();
00054 
00059         Config* getConfig()             { return _config; }
00060         const Config* getConfig() const { return _config; }
00061 
00063         EQSERVER_EXPORT void addSegment( Segment* segment );
00064         
00066         const SegmentVector& getSegments() const { return _segments; }
00067 
00075         Segment* findSegment( const std::string& name );
00076 
00078         Segment* getSegment( const SegmentPath& path );
00079 
00081         void addLayout( Layout* layout );
00082 
00084         const LayoutVector& getLayouts() const { return _layouts; }
00085         
00087         CanvasPath getPath() const;
00089 
00094         void init();
00095         void exit();
00096 
00103         VisitorResult accept( CanvasVisitor& visitor );
00104         VisitorResult accept( ConstCanvasVisitor& visitor ) const;
00105 
00107         void unmap();
00109         
00110     protected:
00112         virtual void serialize( net::DataOStream& os, 
00113                                 const uint64_t dirtyBits );
00114 
00116         virtual void deserialize( net::DataIStream& is, 
00117                                   const uint64_t dirtyBits );
00118 
00119     private:
00120         virtual void getInstanceData( net::DataOStream& os );
00121 
00123         Config* _config;
00124         friend class Config;
00125 
00127         LayoutVector _layouts;
00128         
00130         uint32_t _activeLayout;
00131 
00133         SegmentVector _segments;
00134 
00135         union // placeholder for binary-compatible changes
00136         {
00137             char dummy[64];
00138         };
00139 
00141         void _useLayout( const uint32_t index );
00142         void _switchLayout( const uint32_t oldIndex, const uint32_t newIndex );
00143     };
00144 
00145     std::ostream& operator << ( std::ostream& os, const Canvas* canvas);
00146 }
00147 }
00148 #endif // EQSERVER_CANVAS_H
Generated on Mon Aug 10 18:58:31 2009 for Equalizer 0.9 by  doxygen 1.5.8