29 if (m_normals.capacity() < newCount) {
31 m_normals.reserve(newCount);
32 }
catch (
const std::bad_alloc&) {
41 bool resize(
unsigned newCount)
override {
47 if (m_normals.capacity() != 0) {
49 m_normals.resize(newCount);
50 }
catch (
const std::bad_alloc&) {
62 assert(m_normals.size() < m_normals.capacity());
63 m_normals.push_back(N);
67 std::vector<CCVector3>&
normals() {
return m_normals; }
70 const std::vector<CCVector3>&
normals()
const {
return m_normals; }
74 return !m_normals.empty() && m_normals.size() >=
size();
77 return &m_normals[pointIndex];
const std::vector< CCVector3 > & normals() const
Returns the set of normals (const version)
bool reserveNormals(unsigned newCount)
Reserves memory to store the normals.
bool resize(unsigned newCount) override
Resizes the point database.
~PointCloud() override=default
Default destructor.
std::vector< CCVector3 > m_normals
Point normals (if any)
PointCloud()=default
Default constructor.
const CCVector3 * getNormal(unsigned pointIndex) const override
If per-point normals are available, returns the one at a specific index.
void addNormal(const CCVector3 &N)
Adds a normal.
bool normalsAvailable() const override
Returns whether normals are available.
std::vector< CCVector3 > & normals()
Returns the set of normals.
Generic file read and write utility for python interface.