server/canvas.h

00001 
00002 /* Copyright (c) 2009-2010, 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     struct CanvasPath;
00035     struct SegmentPath;
00036 
00040     class Canvas : public eq::Frustum
00041     {
00042     public:
00046         EQSERVER_EXPORT Canvas();
00047 
00049         Canvas( const Canvas& from, Config* config );
00050 
00052         virtual ~Canvas();
00053 
00058         Config* getConfig()             { return _config; }
00059         const Config* getConfig() const { return _config; }
00060 
00062         EQSERVER_EXPORT void addSegment( Segment* segment );
00063         
00065         const SegmentVector& getSegments() const { return _segments; }
00066 
00074         Segment* findSegment( const std::string& name );
00075 
00077         Segment* getSegment( const SegmentPath& path );
00078 
00080         EQSERVER_EXPORT void addLayout( Layout* layout );
00081 
00083         const LayoutVector& getLayouts() const { return _layouts; }
00084         
00086         CanvasPath getPath() const;
00088 
00093         void init();
00094         void exit();
00095 
00102         VisitorResult accept( CanvasVisitor& visitor );
00103         VisitorResult accept( CanvasVisitor& visitor ) const;
00104 
00106         void unmap();
00108         
00109     protected:
00111         virtual void serialize( net::DataOStream& os, 
00112                                 const uint64_t dirtyBits );
00113 
00115         virtual void deserialize( net::DataIStream& is, 
00116                                   const uint64_t dirtyBits );
00117 
00118     private:
00119         virtual void getInstanceData( net::DataOStream& os );
00120 
00122         Config* _config;
00123         friend class Config;
00124 
00126         LayoutVector _layouts;
00127         
00129         uint32_t _activeLayout;
00130 
00132         SegmentVector _segments;
00133 
00134         union // placeholder for binary-compatible changes
00135         {
00136             char dummy[64];
00137         };
00138 
00140         void _useLayout( const uint32_t index );
00141         void _switchLayout( const uint32_t oldIndex, const uint32_t newIndex );
00142     };
00143 
00144     std::ostream& operator << ( std::ostream& os, const Canvas* canvas);
00145 }
00146 }
00147 #endif // EQSERVER_CANVAS_H
Generated on Sat Feb 6 12:59:43 2010 for Equalizer 0.9.1 by  doxygen 1.6.1