lib/client/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 EQ_SEGMENT_H
00019 #define EQ_SEGMENT_H
00020 
00021 #include <eq/client/frustum.h>        // base class
00022 #include <eq/client/types.h>
00023 #include <eq/client/viewport.h>       // member
00024 #include <eq/client/visitorResult.h>  // enum
00025 
00026 namespace eq
00027 {
00028 namespace server
00029 {
00030     class Segment;
00031 }
00032 
00033     class Canvas;
00034     class SegmentVisitor;
00035 
00040     class Segment : public eq::Frustum
00041     {
00042     public:
00046         EQ_EXPORT Segment();
00047 
00049         EQ_EXPORT virtual ~Segment();
00050 
00056         EQ_EXPORT Config* getConfig();
00057 
00059         EQ_EXPORT const Config* getConfig() const;
00060 
00062         const eq::Viewport& getViewport() const { return _vp; }
00064         
00073         EQ_EXPORT VisitorResult accept( SegmentVisitor& visitor );
00075 
00076     protected:
00078         EQ_EXPORT virtual void serialize( net::DataOStream& os, 
00079                                           const uint64_t dirtyBits );
00081         EQ_EXPORT virtual void deserialize( net::DataIStream& is, 
00082                                             const uint64_t dirtyBits );
00083 
00084         enum DirtyBits
00085         {
00086             DIRTY_VIEWPORT   = Frustum::DIRTY_CUSTOM << 0,
00087             DIRTY_FILL1      = Frustum::DIRTY_CUSTOM << 1,
00088             DIRTY_FILL2      = Frustum::DIRTY_CUSTOM << 2,
00089             DIRTY_CUSTOM     = Frustum::DIRTY_CUSTOM << 3
00090         };
00091 
00092     private:
00094         Canvas* _canvas;
00095         friend class Canvas;
00096 
00098         eq::Viewport _vp;
00099         friend class server::Segment;
00100 
00101         union // placeholder for binary-compatible changes
00102         {
00103             char dummy[64];
00104         };
00105     };
00106 
00107 }
00108 #endif // EQ_SEGMENT_H
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8