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 
69  bool getInterpolatedTransformation(
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 
96  void invalidateBoundingBox();
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 };
ccIndexedTransformationBuffer::m_bBox
ccBBox m_bBox
Bounding box.
Definition: ecvIndexedTransformationBuffer.h:111
ccIndexedTransformationBuffer::isPathShonwAsPolyline
bool isPathShonwAsPolyline()
Definition: ecvIndexedTransformationBuffer.h:88
ccHObject::toFile_MeOnly
virtual bool toFile_MeOnly(QFile &out, short dataVersion) const
Save own object data.
Definition: ecvHObject.cpp:1302
ccHObject::minimumFileVersion_MeOnly
virtual short minimumFileVersion_MeOnly() const
Definition: ecvHObject.cpp:1364
ccIndexedTransformationBuffer
Indexed Transformation buffer.
Definition: ecvIndexedTransformationBuffer.h:19
ccBBox
Bounding box structure.
Definition: ecvBBox.h:25
ecvBBox.h
ccIndexedTransformationBuffer::triherdonsShown
bool triherdonsShown()
Definition: ecvIndexedTransformationBuffer.h:76
ccIndexedTransformationBuffer::getClassID
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvIndexedTransformationBuffer.h:29
ccIndexedTransformationBuffer::showTriherdons
void showTriherdons(bool state)
Definition: ecvIndexedTransformationBuffer.h:79
ccIndexedTransformationBuffer::m_bBoxValidSize
size_t m_bBoxValidSize
Bounding box last 'validity' size.
Definition: ecvIndexedTransformationBuffer.h:114
CV_CLASS_ENUM
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
ccIndexedTransformationBuffer::setTriherdonsDisplayScale
void setTriherdonsDisplayScale(float scale)
[Display option] Sets trihedron display size
Definition: ecvIndexedTransformationBuffer.h:84
CV_TYPES::TRANS_BUFFER
@ TRANS_BUFFER
Definition: CVTypes.h:144
ccHObject::fromFile_MeOnly
virtual bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
Loads own object data.
Definition: ecvHObject.cpp:1371
ccIndexedTransformationBuffer::m_showTrihedrons
bool m_showTrihedrons
Whether trihedrons should be displayed or not.
Definition: ecvIndexedTransformationBuffer.h:119
ccIndexedTransformationBuffer::m_showAsPolyline
bool m_showAsPolyline
Whether the path should be displayed as a polyline or not.
Definition: ecvIndexedTransformationBuffer.h:117
ecvIndexedTransformation.h
ccIndexedTransformationBuffer::isSerializable
virtual bool isSerializable() const override
Returns whether object is serializable of not.
Definition: ecvIndexedTransformationBuffer.h:32
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
ccHObject::getOwnBB
virtual ccBBox getOwnBB(bool withGLFeatures=false)
Returns the entity's own bounding-box.
Definition: ecvHObject.cpp:757
ccIndexedTransformationBuffer::triherdonsDisplayScale
float triherdonsDisplayScale()
[Display option] Returns trihedron display size
Definition: ecvIndexedTransformationBuffer.h:82
CV_DB_LIB_API
#define CV_DB_LIB_API
Definition: CV_db.h:15
ccIndexedTransformationBuffer::showPathAsPolyline
void showPathAsPolyline(bool state)
Definition: ecvIndexedTransformationBuffer.h:91
ecvHObject.h
ccIndexedTransformationBuffer::m_trihedronsScale
float m_trihedronsScale
Trihedrons display scale.
Definition: ecvIndexedTransformationBuffer.h:121
ccIndexedTransformation
Definition: ecvIndexedTransformation.h:15
name
std::string name
Definition: FileIOFactory.cpp:129