render_params.h
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------
2  * A repertory of multi primitive-to-primitive (MP2P) ICP algorithms in C++
3  * Copyright (C) 2018-2024 Jose Luis Blanco, University of Almeria
4  * See LICENSE for license information.
5  * ------------------------------------------------------------------------- */
6 
13 #pragma once
14 
15 #include <mp2p_icp/layer_name_t.h>
16 #include <mrpt/img/TColor.h>
17 #include <mrpt/img/color_maps.h>
18 #include <mrpt/opengl/opengl_frwds.h>
19 #include <mrpt/typemeta/TEnumType.h>
20 
21 #include <map>
22 #include <optional>
23 #include <vector>
24 
25 namespace mp2p_icp
26 {
33 {
34  render_params_planes_t() = default;
35 
36  bool visible = true;
37  double halfWidth = 1.0;
38  double gridSpacing = 0.25;
39  mrpt::img::TColor color{0xff, 0xff, 0xff, 0xff};
40 
41  bool operator==(const render_params_planes_t& o) const
42  {
43  return visible == o.visible && halfWidth == o.halfWidth &&
44  gridSpacing == o.gridSpacing && color == o.color;
45  }
46  bool operator!=(const render_params_planes_t& o) const
47  {
48  return !(*this == o);
49  }
50 };
51 
54 {
55  render_params_lines_t() = default;
56 
57  bool visible = true;
58  mrpt::img::TColor color{0xff, 0x00, 0x00, 0xff};
59  double length = 20.0;
60  std::optional<std::vector<double>> lengths;
61 
62  bool operator==(const render_params_lines_t& o) const
63  {
64  return visible == o.visible && length == o.length &&
65  lengths == o.lengths && color == o.color;
66  }
67  bool operator!=(const render_params_lines_t& o) const
68  {
69  return !(*this == o);
70  }
71 };
72 
73 enum class Coordinate : uint8_t
74 {
75  X = 0,
76  Y,
77  Z
78 };
79 
81 {
84 
86  mrpt::img::TColormap colorMap = mrpt::img::cmHOT;
87 
89  std::optional<Coordinate> recolorizeByCoordinate;
90 
98  std::optional<float> colorMapMinCoord, colorMapMaxCoord;
99 
107  std::optional<float> autoBoundingBoxOutliersPercentile = {0.025};
108 
109  bool operator==(const color_mode_t& o) const
110  {
112  colorMap == o.colorMap &&
118  }
119  bool operator!=(const color_mode_t& o) const { return !(*this == o); }
120 };
121 
125 {
126  render_params_point_layer_t() = default;
127 
130  float pointSize = 1.0f;
131 
133  mrpt::img::TColor color{0x00, 0x00, 0xff, 0xff};
134 
137  std::optional<color_mode_t> colorMode;
138 
141 
143  {
144  return pointSize == o.pointSize && color == o.color &&
145  colorMode == o.colorMode &&
148  }
150  {
151  return !(*this == o);
152  }
153 };
154 
157 {
158  render_params_points_t() = default;
159 
162  bool visible = true;
163 
167 
170  std::map<layer_name_t, render_params_point_layer_t> perLayer;
171 
172  bool operator==(const render_params_points_t& o) const
173  {
174  return visible == o.visible && allLayers == o.allLayers &&
175  perLayer == o.perLayer;
176  }
177  bool operator!=(const render_params_points_t& o) const
178  {
179  return !(*this == o);
180  }
181 };
182 
185 {
186  render_params_t() = default;
187 
191 
192  bool operator==(const render_params_t& o) const
193  {
194  return planes == o.planes && lines == o.lines && points == o.points;
195  }
196  bool operator!=(const render_params_t& o) const { return !(*this == o); }
197 };
198 
200 {
201  render_params_pairings_pt2pt_t() = default;
202 
203  bool visible = true;
204 
205  mrpt::img::TColor color{0xe0, 0xe0, 0xe0, 0xc0};
206 };
207 
209 {
210  render_params_pairings_pt2pl_t() = default;
211 
212  bool visible = true;
213 
214  mrpt::img::TColor segmentColor{0x00, 0xff, 0x00, 0xa0};
215  mrpt::img::TColor planePatchColor{0x00, 0xff, 0x00, 0x80};
216  double planePatchSize = 0.2;
217 };
218 
220 {
221  render_params_pairings_pt2ln_t() = default;
222 
223  bool visible = true;
224 
225  mrpt::img::TColor segmentColor{0x00, 0xff, 0x00, 0xa0};
226  mrpt::img::TColor lineColor{0x00, 0xff, 0x00, 0x80};
227  double lineLength = 0.2;
228 };
229 
232 {
233  pairings_render_params_t() = default;
234 
238 };
239 
242 } // namespace mp2p_icp
243 
244 MRPT_ENUM_TYPE_BEGIN(mp2p_icp::Coordinate)
248 MRPT_ENUM_TYPE_END()
mp2p_icp::color_mode_t::operator==
bool operator==(const color_mode_t &o) const
Definition: render_params.h:109
mp2p_icp::render_params_lines_t::visible
bool visible
Definition: render_params.h:57
mp2p_icp::render_params_point_layer_t::operator!=
bool operator!=(const render_params_point_layer_t &o) const
Definition: render_params.h:149
mp2p_icp::color_mode_t::operator!=
bool operator!=(const color_mode_t &o) const
Definition: render_params.h:119
mp2p_icp::pairings_render_params_t::pt2pl
render_params_pairings_pt2pl_t pt2pl
Definition: render_params.h:236
mp2p_icp::render_params_pairings_pt2pl_t::planePatchColor
mrpt::img::TColor planePatchColor
Definition: render_params.h:215
mp2p_icp
Definition: covariance.h:17
mp2p_icp::render_params_pairings_pt2pt_t::render_params_pairings_pt2pt_t
render_params_pairings_pt2pt_t()=default
mp2p_icp::render_params_pairings_pt2pt_t::color
mrpt::img::TColor color
Definition: render_params.h:205
mp2p_icp::render_params_t::points
render_params_points_t points
Definition: render_params.h:190
mp2p_icp::pairings_render_params_t::pt2pt
render_params_pairings_pt2pt_t pt2pt
Definition: render_params.h:235
mp2p_icp::render_params_point_layer_t::render_voxelmaps_as_points
bool render_voxelmaps_as_points
Definition: render_params.h:139
mp2p_icp::render_params_pairings_pt2pl_t::visible
bool visible
Definition: render_params.h:212
mp2p_icp::render_params_point_layer_t::operator==
bool operator==(const render_params_point_layer_t &o) const
Definition: render_params.h:142
mp2p_icp::Coordinate::Y
@ Y
mp2p_icp::render_params_point_layer_t
Definition: render_params.h:124
mp2p_icp::render_params_pairings_pt2ln_t::segmentColor
mrpt::img::TColor segmentColor
Definition: render_params.h:225
mp2p_icp::render_params_pairings_pt2pl_t::segmentColor
mrpt::img::TColor segmentColor
Definition: render_params.h:214
mp2p_icp::render_params_planes_t::visible
bool visible
Definition: render_params.h:36
mp2p_icp::render_params_pairings_pt2pt_t::visible
bool visible
Definition: render_params.h:203
mp2p_icp::color_mode_t::recolorizeByCoordinate
std::optional< Coordinate > recolorizeByCoordinate
Definition: render_params.h:89
mp2p_icp::Coordinate::Z
@ Z
mp2p_icp::render_params_t::planes
render_params_planes_t planes
Definition: render_params.h:188
mp2p_icp::color_mode_t::autoBoundingBoxOutliersPercentile
std::optional< float > autoBoundingBoxOutliersPercentile
Definition: render_params.h:107
mp2p_icp::render_params_planes_t::render_params_planes_t
render_params_planes_t()=default
mp2p_icp::render_params_pairings_pt2pl_t
Definition: render_params.h:208
mp2p_icp::color_mode_t::colorMapMinCoord
std::optional< float > colorMapMinCoord
Definition: render_params.h:98
mp2p_icp::render_params_pairings_pt2pl_t::planePatchSize
double planePatchSize
Definition: render_params.h:216
mp2p_icp::pairings_render_params_t::pt2ln
render_params_pairings_pt2ln_t pt2ln
Definition: render_params.h:237
mp2p_icp::render_params_planes_t
Definition: render_params.h:32
mp2p_icp::render_params_pairings_pt2pl_t::render_params_pairings_pt2pl_t
render_params_pairings_pt2pl_t()=default
mp2p_icp::render_params_lines_t::length
double length
all lines with same length
Definition: render_params.h:59
mp2p_icp::render_params_pairings_pt2ln_t::visible
bool visible
Definition: render_params.h:223
mp2p_icp::pairings_render_params_t::pairings_render_params_t
pairings_render_params_t()=default
mp2p_icp::Coordinate
Coordinate
Definition: render_params.h:73
mp2p_icp::render_params_planes_t::operator!=
bool operator!=(const render_params_planes_t &o) const
Definition: render_params.h:46
mp2p_icp::render_params_planes_t::halfWidth
double halfWidth
Definition: render_params.h:37
layer_name_t.h
mp2p_icp::render_params_point_layer_t::render_voxelmaps_free_space
bool render_voxelmaps_free_space
Definition: render_params.h:140
mp2p_icp::render_params_lines_t
Definition: render_params.h:53
mp2p_icp::render_params_points_t::allLayers
render_params_point_layer_t allLayers
Definition: render_params.h:166
mp2p_icp::render_params_point_layer_t::color
mrpt::img::TColor color
Definition: render_params.h:133
mp2p_icp::render_params_point_layer_t::pointSize
float pointSize
Definition: render_params.h:130
mp2p_icp::render_params_point_layer_t::render_params_point_layer_t
render_params_point_layer_t()=default
mp2p_icp::color_mode_t::keep_original_cloud_color
bool keep_original_cloud_color
Definition: render_params.h:83
mp2p_icp::render_params_planes_t::gridSpacing
double gridSpacing
Definition: render_params.h:38
mp2p_icp::render_params_t::lines
render_params_lines_t lines
Definition: render_params.h:189
mp2p_icp::render_params_t
Definition: render_params.h:184
mp2p_icp::render_params_lines_t::operator==
bool operator==(const render_params_lines_t &o) const
Definition: render_params.h:62
MRPT_FILL_ENUM_MEMBER
MRPT_FILL_ENUM_MEMBER(mp2p_icp::Coordinate, X)
mp2p_icp::render_params_pairings_pt2ln_t::lineColor
mrpt::img::TColor lineColor
Definition: render_params.h:226
mp2p_icp::render_params_lines_t::lengths
std::optional< std::vector< double > > lengths
individual lengths
Definition: render_params.h:60
mp2p_icp::render_params_points_t::perLayer
std::map< layer_name_t, render_params_point_layer_t > perLayer
Definition: render_params.h:170
mp2p_icp::render_params_lines_t::render_params_lines_t
render_params_lines_t()=default
mp2p_icp::render_params_pairings_pt2ln_t::lineLength
double lineLength
Definition: render_params.h:227
mp2p_icp::color_mode_t
Definition: render_params.h:80
mp2p_icp::render_params_planes_t::operator==
bool operator==(const render_params_planes_t &o) const
Definition: render_params.h:41
mp2p_icp::render_params_pairings_pt2pt_t
Definition: render_params.h:199
mp2p_icp::render_params_t::operator==
bool operator==(const render_params_t &o) const
Definition: render_params.h:192
mp2p_icp::render_params_points_t::operator!=
bool operator!=(const render_params_points_t &o) const
Definition: render_params.h:177
mp2p_icp::render_params_points_t::operator==
bool operator==(const render_params_points_t &o) const
Definition: render_params.h:172
mp2p_icp::render_params_points_t::render_params_points_t
render_params_points_t()=default
mp2p_icp::render_params_points_t
Definition: render_params.h:156
mp2p_icp::render_params_point_layer_t::colorMode
std::optional< color_mode_t > colorMode
Definition: render_params.h:137
mp2p_icp::render_params_pairings_pt2ln_t::render_params_pairings_pt2ln_t
render_params_pairings_pt2ln_t()=default
mp2p_icp::render_params_lines_t::color
mrpt::img::TColor color
Definition: render_params.h:58
mp2p_icp::render_params_t::operator!=
bool operator!=(const render_params_t &o) const
Definition: render_params.h:196
mp2p_icp::render_params_planes_t::color
mrpt::img::TColor color
Definition: render_params.h:39
mp2p_icp::Coordinate::X
@ X
mp2p_icp::render_params_pairings_pt2ln_t
Definition: render_params.h:219
mp2p_icp::pairings_render_params_t
Definition: render_params.h:231
mp2p_icp::color_mode_t::colorMapMaxCoord
std::optional< float > colorMapMaxCoord
Definition: render_params.h:98
mp2p_icp::render_params_lines_t::operator!=
bool operator!=(const render_params_lines_t &o) const
Definition: render_params.h:67
mp2p_icp::color_mode_t::colorMap
mrpt::img::TColormap colorMap
Definition: render_params.h:86
mp2p_icp::render_params_points_t::visible
bool visible
Definition: render_params.h:162
mp2p_icp::render_params_t::render_params_t
render_params_t()=default


mp2p_icp
Author(s):
autogenerated on Thu Dec 26 2024 03:48:12