Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CoordFrameNode.hh
1 /*===========================================================================*\
2  * *
3  * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39  * *
40 \*===========================================================================*/
41 
42 /*===========================================================================*\
43  * *
44  * $Revision$ *
45  * $Author$ *
46  * $Date$ *
47  * *
48 \*===========================================================================*/
49 
50 
51 
52 
53 //=============================================================================
54 //
55 // CLASS CoordFrameNode
56 //
57 //=============================================================================
58 
59 
60 #ifndef ACG_COORDFRAMENODE_HH
61 #define ACG_COORDFRAMENODE_HH
62 
63 
64 //== INCLUDES =================================================================
65 
66 
67 #include "MaterialNode.hh"
68 #include <vector>
69 
70 
71 //== NAMESPACES ===============================================================
72 
73 
74 namespace ACG {
75 namespace SceneGraph {
76 
77 
78 //== CLASS DEFINITION =========================================================
79 
80 
81 
88 class ACGDLLEXPORT CoordFrameNode : public MaterialNode
89 {
90 public:
91 
93  CoordFrameNode(BaseNode* _parent=0,
94  const std::string& _name="<CoordFrameNode>" );
95 
98 
99 
101  ACG_CLASSNAME(CoordFrameNode);
103  DrawModes::DrawMode availableDrawModes() const;
105  void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
107  void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
108 
109 
111  void update_bounding_box();
113  void set_bounding_box(const Vec3f& _bb_min, const Vec3f& _bb_max);
115  const Vec3d& bb_min() const { return bb_min_; }
117  const Vec3d& bb_max() const { return bb_max_; }
118 
119 
121  const std::vector<float>& x_planes() const { return x_planes_; }
123  const std::vector<float>& y_planes() const { return y_planes_; }
125  const std::vector<float>& z_planes() const { return z_planes_; }
126 
127 
129  void set_x_planes(const std::vector<float>& _planes) { x_planes_ = _planes; }
131  void set_y_planes(const std::vector<float>& _planes) { y_planes_ = _planes; }
133  void set_z_planes(const std::vector<float>& _planes) { z_planes_ = _planes; }
134 
135 
137  void add_x_plane(float _x) { x_planes_.push_back(_x); }
139  void add_y_plane(float _y) { y_planes_.push_back(_y); }
141  void add_z_plane(float _z) { z_planes_.push_back(_z); }
142 
143 
145  void del_x_plane(float _x) {
146  x_planes_.erase(std::find(x_planes_.begin(), x_planes_.end(), _x));
147  }
149  void del_y_plane(float _y) {
150  y_planes_.erase(std::find(y_planes_.begin(), y_planes_.end(), _y));
151  }
153  void del_z_plane(float _z) {
154  z_planes_.erase(std::find(z_planes_.begin(), z_planes_.end(), _z));
155  }
156 
157 
158 
159 
160 
161 private:
162 
164  CoordFrameNode(const CoordFrameNode& _rhs);
166  CoordFrameNode& operator=(const CoordFrameNode& _rhs);
167 
168 
169  // extend of bounding box
170  Vec3d bb_min_, bb_max_;
171 
172  // planes in x-, y-, z-direction
173  std::vector<float> x_planes_, y_planes_, z_planes_;
174 };
175 
176 
177 //=============================================================================
178 } // namespace SceneGraph
179 } // namespace ACG
180 //=============================================================================
181 #endif // ACG_COORDFRAMENODE_HH defined
182 //=============================================================================
183 
const std::vector< float > & x_planes() const
get x-plane container
void set_z_planes(const std::vector< float > &_planes)
set z-plane container
void add_z_plane(float _z)
add (z == _z)-plane
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:51
const Vec3d & bb_max() const
get bounding box
const std::vector< float > & z_planes() const
get z-plane container
void set_x_planes(const std::vector< float > &_planes)
set x-plane container
void add_y_plane(float _y)
add (y == _y)-plane
void set_y_planes(const std::vector< float > &_planes)
set y-plane container
void add_x_plane(float _x)
add (x == _x)-plane
const Vec3d & bb_min() const
get bounding box
void del_y_plane(float _y)
del (y == _y)-plane
void del_x_plane(float _x)
del (x == _x)-plane
void del_z_plane(float _z)
del (z == _z)-plane
const std::vector< float > & y_planes() const
get y-plane container