Go to the documentation of this file.
5 #include <SimoxUtility/color/ColorMap.h>
9 #include <RobotAPI/interface/ArViz/Elements.h>
18 using data::ColoredPoint;
50 data_->transparency = t;
57 data_->pointSizeInPixels =
s;
66 data_->points.clear();
73 std::size_t memorySize = ps.size() *
sizeof(ps[0]);
74 const Ice::Byte*
const begin =
reinterpret_cast<const Ice::Byte*
>(ps.data());
75 const Ice::Byte*
const end = begin + memorySize;
76 data_->points.assign(begin, end);
95 const Ice::Byte*
const begin =
reinterpret_cast<const Ice::Byte*
>(&p);
96 const Ice::Byte*
const end = begin +
sizeof(p);
97 data_->points.insert(
data_->points.end(), begin, end);
116 template <
typename ColorCoeff =
int>
117 PointCloud &
addPoint(
float x,
float y,
float z, ColorCoeff r, ColorCoeff g, ColorCoeff b, ColorCoeff
a = 255)
124 return addPoint(x, y, z, simox::Color::black(255));
129 return addPoint(x, y, z, simox::color::GlasbeyLUT::at(
id, alpha));
138 template <
class Po
intT >
153 template <
class Po
intT>
158 return addPoint(p.x, p.y, p.z, simox::color::GlasbeyLUT::at(p.label));
176 template <
class Po
intT >
181 return addPoint(p.x, p.y, p.z, simox::color::GlasbeyLUT::at(p.label));
193 template <
class Po
intCloudT>
203 template <
class Po
intCloudT>
213 template <
class Po
intCloudT>
224 template <
class Po
intCloudT>
227 return this->
setPointCloud(cloud, [
this, colorByLabel](
const auto & p)
234 template <
class Po
intCloudT>
245 template <
class Po
intCloudT>
264 template <
class Po
intCloudT,
class ColorFuncT>
267 return this->
setPointCloud(cloud, [
this, &colorFunc](
const auto & p)
276 template <
class Po
intCloudT,
class ColorFuncT>
278 const ColorFuncT& colorFunc)
294 template <
class Po
intCloudT,
class ScalarFuncT>
296 const ScalarFuncT& scalarFunc)
298 return this->
pointCloud(pointCloud, [&colorMap, scalarFunc](
const auto & p)
300 return colorMap(scalarFunc(p));
307 template <
class Po
intCloudT,
class ScalarFuncT>
309 const simox::ColorMap& colorMap,
const ScalarFuncT& scalarFunc)
311 return this->
pointCloud(pointCloud,
indices, [colorMap, scalarFunc](
const auto & p)
313 return colorMap(scalarFunc(p));
332 template <
class Po
intCloudT,
class Po
intFunc>
340 for (
const auto& p : cloud)
361 template <
class Po
intCloudT,
class Po
intFunc>
363 const PointFunc& pointFunc,
bool clear =
true)
372 const auto& p = cloud.at(
size_t(i));
381 template <
class Po
intT>
382 bool isfinite(
const PointT& p)
const
389 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)