Go to the documentation of this file.
5 #include <SimoxUtility/color/ColorMap.h>
9 #include <RobotAPI/interface/ArViz/Elements.h>
17 using data::ColoredPoint;
47 data_->transparency = t;
55 data_->pointSizeInPixels =
s;
64 data_->points.clear();
69 points(std::vector<ColoredPoint>
const& ps)
71 std::size_t memorySize = ps.size() *
sizeof(ps[0]);
72 const Ice::Byte*
const begin =
reinterpret_cast<const Ice::Byte*
>(ps.data());
73 const Ice::Byte*
const end = begin + memorySize;
74 data_->points.assign(begin, end);
94 const Ice::Byte*
const begin =
reinterpret_cast<const Ice::Byte*
>(&p);
95 const Ice::Byte*
const end = begin +
sizeof(p);
96 data_->points.insert(
data_->points.end(), begin, end);
117 template <
typename ColorCoeff =
int>
133 return addPoint(x, y, z, simox::Color::black(255));
137 addPoint(
float x,
float y,
float z, std::size_t
id,
int alpha = 255)
139 return addPoint(x, y, z, simox::color::GlasbeyLUT::at(
id, alpha));
147 template <
class Po
intT>
163 template <
class Po
intT>
169 return addPoint(p.x, p.y, p.z, simox::color::GlasbeyLUT::at(p.label));
187 template <
class Po
intT>
193 return addPoint(p.x, p.y, p.z, simox::color::GlasbeyLUT::at(p.label));
204 template <
class Po
intCloudT>
212 template <
class Po
intCloudT>
220 template <
class Po
intCloudT>
229 template <
class Po
intCloudT>
234 cloud, [
this, colorByLabel](
const auto& p) { this->
addPoint(p, colorByLabel); });
238 template <
class Po
intCloudT>
244 [
this, colorByLabel](
int,
const auto& p)
249 template <
class Po
intCloudT>
265 template <
class Po
intCloudT,
class ColorFuncT>
270 cloud, [
this, &colorFunc](
const auto& p) {
addPoint(p, colorFunc(p)); });
276 template <
class Po
intCloudT,
class ColorFuncT>
279 const std::vector<int>&
indices,
280 const ColorFuncT& colorFunc)
284 [
this, &colorFunc](
int,
const auto& p)
295 template <
class Po
intCloudT,
class ScalarFuncT>
298 const simox::ColorMap& colorMap,
299 const ScalarFuncT& scalarFunc)
302 [&colorMap, scalarFunc](
const auto& p)
303 {
return colorMap(scalarFunc(p)); });
309 template <
class Po
intCloudT,
class ScalarFuncT>
312 const std::vector<int>&
indices,
313 const simox::ColorMap& colorMap,
314 const ScalarFuncT& scalarFunc)
318 [colorMap, scalarFunc](
const auto& p)
319 {
return colorMap(scalarFunc(p)); });
336 template <
class Po
intCloudT,
class Po
intFunc>
344 for (
const auto& p : cloud)
365 template <
class Po
intCloudT,
class Po
intFunc>
368 const std::vector<int>&
indices,
369 const PointFunc& pointFunc,
379 const auto& p = cloud.at(
size_t(i));
387 template <
class Po
intT>
389 isfinite(
const PointT& p)
const
391 return !_checkFinite ||
396 bool _checkFinite =
false;
#define ARMARX_CHECK_FITS_SIZE(number, size)
Check whether number is nonnegative (>= 0) and less than size. If it is not, throw an ExpressionExcep...
PointCloud & pointCloud(const PointCloudT &pointCloud, const simox::ColorMap &colorMap, const ScalarFuncT &scalarFunc)
Draw a colored point cloud with using a color map.
PointCloud & addPoint(float x, float y, float z, const simox::Color &color)
PointCloud & addPoint(const PointT &p, Color color)
Add a point in the given color.
IceInternal::Handle< data::ElementPointCloud > data_
PointCloud & pointCloud(const PointCloudT &cloud, const std::vector< int > &indices)
Draw a point cloud with given indices.
PointCloud & addPoint(float x, float y, float z, std::size_t id, int alpha=255)
ElementOps(std::string const &id)
PointCloud & points(std::vector< ColoredPoint > const &ps)
bool isfinite(const std::vector< T, Ts... > &v)
PointCloud & addPoint(float x, float y, float z, const data::Color &color)
double a(double t, double a0, double j)
uint32_t Color
RGBA color.
std::shared_ptr< Value > value()
PointCloud & pointCloud(const PointCloudT &cloud, bool colorByLabel)
Draw a point cloud.
pcl::PointIndices::Ptr indices(const PCG &g)
Retrieve the indices of the points of the point cloud stored in a point cloud graph that actually bel...
PointCloud & pointSizeInPixels(float s)
PointCloud & pointCloud(const PointCloudT &cloud, const std::vector< int > &indices, Color color)
Draw a unicolored point cloud with given color and indices.
PointCloud & pointCloud(const PointCloudT &cloud, const std::vector< int > &indices, const ColorFuncT &colorFunc)
Draw a colored point cloud with custom colors and given indices.
PointCloud & addPoint(const PointT &p)
Add a point with its "natural" color.
static Color gray(int g=128, int a=255)
PointCloud & pointCloud(const PointCloudT &pointCloud, const std::vector< int > &indices, const simox::ColorMap &colorMap, const ScalarFuncT &scalarFunc)
Draw a colored point cloud with using a color map and given indices.
pcl::PointCloud< PointT > PointCloudT
PointCloud & addPointUnchecked(ColoredPoint const &p)
PointCloud & pointCloud(const PointCloudT &cloud, const ColorFuncT &colorFunc)
Draw a colored point cloud with custom colors.
PointCloud & pointCloud(const PointCloudT &cloud, const std::vector< int > &indices, bool colorByLabel)
Draw a point cloud with given indices.
PointCloud & setPointCloud(const PointCloudT &cloud, const std::vector< int > &indices, const PointFunc &pointFunc, bool clear=true)
Set the point cloud from a pcl::PointCloud.
PointCloud & addPoint(float x, float y, float z, ColorCoeff r, ColorCoeff g, ColorCoeff b, ColorCoeff a=255)
PointCloud & color(Color color)
PointCloud & addPoint(float x, float y, float z)
PointCloud & setPointCloud(const PointCloudT &cloud, const PointFunc &pointFunc, bool clear=true)
Set the point cloud from a pcl::PointCloud.
PointCloud & addPoint(ColoredPoint const &p)
PointCloud & pointCloud(const PointCloudT &cloud)
Draw a point cloud.
PointCloud & addPoint(const PointT &p, bool colorByLabel)
Add a colored or labeled point.
PointCloud & pointCloud(const PointCloudT &cloud, Color color)
Draw a unicolored point cloud with given color.
PointCloud & checkFinite(bool enabled=true)
Enable or disable checking whether points are finite when adding them (disabled by default).
double s(double t, double s0, double v0, double a0, double j)
This file is part of ArmarX.
PointCloud & transparency(float t)