COGS
Computer Graphics Structures library
C_PointCloud.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef COGS_C_POINT_CLOUD_H
7 #define COGS_C_POINT_CLOUD_H
8 #include <glm/glm.hpp>
9 #include <COGS/DataType.h>
10 #include <COGS/API.h>
11 
12 namespace cogs
13 {
14  // forward declaration of PointCloud class
15  class PointCloud;
16 
17  //forward declaration of cogs::PointCloudProperty structure
18  struct PointCloudProperty;
19 }
20 
21 namespace cogs
22 {
23 
27  class COGS_API C_PointCloud
28  {
29  public:
30 
32  C_PointCloud();
34  virtual ~C_PointCloud();
35 
37  C_PointCloud(const C_PointCloud &source);
39  C_PointCloud &operator=(const C_PointCloud &source);
41  C_PointCloud(C_PointCloud &&) noexcept = default;
43  C_PointCloud &operator=(C_PointCloud &&) noexcept = default;
44 
46  virtual bool Import(const char *filename);
48  virtual bool Export(const char *filename) const;
49 
51  virtual void Resize(uint32_t new_size);
53  virtual uint32_t GetSize() const;
55  virtual void Reserve(uint32_t new_capacity);
57  uint32_t GetCapacity() const;
59  virtual void ShrinkToFit();
61  void Clear();
72  virtual void Erase(const uint32_t *ids_to_erase, size_t count);
81  virtual void Append(const C_PointCloud &pc);
82 
89  glm::vec3 *GetPositions();
96  const glm::vec3 *GetPositions() const;
97 
104  bool HasNormals() const;
111  glm::vec3 *GetNormals();
118  const glm::vec3 *GetNormals() const;
125  void AddNormals();
133  float *GetIntensities();
140  const float *GetIntensities() const;
147  void AddIntensities();
148 
150  size_t GetPropertyCount() const;
152  const cogs::PointCloudProperty *GetProperties() const;
153 
162  const cogs::PointCloudProperty AddProperty(const char *key, DataType type);
171  const cogs::PointCloudProperty AddProperty(const char *key, size_t bytes_per_point);
173  void RemoveProperty(const char *key);
175  bool HasProperty(const char *key) const;
177  PointCloudProperty GetProperty(const char *key);
179  const PointCloudProperty GetProperty(const char *key) const;
180 
182  virtual void Transform(const glm::mat4 &transform);
183 
184  protected:
187 
189  PointCloud &GetPointCloud();
191  const PointCloud &GetPointCloud() const;
192 
194  void MakeCloneOf(const C_PointCloud &source);
195 
196  private:
197  struct Impl;
198  Impl *m = nullptr;
199  };
200 
201 }
202 
203 
204 #endif /* !COGS_C_POINT_CLOUD_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
Adapter for cogs::PointCloud structure.
Definition: C_PointCloud.h:27
Class used for effective management of transformation matrix by handling translation, rotation and scaling separately.
Definition: Transform.h:26
Management class for a set of data points in a 3D space.
Definition: PointCloud.h:32
Type used to store information about property.
Definition: PointCloudProperty.h:14
DataType
Identifier of data types.
Definition: DataType.h:11