16 pcl::PointIndicesPtr &in2outMapping,
18 if (in2outMapping->indices.empty())
return;
19 assert(in2outMapping->indices.size() == outCloud->
size());
21 unsigned n_out = outCloud->
size();
24 for (
unsigned i = 0; i < sfCount; ++i) {
55 for (std::size_t j = 0; j < n_out; ++j) {
57 field->
getValue(in2outMapping->indices.at(j)));
74 pcl::PointIndicesPtr &in2outMapping,
79 if (in2outMapping->indices.empty())
return;
80 assert(in2outMapping->indices.size() == outCloud->
size());
82 if (outCloud->
hasColors() && !overwrite)
return;
86 unsigned n_out = outCloud->
size();
87 for (
unsigned j = 0; j < n_out; ++j) {
virtual void release()
Decrease counter and deletes object when 0.
virtual bool colorsShown() const
Returns whether colors are shown or not.
virtual bool sfShown() const
Returns whether active scalar field is visible.
virtual void showColors(bool state)
Sets colors visibility.
virtual void showSF(bool state)
Sets active scalarfield visibility.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
int addScalarField(const char *uniqueName) override
Creates a new scalar field and registers it.
bool reserveTheRGBTable()
Reserves memory to store the RGB colors.
bool hasColors() const override
Returns whether colors are enabled or not.
void addRGBColor(const ecvColor::Rgb &C)
Pushes an RGB color on stack.
const ecvColor::Rgb & getPointColor(unsigned pointIndex) const override
Returns color corresponding to a given point.
A scalar field associated to display-related parameters.
void computeMinAndMax() override
Determines the min and max values.
int getScalarFieldIndexByName(const char *name) const
Returns the index of a scalar field represented by its name.
ScalarField * getScalarField(int index) const
Returns a pointer to a specific scalar field.
unsigned getNumberOfScalarFields() const
Returns the number of associated (and active) scalar fields.
unsigned size() const override
A simple scalar field (to be associated to a point cloud)
ScalarType & getValue(std::size_t index)
void setValue(std::size_t index, ScalarType value)
const char * getName() const
Returns scalar field name.
bool resizeSafe(std::size_t count, bool initNewElements=false, ScalarType valueForNewElements=0)
Resizes memory (no exception thrown)
void copyRGBColors(const ccPointCloud *inCloud, ccPointCloud *outCloud, pcl::PointIndicesPtr &in2outMapping, bool overwrite)
Makes a copy of RGB colors from one cloud to another.
void copyScalarFields(const ccPointCloud *inCloud, ccPointCloud *outCloud, pcl::PointIndicesPtr &in2outMapping, bool overwrite)
Makes a copy of all scalar fields from one cloud to another.