16 : m_globalIterator(0), m_theAssociatedCloud(associatedCloud) {}
19 : m_globalIterator(0),
20 m_theAssociatedCloud(refCloud.m_theAssociatedCloud),
21 m_theIndexes(refCloud.m_theIndexes)
55 }
catch (
const std::bad_alloc&) {
68 }
catch (
const std::bad_alloc&) {
88 }
catch (
const std::bad_alloc&) {
99 if (firstIndex >= lastIndex) {
104 unsigned range = lastIndex - firstIndex;
107 unsigned pos =
size();
108 if (
size() < pos + range) {
111 }
catch (
const std::bad_alloc&) {
117 for (
unsigned i = 0; i < range; ++i, ++firstIndex) {
128 assert(localIndex <
size());
137 for (
unsigned i = 0; i <
count; ++i) {
149 if (localIndex <
size()) {
150 unsigned lastIndex =
size() - 1;
173 if (newCount == 0)
return true;
178 std::size_t currentSize =
size();
181 }
catch (
const std::bad_alloc&) {
187 for (
unsigned i = 0; i < newCount; ++i) {
const Vector3Tpl< T > & maxCorner() const
Returns max corner (const)
void clear()
Resets the bounding box.
const Vector3Tpl< T > & minCorner() const
Returns min corner (const)
bool isValid() const
Returns whether bounding box is valid or not.
void add(const Vector3Tpl< T > &P)
'Enlarges' the bounding box with a point
std::function< void(const CCVector3 &, ScalarType &)> genericPointAction
Generic function applied to a point (used by foreach)
virtual unsigned size() const =0
Returns the number of points.
virtual ScalarType getPointScalarValue(unsigned pointIndex) const =0
Returns the ith point associated scalar value.
virtual void setPointScalarValue(unsigned pointIndex, ScalarType value)=0
Sets the ith point associated scalar value.
A generic 3D point cloud with index-based and presistent access to points.
virtual const CCVector3 * getPointPersistentPtr(unsigned index)=0
Returns the ith point as a persistent pointer.
virtual const CCVector3 * getPoint(unsigned index) const =0
Returns the ith point.
A very simple point cloud (no point duplication)
BoundingBox m_bbox
Bounding-box.
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
std::atomic< unsigned > m_globalIterator
Iterator on the point references container.
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) override
Returns the cloud bounding box.
std::mutex m_mutex
For concurrent access.
unsigned size() const override
Returns the number of points.
virtual void setPointIndex(unsigned localIndex, unsigned globalIndex)
Sets global index for a given element.
void invalidateBoundingBox()
Invalidates the bounding-box.
ReferencesContainer m_theIndexes
Indexes of (some of) the associated cloud points.
GenericIndexedCloudPersist * m_theAssociatedCloud
Associated cloud.
virtual bool resize(unsigned n)
Presets the size of the vector used to store point references.
ReferenceCloud(GenericIndexedCloudPersist *associatedCloud)
Default constructor.
virtual void clear(bool releaseMemory=false)
Clears the cloud.
void forEach(genericPointAction action) override
Fast iteration mechanism.
bool add(const ReferenceCloud &cloud)
Add another reference cloud.
virtual const CCVector3 * getCurrentPointCoordinates() const
Returns the coordinates of the point pointed by the current element.
virtual void setAssociatedCloud(GenericIndexedCloudPersist *cloud)
Sets the associated (source) cloud.
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
virtual void removePointGlobalIndex(unsigned localIndex)
Removes a given element.
Generic file read and write utility for python interface.