19 #ifndef EQFABRIC_CHANNEL_H
20 #define EQFABRIC_CHANNEL_H
22 #include <eq/fabric/object.h>
23 #include <eq/fabric/paths.h>
24 #include <eq/fabric/renderContext.h>
25 #include <eq/fabric/types.h>
65 bool isDestination()
const
66 {
return _data.nativeContext.view.identifier != 0;}
69 void setViewVersion(
const co::ObjectVersion& view );
72 const co::ObjectVersion& getViewVersion()
const
73 {
return _data.nativeContext.view; }
76 void setPixelViewport(
const PixelViewport& pvp );
79 EQFABRIC_INL
void setViewport(
const Viewport& vp );
82 virtual void notifyViewportChanged();
86 {
return _data.nativeContext.pvp; }
102 EQFABRIC_INL
void setNearFar(
const float nearPlane,
103 const float farPlane);
139 void setOverdraw(
const Vector4i& overdraw );
140 const Vector2i& getMaxSize()
const {
return _maxSize; }
143 EQFABRIC_INL ChannelPath getPath()
const;
145 EQFABRIC_INL
virtual void backup();
146 EQFABRIC_INL
virtual void restore();
315 IATTR_ALL = IATTR_LAST + 5
325 virtual bool omitOutput()
const {
return false; }
326 virtual void output( std::ostream& )
const {}
330 EQFABRIC_INL
Channel( W* parent );
339 EQFABRIC_INL
virtual void serialize( co::DataOStream& os,
340 const uint64_t dirtyBits );
342 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
343 const uint64_t dirtyBits );
346 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits );
348 void setDrawable(
const uint32_t drawable );
353 void overrideContext( RenderContext& context ) { _context = &context; }
356 void resetRenderContext() { _context = &_data.nativeContext; }
359 const RenderContext& getContext()
const {
return *_context; }
362 const RenderContext& getNativeContext()
const
363 {
return _data.nativeContext; }
367 void setIAttribute(
const IAttribute attr,
const int32_t value )
368 { _iAttributes[attr] = value; setDirty( DIRTY_ATTRIBUTES ); }
371 virtual ChangeType getChangeType()
const {
return UNBUFFERED; }
375 DIRTY_ATTRIBUTES = Object::DIRTY_CUSTOM << 0,
376 DIRTY_VIEWPORT = Object::DIRTY_CUSTOM << 1,
377 DIRTY_MEMBER = Object::DIRTY_CUSTOM << 2,
378 DIRTY_FRUSTUM = Object::DIRTY_CUSTOM << 3,
379 DIRTY_CAPABILITIES = Object::DIRTY_CUSTOM << 4,
381 DIRTY_ATTRIBUTES | DIRTY_VIEWPORT | DIRTY_MEMBER |
382 DIRTY_FRUSTUM | DIRTY_OBJECT_BITS
386 virtual uint64_t getRedistributableBits()
const
387 {
return DIRTY_CHANNEL_BITS; }
389 virtual void updateCapabilities() {};
397 BackupData() : capabilities( LB_BIT_ALL_64 ), fixedVP( true ) {}
400 RenderContext nativeContext;
403 uint64_t capabilities;
411 RenderContext* _context;
414 int32_t _iAttributes[IATTR_ALL];
426 template<
class W,
class C > EQFABRIC_INL
427 std::ostream& operator << ( std::ostream&, const Channel< W, C >& );
431 #endif // EQFABRIC_CHANNEL_H
Internal base class for all distributed, inheritable Equalizer objects.
IAttribute
Possible values for integer attributes.
virtual EQFABRIC_INL ~Channel()
Destruct the channel.
A fractional database range with methods for manipulation.
W Parent
The parent window type.
Use an FBO for color values.
EQFABRIC_INL void setCapabilities(const uint64_t bitmask)
Set the capabilities supported by the channel.
Base data transport class for channels.
Viewport vp
fractional viewport wrt dest view
LeafVisitor< C > Visitor
The channel visitor type.
uint32_t getDrawBuffer() const
Use an FBO for depth values.
uint32_t getPhase() const
EQFABRIC_INL void setMaxSize(const Vector2i &size)
const Viewport & getViewport() const
vmml::vector< 4, int > Vector4i
A four-component integer vector.
Vector2i offset
absolute position wrt dest channel
const W * getWindow() const
Holds a pixel decomposition specification with methods for manipulation.
const Matrix4f & getOrthoTransform() const
Return the orthographic view matrix.
const Frustumf & getPerspective() const
SubPixel subpixel
subpixel decomposition wrt to dest
uint32_t getDrawable() const
const Vector2i & getPixelOffset() const
Get the channel's current position wrt the destination channel.
Range range
database-range wrt to dest channel
Use the window's frame buffer.
Eye
Eye pass bit mask for which is enabled.
Holds a subpixel decomposition specification along with some methods for manipulation.
ColorMask bufferMask
color mask for anaglyph stereo
uint32_t phase
DPlex phase.
const Matrix4f & getHeadTransform() const
Return the view matrix.
Use a send token for output frames (OFF, ON)
const PixelViewport & getNativePixelViewport() const
uint32_t getReadBuffer() const
const Range & getRange() const
uint32_t period
DPlex period.
virtual bool useOrtho() const
Select perspective or orthographic rendering.
EQFABRIC_INL VisitorResult accept(Visitor &visitor)
Perform a depth-first traversal of this channel.
const Matrix4f & getPerspectiveTransform() const
Return the perspective view matrix.
const Zoom & getZoom() const
const ColorMask & getDrawBufferMask() const
const SubPixel & getSubPixel() const
EQFABRIC_INL uint64_t getCapabilities() const
Holds a 2D pixel viewport with methods for manipulation.
uint32_t getTaskID() const
IAttribute
Integer attributes for a channel.
vmml::matrix< 4, 4, float > Matrix4f
A 4x4 float matrix.
PixelViewport pvp
pixel viewport of channel wrt window
Matrix4f headTransform
frustum transform for modelview
Frustumf frustum
frustum for projection matrix
bool hasFixedViewport() const
EQFABRIC_INL void setNearFar(const float nearPlane, const float farPlane)
Set the near and far planes for this channel.
EQFABRIC_INL Channel(W *parent)
Construct a new channel.
Defines which parts of the color buffer are to be written.
uint32_t getPeriod() const
Pixel pixel
pixel decomposition wrt to dest
A zoom specification with methods for manipulation.
Zoom zoom
up/downsampling wrt to dest
const PixelViewport & getPixelViewport() const
static EQFABRIC_INL const std::string & getIAttributeString(const IAttribute attr)
vmml::frustum< float > Frustumf
A frustum definition.
Frustumf ortho
ortho frustum for projection matrix
Matrix4f orthoTransform
orthographic frustum transform
A fractional viewport with methods for manipulation.
A visitor to traverse leaf nodes of a graph.
Drawable
The drawable format defines the components used as an alternate drawable for this channel...
const Frustumf & getFrustum() const
const Frustumf & getOrtho() const
const Vector4i & getOverdraw() const
const Pixel & getPixel() const
Statistics gathering mode (OFF, FASTEST [ON], NICEST)
EQFABRIC_INL int32_t getIAttribute(const IAttribute attr) const
uint32_t buffer
buffer as passed to glDrawBuffer()
Use an FBO for stencil values.
vmml::vector< 2, int > Vector2i
A two-component integer vector.