Developer Documentation

CoordinateSystemNode.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
45
46
47 //=============================================================================
48 //
49 // CLASS PointNode
50 //
51 //=============================================================================
52
53
54 #ifndef ACG_COORDSYSNODE_HH
55 #define ACG_COORDSYSNODE_HH
56
57
58 //== INCLUDES =================================================================
59
60 #include <ACG/Scenegraph/BaseNode.hh>
61 #include <ACG/Scenegraph/DrawModes.hh>
62 #include <ACG/GL/GLPrimitives.hh>
63 #include <OpenFlipper/common/ObjectTypeDLLDefines.hh>
64 #include <vector>
65
66 //== NAMESPACES ===============================================================
67
68 namespace ACG {
69 namespace SceneGraph {
70
71 //== CLASS DEFINITION =========================================================
72
73
81 class OBJECTTYPEDLLEXPORT CoordinateSystemNode : public BaseNode
82 {
83
84 public:
85
90 CoordinateSystemNode( BaseNode* _parent=0, std::string _name="<TextNode>");
91
93 ~CoordinateSystemNode();
94
96 ACG_CLASSNAME(CoordinateSystemNode);
97
99 ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const;
100
102 void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
103
105 void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
106
108 void pick(GLState& _state, PickTarget _target);
109
111 void position(const Vec3d& _pos);
112
114 Vec3d position();
115
117 Matrix4x4d rotation();
118
120 void rotation(const Matrix4x4d & _rotation);
121
123 void size(const double _size);
124
126 double size();
127
128 private:
129
130 void drawCoordsys(GLState& _state);
131 void drawCoordsysPick(GLState& _state);
132
134 Vec3d position_;
135
137 Matrix4x4d rotation_;
138
140 double coordsysSize_;
141
142 int slices_;
143 int stacks_;
144 int loops_;
145
146 GLSphere* sphere_;
147 GLCone* cone_;
148 GLCylinder* cylinder_;
149 GLDisk* disk_;
150 };
151
152
153 //=============================================================================
154 } // namespace SceneGraph
155 } // namespace ACG
156 //=============================================================================
157 #endif // ACG_COORDSYSNODE_HH defined
158 //=============================================================================
ACG
Namespace providing different geometric functions concerning angles.
Definition: BaseObjectData.hh:68
ACG::GLCone
Definition: GLPrimitives.hh:169
ObjectTypeDLLDefines.hh
ACG::SceneGraph::CoordinateSystemNode::coordsysSize_
double coordsysSize_
Size of the coordsys.
Definition: CoordinateSystemNode.hh:140
ACG::GLCylinder
Definition: GLPrimitives.hh:218
ACG::GLState
Definition: GLState.hh:213
ACG::GLDisk
Definition: GLPrimitives.hh:252
ACG::SceneGraph::CoordinateSystemNode::position_
Vec3d position_
3d position of the coordsys origin
Definition: CoordinateSystemNode.hh:134
ACG::SceneGraph::CoordinateSystemNode
Node for displaying coordinate systems.
Definition: CoordinateSystemNode.hh:81
ACG::GLSphere
Definition: GLPrimitives.hh:139
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:288
ACG::Matrix4x4T< double >
SceneGraph
Definition: QtPrincipalAxisDialog.hh:67
ACG::SceneGraph::PickTarget
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:104
OpenMesh::VectorT
Definition: Vector11T.hh:83
ACG::SceneGraph::CoordinateSystemNode::rotation_
Matrix4x4d rotation_
Orientation of coordsys.
Definition: CoordinateSystemNode.hh:137