ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CCGeom.cpp File Reference
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <CVGeom.h>
Include dependency graph for CCGeom.cpp:

Go to the source code of this file.

Macros

#define DEFINE_VECTOR2TPL_TYPE(cppname, pyname, type_)
 
#define DEFINE_TUPLE3TPL(cppname, pyname, type_)
 
#define DEFINE_CCVECTOR3(cppname, pyname, type_)
 

Functions

void define_CCGeom (py::module &cccorelib)
 

Macro Definition Documentation

◆ DEFINE_CCVECTOR3

#define DEFINE_CCVECTOR3 (   cppname,
  pyname,
  type_ 
)
Value:
py::class_<cppname, Tuple3Tpl<type_>>(cccorelib, pyname) \
.def(py::init<>()) \
.def(py::init<type_, type_, type_>()) \
.def("__mul__", [](const cppname &self, PointCoordinateType val) { return self * val; }) \
.def("__sub__", [](const cppname &self, const cppname &other) { return self - other; }) \
.def("__div__", &cppname::operator/) \
.def("__add__", [](const cppname &self, const cppname &other) { return self + other; }) \
.def("__repr__", \
[](const cppname &self) \
{ \
return std::string("<") + pyname + "(" + std::to_string(self.x) + ", " + \
std::to_string(self.y) + ", " + std::to_string(self.z) + ")>"; \
});
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
std::string to_string(const T &n)
Definition: Common.h:20

Definition at line 123 of file CCGeom.cpp.

◆ DEFINE_TUPLE3TPL

#define DEFINE_TUPLE3TPL (   cppname,
  pyname,
  type_ 
)

Definition at line 72 of file CCGeom.cpp.

◆ DEFINE_VECTOR2TPL_TYPE

#define DEFINE_VECTOR2TPL_TYPE (   cppname,
  pyname,
  type_ 
)

Definition at line 17 of file CCGeom.cpp.

Function Documentation

◆ define_CCGeom()

void define_CCGeom ( py::module &  cccorelib)

Definition at line 138 of file CCGeom.cpp.

References DEFINE_CCVECTOR3, DEFINE_TUPLE3TPL, and DEFINE_VECTOR2TPL_TYPE.

Referenced by define_cccorelib().