50 #ifndef ACG_PRINCIPAL_AXIS_NODE_HH
51 #define ACG_PRINCIPAL_AXIS_NODE_HH
56 #include <ACG/Config/ACGDefines.hh>
57 #include <ACG/GL/VertexDeclaration.hh>
58 #include <ACG/GL/GLPrimitives.hh>
59 #include <ACG/GL/globjects.hh>
61 #include "BaseNode.hh"
62 #include "DrawModes.hh"
70 class QtPrincipalAxisDialog;
129 sign[0] = _pc.sign[0];
130 sign[1] = _pc.sign[1];
131 sign[2] = _pc.sign[2];
149 enum DrawStyle { DS_3D = 1, DS_2D = 2};
150 enum ColorMode { CM_Axis = 1, CM_Sign = 2};
155 std::string _name=
"<PrincipalAxis>" );
161 void show_options_dialog();
164 void set_draw_style(DrawStyle _ds) { draw_style_ = _ds;}
165 void set_color_mode(ColorMode _cm);
166 void show_tensor_component(
unsigned int _i,
unsigned char _show);
169 size_t size() {
return pc_.size();}
171 void resize(
size_t _n);
173 void clear() { pc_.clear(); invalidateInstanceData_ =
true; }
176 void enable (
size_t _i);
177 void disable(
size_t _i);
181 template<
class VectorT>
182 void set_vector(
unsigned int _i,
const Vec3d _p,
const VectorT& _v);
183 template<
class MatrixT>
184 void set_matrix(
unsigned int _i,
const Vec3d _p,
const MatrixT& _m);
189 void set_auto_range(
bool _b);
191 void set_min_abs_value(
double _v);
192 void set_max_abs_value(
double _v);
194 void set_min_draw_radius(
double _v);
195 void set_max_draw_radius(
double _v);
197 double get_min_draw_radius()
const {
return min_draw_radius_; }
198 double get_max_draw_radius()
const {
return max_draw_radius_; }
200 double get_min_spacing()
const {
return min_spacing_; }
205 void auto_update_range();
207 void update_bounding_box();
215 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
222 void draw_arrow(
const Vec3d& _axis,
double _r);
224 void draw_line(
const Vec3d& _axis,
double _w);
231 void set_draw_quality(
double _q) { slices_ = int(_q); }
233 void set_cylinder_radius_scale(
double _s) { cylinder_radius_scale_ = _s;}
235 void set_axes_colors(
const Vec4f colors[3]);
236 void get_axes_colors(
Vec4f out_colors[3])
const;
239 void getRenderObjects(IRenderer* _renderer, GLState& _state ,
const DrawModes::DrawMode& _drawMode ,
const ACG::SceneGraph::Material* _mat);
242 GLMatrixd axisTransform(
const PrincipalComponent& _pc,
int _axis,
double* _outSize = 0)
const;
245 Vec3d axisScaled(
const PrincipalComponent& _pc,
int _axis)
const;
248 void emitIndividualRenderobjects(IRenderer* _renderer, GLState& _state,
const DrawModes::DrawMode& _drawMode,
const ACG::SceneGraph::Material* _mat);
250 void updateVBO() { updateVBO_ =
true; };
257 void diagonalize(
const double (&A)[3][3],
double (&Q)[3][3],
double (&D)[3][3]);
260 std::vector< PrincipalComponent > pc_;
263 std::vector< bool > draw_pc_;
269 double max_abs_value_;
270 double min_abs_value_;
273 double max_draw_radius_;
274 double min_draw_radius_;
285 double cylinder_radius_scale_;
290 DrawStyle draw_style_;
291 ColorMode color_mode_;
294 unsigned char show_tensor_component_[3];
298 const float cone_height_factor_;
303 GeometryBuffer lineBuffer_;
311 GeometryBuffer lineInstanceBuffer_;
312 bool invalidateInstanceData_;
316 int supportsInstancing_;
318 GLfloat axes_colors[3][4];
328 std::string nodeName_;
337 #if defined(INCLUDE_TEMPLATES) && !defined(ACG_PRINCIPAL_AXIS_NODE_C)
338 #define ACG_PRINCIPAL_AXIS_NODE_TEMPLATES
339 #include "PrincipalAxisNodeT.cc"
342 #endif // ACG_PRINCIPAL_AXIS_NODE_HH
bool default_radius_
Indicates whether the min/max draw radius has been changed from its default setting.
Namespace providing different geometric functions concerning angles.
Class to define the vertex input layout.
bool is_default_radius() const
Indicates whether the min/max draw radius has been changed from its default setting.
Class to define the vertex input layout.
PickTarget
What target to use for picking.
VectorT< double, 3 > Vec3d
GLMatrixT< double > GLMatrixd
typedef