18 #ifndef EQFABRIC_CANVAS_H 19 #define EQFABRIC_CANVAS_H 21 #include <eq/fabric/frustum.h> 22 #include <eq/fabric/object.h> 23 #include <eq/fabric/swapBarrier.h> 24 #include <eq/fabric/types.h> 33 template <
class CFG,
class C,
class S,
class L>
51 CanvasPath getPath()
const;
64 S* findSegment(
const std::string& name);
67 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; }
90 SwapBarrierPtr getSwapBarrier() {
return _swapBarrier; }
92 EQFABRIC_INL
virtual void setWall(
const Wall& wall);
108 EQFABRIC_INL
virtual bool useLayout(
const uint32_t index);
117 EQFABRIC_INL VisitorResult
accept(Visitor& visitor);
120 EQFABRIC_INL VisitorResult
accept(Visitor& visitor)
const;
122 EQFABRIC_INL
virtual void backup();
123 EQFABRIC_INL
virtual void restore();
125 void create(S** segment);
126 void release(S* segment);
131 EQFABRIC_INL
explicit Canvas(CFG* config);
134 EQFABRIC_INL
virtual ~Canvas();
137 EQFABRIC_INL
virtual void attach(
const uint128_t&
id,
138 const uint32_t instanceID);
141 EQFABRIC_INL
void serialize(co::DataOStream& os,
const uint64_t dirtyBits);
143 EQFABRIC_INL
virtual void deserialize(co::DataIStream& is,
144 const uint64_t dirtyBits);
146 EQFABRIC_INL
virtual void notifyDetach();
149 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits);
152 virtual void activateLayout(
const uint32_t index)
154 _data.activeLayout = index;
169 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 196 return DIRTY_CANVAS_BITS;
199 template <
class,
class,
class>
202 void _addChild(S* segment);
203 bool _removeChild(S* segment);
206 EQFABRIC_INL
virtual uint128_t commit(
const uint32_t incarnation);
207 bool _mapViewObjects();
209 typedef co::CommandFunc<Canvas<CFG, C, S, L>> CmdFunc;
210 bool _cmdNewSegment(co::ICommand& command);
211 bool _cmdNewSegmentReply(co::ICommand& command);
214 template <
class CFG,
class C,
class S,
class L>
215 std::ostream& operator<<(std::ostream&, const Canvas<CFG, C, S, L>&);
218 #endif // EQFABRIC_CANVAS_H virtual EQFABRIC_INL void setProjection(const Projection &)
EQFABRIC_INL void serialize(co::DataOStream &os, const uint64_t dirtyBits)
virtual EQFABRIC_INL void setDirty(const uint64_t bits)
const CFG * getConfig() const
std::vector< S * > Segments
A vector of segments.
EQFABRIC_INL VisitorResult accept(Visitor &visitor)
Traverse this canvas and all children using a canvas visitor.
A wall defining a view frustum.
std::vector< C * > Canvases
A vector of canvases.
uint32_t getActiveLayoutIndex() const
const Layouts & getLayouts() const
DirtyBits
The changed parts of the object since the last pack().
A visitor to traverse non-leaf elements and their children in a tree.
A projector definition defining a view frustum.
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
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.
Base data transport class for segments.
virtual EQFABRIC_INL void setWall(const Wall &wall)
Internal base class for all distributed, inheritable Equalizer objects.
std::vector< L * > Layouts
A vector of layouts.
ElementVisitor< C, LeafVisitor< S > > Visitor
A Canvas visitor.
A distributed object for frustum data.