Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Attributes
omni::visual::BoundingBox Class Reference

Visualizer for draing a bounding box from bounds. More...

#include <BoundingBox.h>

Inheritance diagram for omni::visual::BoundingBox:
Inheritance graph
[legend]
Collaboration diagram for omni::visual::BoundingBox:
Collaboration graph
[legend]

Public Member Functions

 BoundingBox (omni::Box const &_box)
 
 ~BoundingBox ()
 
void draw () const
 Abstract method for visualing. More...
 
void update ()
 Update geometry. More...
 
- Public Member Functions inherited from omni::visual::Interface
virtual ~Interface ()
 

Static Public Member Functions

static void draw (omni::Box const &_box)
 

Private Attributes

omni::Box const & box_
 
VertexVBO vbo_
 

Additional Inherited Members

- Static Protected Member Functions inherited from omni::visual::Interface
static void vertex3 (QVector3D const &)
 glVertex3f from QVector3D More...
 
static void visualLine (QVector3D const &_from, QVector3D const &_to)
 Draws a line. More...
 
static void color (QColor _color, float _alpha=1.0)
 glColor4f from QColor More...
 

Detailed Description

Visualizer for draing a bounding box from bounds.

Constructor & Destructor Documentation

omni::visual::BoundingBox::BoundingBox ( omni::Box const &  _box)
27  :
28  box_(_box)
29  {
30  update();
31  }
omni::Box const & box_
Definition: BoundingBox.h:42
void update()
Update geometry.
Definition: BoundingBox.cpp:36
omni::visual::BoundingBox::~BoundingBox ( )
34  {}

Member Function Documentation

void omni::visual::BoundingBox::draw ( ) const
virtual

Abstract method for visualing.

Implements omni::visual::Interface.

134  {
135  draw(box_);
136  }
omni::Box const & box_
Definition: BoundingBox.h:42
void draw() const
Abstract method for visualing.
Definition: BoundingBox.cpp:133
void omni::visual::BoundingBox::draw ( omni::Box const &  _box)
static
40  {
41  float x = _box.min().x(), y = _box.min().y(), z = _box.min().z();
42  float xs = _box.max().x(), ys = _box.max().y(),
43  zs = _box.max().z();
44  GLuint _visualMode = GL_LINE_LOOP;
45 
46  glBegin(_visualMode);
47  {
48  // top side
49  glNormal3f(0.0, 1.0, 0.0);
50  glTexCoord2f(0, 0);
51  glVertex3f(x, ys, z);
52  glTexCoord2f(1, 0);
53  glVertex3f(xs, ys, z);
54  glTexCoord2f(1, 1);
55  glVertex3f(xs, ys, zs);
56  glTexCoord2f(0, 1);
57  glVertex3f(x, ys, zs);
58  }
59  glEnd();
60  glBegin(_visualMode);
61  {
62  // bottom side
63  glNormal3f(0.0, -1.0, 0.0);
64  glTexCoord2f(0, 0);
65  glVertex3f(x, y, z);
66  glTexCoord2f(1, 0);
67  glVertex3f(xs, y, z);
68  glTexCoord2f(1, 1);
69  glVertex3f(xs, y, zs);
70  glTexCoord2f(0, 1);
71  glVertex3f(x, y, zs);
72  }
73  glEnd();
74  glBegin(_visualMode);
75  {
76  // east side
77  glNormal3f(0.0, 0.0, -1.0);
78  glTexCoord2f(0, 0);
79  glVertex3f(x, y, z);
80  glTexCoord2f(1, 0);
81  glVertex3f(xs, y, z);
82  glTexCoord2f(1, 1);
83  glVertex3f(xs, ys, z);
84  glTexCoord2f(0, 1);
85  glVertex3f(x, ys, z);
86  }
87  glEnd();
88  glBegin(_visualMode);
89 
90  // west side
91  {
92  glNormal3f(0.0, 0.0, 1.0);
93  glTexCoord2f(0, 0);
94  glVertex3f(x, y, zs);
95  glTexCoord2f(1, 0);
96  glVertex3f(xs, y, zs);
97  glTexCoord2f(1, 1);
98  glVertex3f(xs, ys, zs);
99  glTexCoord2f(0, 1);
100  glVertex3f(x, ys, zs);
101  }
102  glEnd();
103  glBegin(_visualMode);
104  {
105  // north side
106  glNormal3f(-1.0, 0.0, 0.0);
107  glTexCoord2f(0, 0);
108  glVertex3f(x, y, z);
109  glTexCoord2f(1, 0);
110  glVertex3f(x, y, zs);
111  glTexCoord2f(1, 1);
112  glVertex3f(x, ys, zs);
113  glTexCoord2f(0, 1);
114  glVertex3f(x, ys, z);
115  }
116  glEnd();
117  glBegin(_visualMode);
118  {
119  // south side
120  glNormal3f(1.0, 0.0, 0.0);
121  glTexCoord2f(0, 0);
122  glVertex3f(xs, y, z);
123  glTexCoord2f(1, 0);
124  glVertex3f(xs, y, zs);
125  glTexCoord2f(1, 1);
126  glVertex3f(xs, ys, zs);
127  glTexCoord2f(0, 1);
128  glVertex3f(xs, ys, z);
129  }
130  glEnd();
131  }
void omni::visual::BoundingBox::update ( )
virtual

Update geometry.

Reimplemented from omni::visual::Interface.

37  {}

Field Documentation

omni::Box const& omni::visual::BoundingBox::box_
private
VertexVBO omni::visual::BoundingBox::vbo_
private

The documentation for this class was generated from the following files: