2 #ifndef GRAMODS_GRAPHICS_EYE
3 #define GRAMODS_GRAPHICS_EYE
5 #include <gmGraphics/config.hh>
11 BEGIN_NAMESPACE_GMGRAPHICS;
41 ss <<
"Eye index " << idx <<
" is larger or equal to count " << count <<
".";
42 throw std::out_of_range(ss.str());
48 bool valid() {
return idx < count; }
55 return count < e2.
count || (count == e2.
count && idx < e2.
idx);
62 return count == e2.
count && idx == e2.
idx;
81 END_NAMESPACE_GMGRAPHICS;
83 BEGIN_NAMESPACE_GRAMODS;
91 END_NAMESPACE_GRAMODS;
An indexed eye that can be rendered.
Definition: Eye.hh:20
size_t idx
The index of the specific eye, starting at zero (0).
Definition: Eye.hh:25
static const Eye LEFT
Pre-defined left Eye for stereoscopic rendering.
Definition: Eye.hh:73
bool valid()
Returns true iff idx is smaller than count.
Definition: Eye.hh:48
size_t count
The total count of eyes of which the specified eye is one.
Definition: Eye.hh:30
void validate()
Check if the internal states are valid and throw exception if idx is not smaller than count.
Definition: Eye.hh:37
static const Eye RIGHT
Pre-defined right Eye for stereoscopic rendering.
Definition: Eye.hh:78
static const Eye MONO
Pre-defined Eye for monoscopic rendering.
Definition: Eye.hh:68
bool operator==(const gramods::gmGraphics::Eye &e2) const
Equals operator, returns true if this is identical to the other.
Definition: Eye.hh:61
bool operator<(const gramods::gmGraphics::Eye &e2) const
Less than operator, returns true if this has lower count or lower idx than the other.
Definition: Eye.hh:54