lib/client/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 EQ_CANVAS_H
00019 #define EQ_CANVAS_H
00020 
00021 #include <eq/client/frustum.h>        // base class
00022 #include <eq/client/types.h>
00023 #include <eq/client/visitorResult.h>  // enum
00024 
00025 #include <eq/net/object.h>
00026 #include <string>
00027 
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032     class Canvas;
00033 }
00034     class CanvasVisitor;
00035 
00056     class Canvas : public Frustum
00057     {
00058     public:
00060         EQ_EXPORT Canvas();
00061 
00063         EQ_EXPORT virtual ~Canvas();
00064 
00068         Config*       getConfig()       { return _config; }
00070         const Config* getConfig() const { return _config; }
00071 
00073         uint32_t getActiveLayoutIndex() const { return _activeLayout; }
00074 
00076         EQ_EXPORT const Layout* getActiveLayout() const;
00077 
00079         const SegmentVector& getSegments() const { return _segments; }        
00080 
00082         const LayoutVector& getLayouts() const { return _layouts; }        
00084 
00088         EQ_EXPORT virtual void useLayout( const uint32_t index );
00089 
00096         EQ_EXPORT VisitorResult accept( CanvasVisitor& visitor );
00097 
00099         EQ_EXPORT VisitorResult accept( CanvasVisitor& visitor ) const;
00100 
00102         bool hasDirtyLayout() const { return getDirty() & DIRTY_LAYOUT; }
00104 
00105     protected:
00107         EQ_EXPORT void serialize( net::DataOStream& os, 
00108                                   const uint64_t dirtyBits );
00109 
00111         EQ_EXPORT virtual void deserialize( net::DataIStream& is, 
00112                                             const uint64_t dirtyBits );
00113         enum DirtyBits
00114         {
00115             DIRTY_LAYOUT     = Frustum::DIRTY_CUSTOM << 0,
00116             DIRTY_CHILDREN   = Frustum::DIRTY_CUSTOM << 1,
00117             DIRTY_FILL1      = Frustum::DIRTY_CUSTOM << 2,
00118             DIRTY_FILL2      = Frustum::DIRTY_CUSTOM << 3,
00119             DIRTY_CUSTOM     = Frustum::DIRTY_CUSTOM << 4
00120         };
00121 
00122     private:
00124         Config* _config;
00125         friend class Config;
00126         friend class server::Canvas;
00127 
00129         uint32_t _activeLayout;
00130 
00132         LayoutVector _layouts;
00133 
00135         SegmentVector _segments;
00136 
00137         union // placeholder for binary-compatible changes
00138         {
00139             char dummy[64];
00140         };
00141 
00143         void _deregister();
00144     };
00145 }
00146 #endif // EQ_CANVAS_H
Generated on Sat Feb 6 12:59:43 2010 for Equalizer 0.9.1 by  doxygen 1.6.1