ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
GenericIndexedCloud.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Local
11 #include "GenericCloud.h"
12 
13 namespace cloudViewer {
14 
16 
19 public:
21  ~GenericIndexedCloud() override = default;
22 
24 
36  virtual const CCVector3* getPoint(unsigned index) const = 0;
37 
39 
44  virtual void getPoint(unsigned index, CCVector3& P) const = 0;
45  virtual void getPoint(unsigned index, double P[3]) const {
46  const CCVector3* pt = getPoint(index);
47  P[0] = pt->x;
48  P[1] = pt->y;
49  P[2] = pt->z;
50  };
51 
53  virtual bool normalsAvailable() const { return false; }
54 
56 
59  virtual const CCVector3* getNormal(unsigned index) const {
60  (void)index;
61  return nullptr;
62  }
63 };
64 
65 } // namespace cloudViewer
#define CV_CORE_LIB_API
Definition: CVCoreLibWin.h:15
Type y
Definition: CVGeom.h:137
Type x
Definition: CVGeom.h:137
Type z
Definition: CVGeom.h:137
A generic 3D point cloud with index-based point access.
virtual const CCVector3 * getPoint(unsigned index) const =0
Returns the ith point.
virtual void getPoint(unsigned index, CCVector3 &P) const =0
Returns the ith point.
virtual void getPoint(unsigned index, double P[3]) const
virtual bool normalsAvailable() const
Returns whether normals are available.
virtual const CCVector3 * getNormal(unsigned index) const
If per-point normals are available, returns the one at a specific index.
~GenericIndexedCloud() override=default
Default destructor.
Generic file read and write utility for python interface.