41 inline unsigned size()
const override {
42 return static_cast<unsigned>(m_theIndexes.size());
44 void forEach(genericPointAction action)
override;
47 assert(m_theAssociatedCloud);
48 return m_theAssociatedCloud->testVisibility(P);
52 assert(m_theAssociatedCloud);
53 return (m_globalIterator <
size()
54 ? m_theAssociatedCloud->getPoint(
55 m_theIndexes[m_globalIterator++])
59 assert(m_theAssociatedCloud);
60 return m_theAssociatedCloud->enableScalarField();
63 assert(m_theAssociatedCloud);
64 return m_theAssociatedCloud->isScalarFieldEnabled();
67 ScalarType value)
override {
68 assert(m_theAssociatedCloud && pointIndex <
size());
69 m_theAssociatedCloud->setPointScalarValue(m_theIndexes[pointIndex],
73 assert(m_theAssociatedCloud && pointIndex <
size());
74 return m_theAssociatedCloud->getPointScalarValue(
75 m_theIndexes[pointIndex]);
80 assert(m_theAssociatedCloud && index <
size());
81 return m_theAssociatedCloud->getPoint(m_theIndexes[index]);
84 assert(m_theAssociatedCloud && index <
size());
85 m_theAssociatedCloud->getPoint(m_theIndexes[index], P);
87 inline void getPoint(
unsigned index,
double P[3])
const override {
88 assert(m_theAssociatedCloud && index <
size());
89 m_theAssociatedCloud->getPoint(m_theIndexes[index], P);
94 assert(m_theAssociatedCloud && index <
size());
95 return m_theAssociatedCloud->getPointPersistentPtr(m_theIndexes[index]);
104 return m_theIndexes[localIndex];
110 virtual const CCVector3* getCurrentPointCoordinates()
const;
114 assert(m_globalIterator <
size());
115 return m_theIndexes[m_globalIterator];
120 assert(m_theAssociatedCloud && m_globalIterator <
size());
121 return m_theAssociatedCloud->getPointScalarValue(
122 m_theIndexes[m_globalIterator]);
127 assert(m_theAssociatedCloud && m_globalIterator <
size());
128 m_theAssociatedCloud->setPointScalarValue(
129 m_theIndexes[m_globalIterator], value);
138 virtual void clear(
bool releaseMemory =
false);
145 virtual bool addPointIndex(
unsigned globalIndex);
153 virtual bool addPointIndex(
unsigned firstIndex,
unsigned lastIndex);
159 virtual void setPointIndex(
unsigned localIndex,
unsigned globalIndex);
165 virtual bool reserve(
unsigned n);
171 virtual bool resize(
unsigned n);
175 return static_cast<unsigned>(m_theIndexes.capacity());
185 inline virtual void swap(
unsigned i,
unsigned j) {
187 std::swap(m_theIndexes[i], m_theIndexes[j]);
196 removePointGlobalIndex(m_globalIterator);
203 virtual void removePointGlobalIndex(
unsigned localIndex);
207 return m_theAssociatedCloud;
213 return m_theAssociatedCloud;
A generic 3D point cloud with index-based and presistent access to points.
A very simple point cloud (no point duplication)
void setPointScalarValue(unsigned pointIndex, ScalarType value) override
Sets the ith point associated scalar value.
virtual ScalarType getCurrentPointScalarValue() const
Returns the current point associated scalar value.
virtual void swap(unsigned i, unsigned j)
Swaps two point references.
bool enableScalarField() override
Enables the scalar field associated to the cloud.
unsigned char testVisibility(const CCVector3 &P) const override
BoundingBox m_bbox
Bounding-box.
std::vector< unsigned int > ReferencesContainer
Container of 3D point indexes.
std::atomic< unsigned > m_globalIterator
Iterator on the point references container.
void getPoint(unsigned index, CCVector3 &P) const override
Returns the ith point.
std::mutex m_mutex
For concurrent access.
void placeIteratorAtBeginning() override
Sets the cloud iterator at the beginning.
virtual unsigned getCurrentPointGlobalIndex() const
Returns the global index of the point pointed by the current element.
virtual const GenericIndexedCloudPersist * getAssociatedCloud() const
Returns the associated (source) cloud (const version)
virtual GenericIndexedCloudPersist * getAssociatedCloud()
Returns the associated (source) cloud.
unsigned size() const override
Returns the number of points.
void invalidateBoundingBox()
Invalidates the bounding-box.
const CCVector3 * getNextPoint() override
Returns the next point (relatively to the global iterator position)
virtual void removeCurrentPointGlobalIndex()
Removes current element.
ReferencesContainer m_theIndexes
Indexes of (some of) the associated cloud points.
virtual unsigned getPointGlobalIndex(unsigned localIndex) const
GenericIndexedCloudPersist * m_theAssociatedCloud
Associated cloud.
virtual unsigned capacity() const
Returns max capacity.
virtual void setCurrentPointScalarValue(ScalarType value)
Sets the current point associated scalar value.
void getPoint(unsigned index, double P[3]) const override
const CCVector3 * getPointPersistentPtr(unsigned index) override
Returns the ith point as a persistent pointer.
~ReferenceCloud() override=default
Destructor.
bool isScalarFieldEnabled() const override
Returns true if the scalar field is enabled, false otherwise.
const CCVector3 * getPoint(unsigned index) const override
Returns the ith point.
ScalarType getPointScalarValue(unsigned pointIndex) const override
Returns the ith point associated scalar value.
virtual void forwardIterator()
Forwards the local element iterator.
Generic file read and write utility for python interface.
void swap(cloudViewer::core::SmallVectorImpl< T > &LHS, cloudViewer::core::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.