20 #ifndef EQFABRIC_VIEW_H
21 #define EQFABRIC_VIEW_H
23 #include <eq/fabric/api.h>
24 #include <eq/fabric/equalizer.h>
25 #include <eq/fabric/frustum.h>
26 #include <eq/fabric/object.h>
27 #include <eq/fabric/types.h>
28 #include <eq/fabric/viewport.h>
35 #define EQ_UNDEFINED_UNIT -1.f
42 template<
class L,
class V,
class O >
43 class View :
public Object,
public Frustum
83 EQFABRIC_INL
void setOverdraw(
const Vector2i& pixels );
89 EQFABRIC_INL
void useEqualizer( uint32_t equalizerMask );
101 EQFABRIC_INL
void setViewport(
const Viewport& viewport );
120 virtual void activateMode(
const Mode mode ){ _data.mode = mode; }
135 EQFABRIC_INL
bool setModelUnit(
const float modelUnit );
153 void setDisplayCluster(
const std::string& hostname );
160 const std::string& getDisplayCluster()
const;
173 EQFABRIC_INL VisitorResult
accept( LeafVisitor< V >& visitor );
176 EQFABRIC_INL VisitorResult
accept( LeafVisitor< V >& visitor )
const;
178 virtual EQFABRIC_INL
void backup();
179 virtual EQFABRIC_INL
void restore();
228 void setCapabilities(
const uint64_t bitmask );
229 virtual void updateCapabilities() {}
234 DIRTY_VIEWPORT = Object::DIRTY_CUSTOM << 0,
235 DIRTY_OBSERVER = Object::DIRTY_CUSTOM << 1,
236 DIRTY_OVERDRAW = Object::DIRTY_CUSTOM << 2,
237 DIRTY_FRUSTUM = Object::DIRTY_CUSTOM << 3,
238 DIRTY_MODE = Object::DIRTY_CUSTOM << 4,
239 DIRTY_MINCAPS = Object::DIRTY_CUSTOM << 5,
240 DIRTY_MAXCAPS = Object::DIRTY_CUSTOM << 6,
241 DIRTY_CAPABILITIES = Object::DIRTY_CUSTOM << 7,
242 DIRTY_EQUALIZER = Object::DIRTY_CUSTOM << 8,
243 DIRTY_EQUALIZERS = Object::DIRTY_CUSTOM << 9,
244 DIRTY_MODELUNIT = Object::DIRTY_CUSTOM << 10,
245 DIRTY_ATTRIBUTES = Object::DIRTY_CUSTOM << 11,
247 DIRTY_VIEWPORT | DIRTY_OBSERVER | DIRTY_OVERDRAW |
248 DIRTY_FRUSTUM | DIRTY_MODE | DIRTY_MINCAPS | DIRTY_MAXCAPS |
249 DIRTY_CAPABILITIES | DIRTY_OBJECT_BITS | DIRTY_EQUALIZER |
250 DIRTY_EQUALIZERS | DIRTY_MODELUNIT | DIRTY_ATTRIBUTES
256 SATTR_DISPLAYCLUSTER,
257 SATTR_PIXELSTREAM_NAME,
259 SATTR_ALL = SATTR_LAST + 5
272 EQFABRIC_INL
View( L* layout );
275 EQFABRIC_INL
virtual ~
View();
292 EQFABRIC_INL
virtual void serialize( co::DataOStream& os,
293 const uint64_t dirtyBits );
296 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
297 const uint64_t dirtyBits );
300 EQFABRIC_INL
virtual void setDirty(
const uint64_t bits );
303 void setSAttribute(
const SAttribute attr,
const std::string& value )
304 { _sAttributes[attr] = value; setDirty( DIRTY_ATTRIBUTES ); }
307 virtual uint64_t getRedistributableBits()
const
308 {
return DIRTY_VIEW_BITS; }
311 virtual void notifyFrustumChanged() { setDirty( DIRTY_FRUSTUM ); }
320 Equalizer _equalizer;
324 uint64_t _minimumCapabilities;
325 uint64_t _maximumCapabilities;
326 uint64_t _capabilities;
327 uint32_t _equalizers;
342 std::string _sAttributes[SATTR_ALL];
348 template<
class L,
class V,
class O >
349 EQFABRIC_INL std::ostream& operator << ( std::ostream& os,
350 const View< L, V, O >& view );
353 #endif // EQFABRIC_VIEW_H
Render in stereo (left & right eye)
EQFABRIC_INL float getModelUnit() const
Get the model unit of this view.
A fractional viewport with methods for manipulation.
EQFABRIC_INL const Viewport & getViewport() const
SAttribute
String attributes.
virtual EQFABRIC_INL void changeMode(const Mode mode)
Set the mode of this view.
EQFABRIC_INL void useEqualizer(uint32_t equalizerMask)
virtual EQFABRIC_INL uint32_t getUserDataLatency() const
The view user data instance uses the config latency by default.
EQFABRIC_INL uint64_t getMaximumCapabilities() const
EQFABRIC_INL uint64_t getMinimumCapabilities() const
EQFABRIC_INL const Equalizer & getEqualizer() const
uint32_t getEqualizers() const
EQFABRIC_INL void setObserver(O *observer)
Set the entity tracking this view.
Base data transport class for views.
EQFABRIC_INL uint64_t getCapabilities() const
EQFABRIC_INL void setOverdraw(const Vector2i &pixels)
Mode
The current rendering mode.
virtual bool hasMasterUserData()
The application view instance holds the user data master by default.
static EQFABRIC_INL const std::string & getSAttributeString(const SAttribute attr)
EQFABRIC_INL VisitorResult accept(LeafVisitor< V > &visitor)
Traverse this view using a view visitor.
EQFABRIC_INL void setMinimumCapabilities(const uint64_t bitmask)
Set the minimum required capabilities for this view.
EQFABRIC_INL bool setModelUnit(const float modelUnit)
Set the model unit of this view.
EQFABRIC_INL const std::string & getSAttribute(const SAttribute attr) const
EQFABRIC_INL void setMaximumCapabilities(const uint64_t bitmask)
Set the maximum desired capabilities for this view.
const L * getLayout() const
const O * getObserver() const
const version of getObserver().
EQFABRIC_INL bool isActive() const
const Vector2i & getOverdraw() const
Render in mono (cyclop eye)
Base data transport class for equalizers.