Visu.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <optional>
25 
26 #include <SimoxUtility/color/Color.h>
27 
29 
31 
32 namespace armarx::viz
33 {
34  class Arrow;
35  class Layer;
36  class Pose;
37 } // namespace armarx::viz
38 
40 {
41 
42  namespace visu
43  {
45  {
47  const std::vector<ObjectInfo>& info;
48  };
49  } // namespace visu
50 
51  struct VertexVisu
52 
53  {
54  struct Pose
55  {
56  float scale = 1.0;
57 
58  viz::Pose draw(const std::string& name, const core::Pose& pose) const;
59  };
60 
61  std::optional<Pose> pose = Pose{};
62 
63  struct ForwardArrow
64  {
65  float width = 7.5;
66  float length = 100.0;
68 
69  viz::Arrow draw(const std::string& name, const core::Pose& pose) const;
70  };
71 
72  std::optional<ForwardArrow> forwardArrow = ForwardArrow{};
73 
74 
75  void
76  draw(viz::Layer& layer, core::Graph::ConstVertex vertex, visu::ObjectParserInfo info) const;
77  void draw(viz::Layer& layer, const std::string& name, const core::Pose& pose) const;
78  };
79 
80  struct EdgeVisu
81  {
82  struct Arrow
83  {
84  float width = 5.0;
85  simox::Color color = simox::Color::azure(196);
86 
87  viz::Arrow draw(const std::string& sourceName,
88  const std::string& targetName,
89  const core::Pose& source,
90  const core::Pose& target) const;
91  };
92 
93  std::optional<Arrow> arrow = Arrow{};
94 
95  void
96  draw(viz::Layer& layer, core::Graph::ConstEdge edge, visu::ObjectParserInfo info) const;
97  };
98 
99  struct GraphVisu
100  {
101 
102  std::optional<VertexVisu> vertex = VertexVisu{};
103  std::optional<EdgeVisu> edge = EdgeVisu{};
104 
105  void draw(viz::Layer& layer, const core::Graph& graph, visu::ObjectParserInfo info) const;
106  };
107 
108 } // namespace armarx::navigation::graph
armarx::navigation::graph::EdgeVisu::draw
void draw(viz::Layer &layer, core::Graph::ConstEdge edge, visu::ObjectParserInfo info) const
Definition: Visu.cpp:90
armarx::navigation::graph::visu::ObjectParserInfo::info
const std::vector< ObjectInfo > & info
Definition: Visu.h:47
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
armarx::navigation::graph::GraphVisu::draw
void draw(viz::Layer &layer, const core::Graph &graph, visu::ObjectParserInfo info) const
Definition: Visu.cpp:109
armarx::navigation::graph::VertexVisu::ForwardArrow::width
float width
Definition: Visu.h:65
armarx::navigation::graph::VertexVisu::ForwardArrow::color
simox::Color color
Definition: Visu.h:67
boost::target
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:688
armarx::navigation::graph
This file is part of ArmarX.
Definition: Visu.h:37
armarx::viz::Arrow
Definition: Elements.h:198
armarx::navigation::graph::VertexVisu::ForwardArrow
Definition: Visu.h:63
armarx::navigation::graph::EdgeVisu::Arrow::draw
viz::Arrow draw(const std::string &sourceName, const std::string &targetName, const core::Pose &source, const core::Pose &target) const
Definition: Visu.cpp:78
armarx::navigation::graph::VertexVisu::ForwardArrow::draw
viz::Arrow draw(const std::string &name, const core::Pose &pose) const
Definition: Visu.cpp:42
armarx::navigation::graph::VertexVisu::pose
std::optional< Pose > pose
Definition: Visu.h:61
armarx::navigation::graph::GraphVisu::vertex
std::optional< VertexVisu > vertex
Definition: Visu.h:102
Color
uint32_t Color
RGBA color.
Definition: color.h:8
armarx::navigation::graph::GraphVisu::edge
std::optional< EdgeVisu > edge
Definition: Visu.h:103
armarx::navigation::graph::VertexVisu::draw
void draw(viz::Layer &layer, core::Graph::ConstVertex vertex, visu::ObjectParserInfo info) const
Definition: Visu.cpp:53
armarx::navigation::graph::GraphVisu
Definition: Visu.h:99
armarx::navigation::core::Graph
Definition: Graph.h:88
armarx::navigation::graph::EdgeVisu::Arrow::width
float width
Definition: Visu.h:84
armarx::viz::Pose
Definition: Elements.h:179
ObjectPose.h
armarx::navigation::graph::EdgeVisu::Arrow::color
simox::Color color
Definition: Visu.h:85
armarx::navigation::graph::EdgeVisu
Definition: Visu.h:80
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
armarx::navigation::graph::VertexVisu::Pose::scale
float scale
Definition: Visu.h:56
armarx::navigation::graph::VertexVisu::Pose::draw
viz::Pose draw(const std::string &name, const core::Pose &pose) const
Definition: Visu.cpp:36
Graph.h
armarx::navigation::graph::visu::ObjectParserInfo::objects
const objpose::ObjectPoseMap & objects
Definition: Visu.h:46
armarx::navigation::graph::EdgeVisu::Arrow
Definition: Visu.h:82
armarx::navigation::graph::VertexVisu::ForwardArrow::length
float length
Definition: Visu.h:66
armarx::navigation::graph::VertexVisu
Definition: Visu.h:51
armarx::navigation::graph::visu::ObjectParserInfo
Definition: Visu.h:44
armarx::viz::Layer
Definition: Layer.h:12
armarx::navigation::graph::EdgeVisu::arrow
std::optional< Arrow > arrow
Definition: Visu.h:93
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:416
armarx::navigation::graph::VertexVisu::forwardArrow
std::optional< ForwardArrow > forwardArrow
Definition: Visu.h:72
armarx::green
QColor green()
Definition: StyleSheets.h:72
armarx::navigation::graph::VertexVisu::Pose
Definition: Visu.h:54
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21