ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccIndexedTransformation.cpp
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 #include <pybind11/pybind11.h>
9 #include <pybind11/stl.h>
10 #include <pybind11/stl_bind.h>
11 
13 
14 #include "../casters.h"
15 
16 namespace py = pybind11;
17 using namespace pybind11::literals;
18 
19 void define_ccIndexedTransformation(py::module &m)
20 {
21  py::class_<ccIndexedTransformation, ccGLMatrix>(m, "ccIndexedTransformation")
22  .def(py::init<>())
23  .def("getIndex", &ccIndexedTransformation::getIndex)
24  .def("setIndex", &ccIndexedTransformation::setIndex, "index"_a)
25  .def_static("Interpolate",
27  "interpIndex"_a,
28  "trans1"_a,
29  "trans2"_a)
30  .def(py::self * py::self)
31  .def(py::self *= py::self)
32  .def("__iadd__",
33  [](ccIndexedTransformation &self, const CCVector3 &T) { return self += T; })
34  .def("__isub__",
35  [](ccIndexedTransformation &self, const CCVector3 &T) { return self -= T; })
36  .def("transposed", &ccIndexedTransformation::transposed)
37  .def("inverse", &ccIndexedTransformation::inverse);
38 }
void define_ccIndexedTransformation(py::module &m)
double getIndex() const
Returns associated index (e.g. timestamp)
void setIndex(double index)
Sets associated index (e.g. timestamp)
ccIndexedTransformation transposed() const
Returns transposed transformation.
ccIndexedTransformation inverse() const
Returns inverse transformation.
static ccIndexedTransformation Interpolate(double interpIndex, const ccIndexedTransformation &trans1, const ccIndexedTransformation &trans2)
Interpolates two transformations at an absolute position (index)