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 >
51 CanvasPath getPath()
const;
63 S* findSegment(
const std::string& name );
66 const S* findSegment(
const std::string& name )
const;
72 EQFABRIC_INL
void addLayout( L* layout );
75 EQFABRIC_INL
bool removeLayout( L* layout );
85 EQFABRIC_INL
void setSwapBarrier( SwapBarrierPtr barrier );
88 SwapBarrierConstPtr getSwapBarrier()
const {
return _swapBarrier; }
91 SwapBarrierPtr getSwapBarrier() {
return _swapBarrier; }
94 EQFABRIC_INL
virtual void setWall(
const Wall& wall );
110 EQFABRIC_INL
virtual bool useLayout(
const uint32_t index );
124 EQFABRIC_INL
virtual void backup();
125 EQFABRIC_INL
virtual void restore();
127 void create( S** segment );
128 void release( S* segment );
133 EQFABRIC_INL
Canvas( CFG* config );
136 EQFABRIC_INL
virtual ~Canvas();
139 EQFABRIC_INL
virtual void attach(
const uint128_t&
id,
140 const uint32_t instanceID );
143 EQFABRIC_INL
void serialize( co::DataOStream& os,
144 const uint64_t dirtyBits );
146 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
147 const uint64_t dirtyBits );
149 EQFABRIC_INL
virtual void notifyDetach();
152 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits );
155 virtual void activateLayout(
const uint32_t index )
156 { _data.activeLayout = index; }
164 BackupData() : activeLayout( 0 ) {}
167 uint32_t activeLayout;
177 SwapBarrierPtr _swapBarrier;
184 DIRTY_LAYOUT = Object::DIRTY_CUSTOM << 0,
185 DIRTY_SEGMENTS = Object::DIRTY_CUSTOM << 1,
186 DIRTY_LAYOUTS = Object::DIRTY_CUSTOM << 2,
187 DIRTY_FRUSTUM = Object::DIRTY_CUSTOM << 3,
188 DIRTY_CANVAS_BITS = DIRTY_LAYOUT | DIRTY_SEGMENTS | DIRTY_LAYOUTS |
189 DIRTY_FRUSTUM | DIRTY_OBJECT_BITS
193 virtual uint64_t getRedistributableBits()
const
194 {
return DIRTY_CANVAS_BITS; }
196 template<
class,
class,
class >
friend class Segment;
198 void _addChild( S* segment );
199 bool _removeChild( S* segment );
202 EQFABRIC_INL
virtual uint128_t commit(
const uint32_t incarnation );
203 bool _mapViewObjects();
205 typedef co::CommandFunc< Canvas< CFG, C, S, L > > CmdFunc;
206 bool _cmdNewSegment( co::ICommand& command );
207 bool _cmdNewSegmentReply( co::ICommand& command );
210 template<
class CFG,
class C,
class S,
class L >
211 std::ostream& operator << ( std::ostream&, const Canvas< CFG, C, S, L >& );
214 #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.
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.