ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccGenericPrimitive.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 
12 #include <ecvGLMatrix.h>
13 #include <ecvGenericPrimitive.h>
14 #include <ecvMesh.h>
15 
16 #include "../casters.h"
17 
18 namespace py = pybind11;
19 using namespace pybind11::literals;
20 
21 void define_ccGenericPrimitive(py::module &m)
22 {
23  py::class_<ccGenericPrimitive, ccMesh>(m, "ccGenericPrimitive")
24  .def("getTypeName", &ccGenericPrimitive::getTypeName)
25  .def("clone", &ccGenericPrimitive::getTypeName)
26  .def("setColor", &ccGenericPrimitive::setColor, "col"_a)
27  .def("hasDrawingPrecision", &ccGenericPrimitive::hasDrawingPrecision)
28  .def("setDrawingPrecision", &ccGenericPrimitive::setDrawingPrecision, "steps"_a)
29  .def("getDrawingPrecision", &ccGenericPrimitive::getDrawingPrecision)
30  .def("getTransformation",
31  (const ccGLMatrix &(ccGenericPrimitive::*)()
33 }
void define_ccGenericPrimitive(py::module &m)
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
Generic primitive interface.
virtual QString getTypeName() const =0
Returns type name (sphere, cylinder, etc.)
virtual bool setDrawingPrecision(unsigned steps)
Sets drawing precision.
virtual void setColor(const ecvColor::Rgb &col)
Sets primitive color (shortcut)
virtual unsigned getDrawingPrecision() const
Returns drawing precision (or 0 if feature is not supported)
virtual bool hasDrawingPrecision() const
Whether drawing is dependent on 'precision' parameter.
virtual ccGLMatrix & getTransformation()
Returns the transformation that is currently applied to the vertices.