ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvIndexedTransformationBuffer.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 "ecvBBox.h"
12 #include "ecvHObject.h"
14 
15 // system
16 #include <float.h>
17 
20  : public ccHObject,
21  public std::vector<ccIndexedTransformation> {
22 public:
24  ccIndexedTransformationBuffer(QString name = QString("Trans. buffer"));
27 
28  // inherited from ccHObject
29  virtual CV_CLASS_ENUM getClassID() const override {
31  }
32  virtual bool isSerializable() const override { return true; }
33 
35 
37  void sort();
38 
40 
52  bool findNearest(double index,
53  const ccIndexedTransformation*& trans1,
54  const ccIndexedTransformation*& trans2,
55  size_t* trans1IndexInBuffer = 0,
56  size_t* trans2IndexInBuffer = 0) const;
57 
60 
70  double index,
72  double maxIndexDistForInterpolation = DBL_MAX) const;
73 
76  bool triherdonsShown() { return m_showTrihedrons; }
79  void showTriherdons(bool state) { m_showTrihedrons = state; }
80 
82  float triherdonsDisplayScale() { return m_trihedronsScale; }
84  void setTriherdonsDisplayScale(float scale) { m_trihedronsScale = scale; }
85 
88  bool isPathShonwAsPolyline() { return m_showAsPolyline; }
91  void showPathAsPolyline(bool state) { m_showAsPolyline = state; }
92 
94 
97 
98  // Inherited from ccHObject
99  virtual ccBBox getOwnBB(bool withGLFeatures = false) override;
100 
101 protected:
102  // inherited from ccHObject
103  bool toFile_MeOnly(QFile& out, short dataVersion) const override;
104  short minimumFileVersion_MeOnly() const override;
105  bool fromFile_MeOnly(QFile& in,
106  short dataVersion,
107  int flags,
108  LoadedIDMap& oldToNewIDMap) override;
109 
112 
115 
122 };
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
#define CV_DB_LIB_API
Definition: CV_db.h:15
std::string name
Bounding box structure.
Definition: ecvBBox.h:25
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
bool findNearest(double index, const ccIndexedTransformation *&trans1, const ccIndexedTransformation *&trans2, size_t *trans1IndexInBuffer=0, size_t *trans2IndexInBuffer=0) const
Returns the nearest indexed transformation(s) to a given index.
size_t m_bBoxValidSize
Bounding box last 'validity' size.
bool getInterpolatedTransformation(double index, ccIndexedTransformation &trans, double maxIndexDistForInterpolation=DBL_MAX) const
bool m_showTrihedrons
Whether trihedrons should be displayed or not.
virtual ccBBox getOwnBB(bool withGLFeatures=false) override
Returns the entity's own bounding-box.
ccIndexedTransformationBuffer(QString name=QString("Trans. buffer"))
Default constructor.
ccIndexedTransformationBuffer(const ccIndexedTransformationBuffer &buffer)
Copy constructor.
void sort()
Sorts transformations based on their index.
virtual bool isSerializable() const override
Returns whether object is serializable of not.
float m_trihedronsScale
Trihedrons display scale.
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
void invalidateBoundingBox()
Invalidates the bounding box.
short minimumFileVersion_MeOnly() const override
bool m_showAsPolyline
Whether the path should be displayed as a polyline or not.
void setTriherdonsDisplayScale(float scale)
[Display option] Sets trihedron display size
float triherdonsDisplayScale()
[Display option] Returns trihedron display size
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
@ TRANS_BUFFER
Definition: CVTypes.h:144