MEPP2 Project
OSGDebug.hpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
13 #include <osg/PolygonMode>
14 #include <osg/ShapeDrawable>
15 #include <osg/Material>
16 
17 #include <osgText/Text>
18 
19 #include "Base/Color.hpp"
20 
21 // #define DEBUG_VISU //@FIXME to be removed. Only for GUI debug purpose.
22 
23 
24 namespace FEVV {
25 namespace Debug {
26 
27 osg::ref_ptr< osg::Group >
28 createLine(const double &_x,
29  const double &_y,
30  const double &_z,
31  const double &_x2,
32  const double &_y2,
33  const double &_z2,
34  const Color &_color = Color::Clouds(),
35  const std::string &_name = "Line",
36  osg::ref_ptr< osg::Group > _group = new osg::Group);
37 
38 osg::ref_ptr< osg::Group >
39 createCylinder(const double &_x,
40  const double &_y,
41  const double &_z,
42  const double &_x2,
43  const double &_y2,
44  const double &_z2,
45  const double &_r,
46  const Color &_color = Color::Lime(),
47  const std::string &_name = "Cylinder",
48  osg::ref_ptr< osg::Group > _group = new osg::Group);
49 
50 osg::ref_ptr< osg::Group >
51 createBox(const double &_x,
52  const double &_y,
53  const double &_z,
54  const double &_r,
55  const Color &_color = Color::Orange(),
56  const std::string &_name = "Box",
57  osg::ref_ptr< osg::Group > _group = new osg::Group);
58 
59 osg::ref_ptr< osg::Group >
60 createBall(const double &_x,
61  const double &_y,
62  const double &_z,
63  const double &_r,
64  const Color &_color = Color::Amethyst(),
65  const std::string &_name = "Ball",
66  osg::ref_ptr< osg::Group > _group = new osg::Group);
67 
68 osg::ref_ptr< osg::Group >
69 createPyramid(const double &_x,
70  const double &_y,
71  const double &_z,
72  const double &_r,
73  const std::string &_name = "Pyramid",
74  osg::ref_ptr< osg::Group > _group = new osg::Group);
75 
76 osg::ref_ptr< osg::Group >
77 createGizmo(osg::ref_ptr< osg::Group > _group = new osg::Group);
78 
79 osg::ref_ptr< osg::Group >
80 createUnitGrid(osg::ref_ptr< osg::Group > _group = new osg::Group);
81 
82 osg::ref_ptr< osg::Group >
83 createHud(osg::ref_ptr< osgText::Text > updateText,
84  osg::ref_ptr< osg::Group > _group = new osg::Group);
85 
92 void print_osg_tree_from_node(osg::Node *nd, int level = 0);
93 
94 } // namespace Debug
95 } // namespace FEVV
96 
97 
98 // implementation
99 #include "OSGDebug.inl"
FEVV::Debug::createBox
osg::ref_ptr< osg::Group > createBox(const double &_x, const double &_y, const double &_z, const double &_r, const Color &_color=Color::Orange(), const std::string &_name="Box", osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:105
FEVV::Debug::createHud
osg::ref_ptr< osg::Group > createHud(osg::ref_ptr< osgText::Text > updateText, osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:356
FEVV::Color::Lime
static Color Lime(void)
Definition: Color.inl:401
FEVV::Debug::print_osg_tree_from_node
void print_osg_tree_from_node(osg::Node *nd, int level=0)
Definition: OSGDebug.inl:392
FEVV::Debug::createLine
osg::ref_ptr< osg::Group > createLine(const double &_x, const double &_y, const double &_z, const double &_x2, const double &_y2, const double &_z2, const Color &_color=Color::Clouds(), const std::string &_name="Line", osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:25
FEVV::Debug::createCylinder
osg::ref_ptr< osg::Group > createCylinder(const double &_x, const double &_y, const double &_z, const double &_x2, const double &_y2, const double &_z2, const double &_r, const Color &_color=Color::Lime(), const std::string &_name="Cylinder", osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:61
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Color
Definition: Color.hpp:18
FEVV::Debug::createUnitGrid
osg::ref_ptr< osg::Group > createUnitGrid(osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:329
FEVV::Color::Amethyst
static Color Amethyst(void)
Definition: Color.inl:488
FEVV::Debug::createGizmo
osg::ref_ptr< osg::Group > createGizmo(osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:307
Color.hpp
FEVV::Color::Orange
static Color Orange(void)
Definition: Color.inl:419
OSGDebug.inl
FEVV::Debug::createBall
osg::ref_ptr< osg::Group > createBall(const double &_x, const double &_y, const double &_z, const double &_r, const Color &_color=Color::Amethyst(), const std::string &_name="Ball", osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:135
FEVV::Debug::createPyramid
osg::ref_ptr< osg::Group > createPyramid(const double &_x, const double &_y, const double &_z, const double &_r, const std::string &_name="Pyramid", osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: OSGDebug.inl:166
FEVV::Color::Clouds
static Color Clouds(void)
Definition: Color.inl:542