18 #ifndef EQFABRIC_CANVAS_H
19 #define EQFABRIC_CANVAS_H
21 #include <eq/fabric/types.h>
22 #include <eq/fabric/frustum.h>
23 #include <eq/fabric/object.h>
24 #include <eq/fabric/swapBarrier.h>
33 template<
class CFG,
class C,
class S,
class L >
52 CanvasPath getPath()
const;
64 S* findSegment(
const std::string& name );
67 const S* findSegment(
const std::string& name )
const;
73 EQFABRIC_INL
void addLayout( L* layout );
76 EQFABRIC_INL
bool removeLayout( L* layout );
86 EQFABRIC_INL
void setSwapBarrier( SwapBarrierPtr barrier );
89 SwapBarrierConstPtr getSwapBarrier()
const {
return _swapBarrier; }
92 SwapBarrierPtr getSwapBarrier() {
return _swapBarrier; }
95 EQFABRIC_INL
virtual void setWall(
const Wall& wall );
111 EQFABRIC_INL
virtual bool useLayout(
const uint32_t index );
120 EQFABRIC_INL VisitorResult
accept( Visitor& visitor );
123 EQFABRIC_INL VisitorResult
accept( Visitor& visitor )
const;
125 EQFABRIC_INL
virtual void backup();
126 EQFABRIC_INL
virtual void restore();
128 void create( S** segment );
129 void release( S* segment );
134 EQFABRIC_INL
explicit Canvas( CFG* config );
137 EQFABRIC_INL
virtual ~Canvas();
140 EQFABRIC_INL
virtual void attach(
const uint128_t&
id,
141 const uint32_t instanceID );
144 EQFABRIC_INL
void serialize( co::DataOStream& os,
145 const uint64_t dirtyBits );
147 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
148 const uint64_t dirtyBits );
150 EQFABRIC_INL
virtual void notifyDetach();
153 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits );
156 virtual void activateLayout(
const uint32_t index )
157 { _data.activeLayout = index; }
165 BackupData() : activeLayout( 0 ) {}
168 uint32_t activeLayout;
178 SwapBarrierPtr _swapBarrier;
185 DIRTY_LAYOUT = Object::DIRTY_CUSTOM << 0,
186 DIRTY_SEGMENTS = Object::DIRTY_CUSTOM << 1,
187 DIRTY_LAYOUTS = Object::DIRTY_CUSTOM << 2,
188 DIRTY_FRUSTUM = Object::DIRTY_CUSTOM << 3,
189 DIRTY_CANVAS_BITS = DIRTY_LAYOUT | DIRTY_SEGMENTS | DIRTY_LAYOUTS |
190 DIRTY_FRUSTUM | DIRTY_OBJECT_BITS
194 virtual uint64_t getRedistributableBits()
const
195 {
return DIRTY_CANVAS_BITS; }
197 template<
class,
class,
class >
friend class Segment;
199 void _addChild( S* segment );
200 bool _removeChild( S* segment );
203 EQFABRIC_INL
virtual uint128_t commit(
const uint32_t incarnation );
204 bool _mapViewObjects();
206 typedef co::CommandFunc< Canvas< CFG, C, S, L > > CmdFunc;
207 bool _cmdNewSegment( co::ICommand& command );
208 bool _cmdNewSegmentReply( co::ICommand& command );
211 template<
class CFG,
class C,
class S,
class L >
212 std::ostream& operator << ( std::ostream&, const Canvas< CFG, C, S, L >& );
215 #endif // EQFABRIC_CANVAS_H
std::vector< C * > Canvases
A vector of canvases.
virtual EQFABRIC_INL void setProjection(const Projection &)
ElementVisitor< C, LeafVisitor< S > > Visitor
A Canvas visitor.
EQFABRIC_INL void serialize(co::DataOStream &os, const uint64_t dirtyBits)
std::vector< L * > Layouts
A vector of layouts.
virtual EQFABRIC_INL void setDirty(const uint64_t bits)
const CFG * getConfig() const
EQFABRIC_INL VisitorResult accept(Visitor &visitor)
Traverse this canvas and all children using a canvas visitor.
uint32_t getActiveLayoutIndex() const
const Layouts & getLayouts() const
A visitor to traverse non-leaf elements and their children in a tree.
virtual EQFABRIC_INL void unsetFrustum()
virtual EQFABRIC_INL bool useLayout(const uint32_t index)
Activate the given layout on this canvas.
EQFABRIC_INL const L * getActiveLayout() const
std::vector< S * > Segments
A vector of segments.
EQFABRIC_INL Canvas(CFG *config)
Construct a new Canvas.
The Equalizer client library.
const Segments & getSegments() const
virtual EQFABRIC_INL void deserialize(co::DataIStream &is, const uint64_t dirtyBits)
virtual EQFABRIC_INL ~Canvas()
Destruct this canvas.
A canvas represents a logical 2D projection surface.
virtual EQFABRIC_INL void setWall(const Wall &wall)
Internal base class for all distributed, inheritable Equalizer objects.
EQFABRIC_API Object()
Construct a new Object.
A distributed object for frustum data.