bounding_box_drawable.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef BOUNDING_BOX_DRAWABLE_H_
29 #define BOUNDING_BOX_DRAWABLE_H_
30 
31 #include "tango-gl/line.h"
32 
34 {
35 public:
37  Line(3.0f, GL_LINES)
38  {
39  vec_vertices_.resize(24);
40  }
41 
42  void updateVertices(const pcl::PointXYZ & min, const pcl::PointXYZ & max)
43  {
44  int index = 0;
45  vec_vertices_[index].x = min.x;
46  vec_vertices_[index].y = min.y;
47  vec_vertices_[index++].z = min.z;
48  vec_vertices_[index].x = min.x;
49  vec_vertices_[index].y = max.y;
50  vec_vertices_[index++].z = min.z;
51 
52  vec_vertices_[index].x = min.x;
53  vec_vertices_[index].y = min.y;
54  vec_vertices_[index++].z = min.z;
55  vec_vertices_[index].x = max.x;
56  vec_vertices_[index].y = min.y;
57  vec_vertices_[index++].z = min.z;
58 
59  vec_vertices_[index].x = min.x;
60  vec_vertices_[index].y = min.y;
61  vec_vertices_[index++].z = min.z;
62  vec_vertices_[index].x = min.x;
63  vec_vertices_[index].y = min.y;
64  vec_vertices_[index++].z = max.z;
65 
66  vec_vertices_[index].x = max.x;
67  vec_vertices_[index].y = max.y;
68  vec_vertices_[index++].z = max.z;
69  vec_vertices_[index].x = max.x;
70  vec_vertices_[index].y = min.y;
71  vec_vertices_[index++].z = max.z;
72 
73  vec_vertices_[index].x = max.x;
74  vec_vertices_[index].y = max.y;
75  vec_vertices_[index++].z = max.z;
76  vec_vertices_[index].x = min.x;
77  vec_vertices_[index].y = max.y;
78  vec_vertices_[index++].z = max.z;
79 
80  vec_vertices_[index].x = max.x;
81  vec_vertices_[index].y = max.y;
82  vec_vertices_[index++].z = max.z;
83  vec_vertices_[index].x = max.x;
84  vec_vertices_[index].y = max.y;
85  vec_vertices_[index++].z = min.z;
86 
87  vec_vertices_[index].x = max.x;
88  vec_vertices_[index].y = min.y;
89  vec_vertices_[index++].z = min.z;
90  vec_vertices_[index].x = max.x;
91  vec_vertices_[index].y = min.y;
92  vec_vertices_[index++].z = max.z;
93 
94  vec_vertices_[index].x = max.x;
95  vec_vertices_[index].y = min.y;
96  vec_vertices_[index++].z = min.z;
97  vec_vertices_[index].x = max.x;
98  vec_vertices_[index].y = max.y;
99  vec_vertices_[index++].z = min.z;
100 
101  vec_vertices_[index].x = min.x;
102  vec_vertices_[index].y = max.y;
103  vec_vertices_[index++].z = min.z;
104  vec_vertices_[index].x = max.x;
105  vec_vertices_[index].y = max.y;
106  vec_vertices_[index++].z = min.z;
107 
108  vec_vertices_[index].x = min.x;
109  vec_vertices_[index].y = max.y;
110  vec_vertices_[index++].z = min.z;
111  vec_vertices_[index].x = min.x;
112  vec_vertices_[index].y = max.y;
113  vec_vertices_[index++].z = max.z;
114 
115  vec_vertices_[index].x = min.x;
116  vec_vertices_[index].y = min.y;
117  vec_vertices_[index++].z = max.z;
118  vec_vertices_[index].x = max.x;
119  vec_vertices_[index].y = min.y;
120  vec_vertices_[index++].z = max.z;
121 
122  vec_vertices_[index].x = min.x;
123  vec_vertices_[index].y = min.y;
124  vec_vertices_[index++].z = max.z;
125  vec_vertices_[index].x = min.x;
126  vec_vertices_[index].y = max.y;
127  vec_vertices_[index++].z = max.z;
128  }
129 
130 };
131 #endif // TANGO_GL_LINE_H_
glm::min
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
BoundingBoxDrawable::updateVertices
void updateVertices(const pcl::PointXYZ &min, const pcl::PointXYZ &max)
Definition: bounding_box_drawable.h:42
tango_gl::Line
Definition: line.h:23
line.h
BoundingBoxDrawable
Definition: bounding_box_drawable.h:33
glm::max
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
BoundingBoxDrawable::BoundingBoxDrawable
BoundingBoxDrawable()
Definition: bounding_box_drawable.h:36
tango_gl::Line::Line
Line(float line_width, GLenum render_mode)
Definition: line.cpp:20
f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
tango_gl::Line::vec_vertices_
std::vector< glm::vec3 > vec_vertices_
Definition: line.h:34


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:06