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#include <string>
26#include <vector>
27
28#include <SimoxUtility/color/Color.h>
29
31
34
35namespace armarx::viz
36{
37 class Arrow;
38 class Layer;
39 class Pose;
40} // namespace armarx::viz
41
43{
44
45 namespace visu
46 {
48 {
50 const std::vector<ObjectInfo>& info;
51 };
52 } // namespace visu
53
55
56 {
57 struct Pose
58 {
59 float scale = 1.0;
60
61 viz::Pose draw(const std::string& name, const core::Pose& pose) const;
62 };
63
64 std::optional<Pose> pose = Pose{};
65
67 {
68 float width = 7.5;
69 float length = 100.0;
70 simox::Color color = simox::Color::green();
71
72 viz::Arrow draw(const std::string& name, const core::Pose& pose) const;
73 };
74
75 std::optional<ForwardArrow> forwardArrow = ForwardArrow{};
76
77
78 void
79 draw(viz::Layer& layer, core::Graph::ConstVertex vertex, visu::ObjectParserInfo info) const;
80 void draw(viz::Layer& layer, const std::string& name, const core::Pose& pose) const;
81 };
82
83 struct EdgeVisu
84 {
85 struct Arrow
86 {
87 float width = 5.0;
88 simox::Color color = simox::Color::azure(196);
89
90 viz::Arrow draw(const std::string& sourceName,
91 const std::string& targetName,
92 const core::Pose& source,
93 const core::Pose& target) const;
94 };
95
96 std::optional<Arrow> arrow = Arrow{};
97
98 void
99 draw(viz::Layer& layer, core::Graph::ConstEdge edge, visu::ObjectParserInfo info) const;
100 };
101
103 {
104
105 std::optional<VertexVisu> vertex = VertexVisu{};
106 std::optional<EdgeVisu> edge = EdgeVisu{};
107
108 void draw(viz::Layer& layer, const core::Graph& graph, visu::ObjectParserInfo info) const;
109 };
110
111} // namespace armarx::navigation::graph
Eigen::Isometry3f Pose
Definition basic_types.h:31
This file is part of ArmarX.
Definition Visu.h:48
std::map< ObjectID, ObjectPose > ObjectPoseMap
This file is part of ArmarX.
viz::Arrow draw(const std::string &sourceName, const std::string &targetName, const core::Pose &source, const core::Pose &target) const
Definition Visu.cpp:80
void draw(viz::Layer &layer, core::Graph::ConstEdge edge, visu::ObjectParserInfo info) const
Definition Visu.cpp:92
std::optional< Arrow > arrow
Definition Visu.h:96
std::optional< EdgeVisu > edge
Definition Visu.h:106
std::optional< VertexVisu > vertex
Definition Visu.h:105
void draw(viz::Layer &layer, const core::Graph &graph, visu::ObjectParserInfo info) const
Definition Visu.cpp:111
viz::Arrow draw(const std::string &name, const core::Pose &pose) const
Definition Visu.cpp:44
viz::Pose draw(const std::string &name, const core::Pose &pose) const
Definition Visu.cpp:38
std::optional< Pose > pose
Definition Visu.h:64
std::optional< ForwardArrow > forwardArrow
Definition Visu.h:75
void draw(viz::Layer &layer, core::Graph::ConstVertex vertex, visu::ObjectParserInfo info) const
Definition Visu.cpp:55
const objpose::ObjectPoseMap & objects
Definition Visu.h:49
const std::vector< ObjectInfo > & info
Definition Visu.h:50