ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvIndexedTransformation.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 "ecvGLMatrix.h"
12 
16 public:
18 
22 
24 
28 
30 
33  ccIndexedTransformation(const ccGLMatrix& matrix, double index);
34 
37 
39  inline double getIndex() const { return m_index; }
40 
42  inline void setIndex(double index) { m_index = index; }
43 
45 
51  double interpIndex,
52  const ccIndexedTransformation& trans1,
53  const ccIndexedTransformation& trans2);
54 
57 
59 
62 
64 
68 
71 
73 
76 
78 
81 
82  // inherited from ccGLMatrix
83  virtual bool toAsciiFile(QString filename, int precision = 12) const;
84  virtual bool fromAsciiFile(QString filename);
85 
86  // inherited from ccSerializableObject
87  bool isSerializable() const override { return true; }
88  bool toFile(QFile& out, short dataVersion) const override;
89  short minimumFileVersion() const override;
90  bool fromFile(QFile& in,
91  short dataVersion,
92  int flags,
93  LoadedIDMap& oldToNewIDMap) override;
94 
95 protected:
97  double m_index;
98 };
std::string filename
#define CV_DB_LIB_API
Definition: CV_db.h:15
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
double getIndex() const
Returns associated index (e.g. timestamp)
ccIndexedTransformation & operator-=(const CCVector3 &T)
(in place) Translation operator
ccIndexedTransformation & operator+=(const CCVector3 &T)
(in place) Translation operator
void setIndex(double index)
Sets associated index (e.g. timestamp)
virtual bool toAsciiFile(QString filename, int precision=12) const
Saves matrix to an ASCII file.
ccIndexedTransformation transposed() const
Returns transposed transformation.
ccIndexedTransformation(const ccGLMatrix &matrix, double index)
Constructor from a transformation matrix and an index.
ccIndexedTransformation(const ccIndexedTransformation &trans)
Copy constructor.
ccIndexedTransformation operator*(const ccGLMatrix &mat) const
Multiplication by a ccGLMatrix operator.
ccIndexedTransformation(const ccGLMatrix &matrix)
Constructor from a transformation matrix.
bool toFile(QFile &out, short dataVersion) const override
Saves data to binary stream.
ccIndexedTransformation inverse() const
Returns inverse transformation.
virtual bool fromAsciiFile(QString filename)
Loads matrix from an ASCII file.
ccIndexedTransformation()
Default constructor.
bool isSerializable() const override
Returns whether object is serializable of not.
static ccIndexedTransformation Interpolate(double interpIndex, const ccIndexedTransformation &trans1, const ccIndexedTransformation &trans2)
Interpolates two transformations at an absolute position (index)
short minimumFileVersion() const override
Returns the minimum file version required to save this instance.
ccIndexedTransformation & operator*=(const ccGLMatrix &mat)
(in place) Multiplication by a ccGLMatrix operator
bool fromFile(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads data from binary stream.
double m_index
Associated index (e.g. timestamp)
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)