ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccCylinder.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 <ecvCone.h>
13 #include <ecvCylinder.h>
14 
15 #include "../casters.h"
16 
17 namespace py = pybind11;
18 using namespace pybind11::literals;
19 
20 void define_ccCylinder(py::module &m)
21 {
22  py::class_<ccCylinder, ccCone>(m, "ccCylinder", R"doc(
23  ccCylinder
24 
25  Parameters
26  ----------
27  radius : PointCoordinateType
28  height : PointCoordinateType
29  transMat : , optional
30  optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)
31  name : str, default: Sphere
32  name of the sphere object
33  precision : int, default: 24
34  drawing precision (angular step = 360/precision)
35  uniqueID : int, optional
36  unique ID (handle with care)
37 
38  Example
39  -------
40 
41  .. code:: Python
42 
43  cylinder = pycc.ccCylinder(3.0, 10.0)
44  cylinder2 = pycc.ccCylinder(radius=5.0, height=50, name="Cylinder2")
45 )doc")
46  .def(
47  py::init<PointCoordinateType,
49  const ccGLMatrix *,
50  QString,
51  unsigned>(),
52  "radius"_a,
53  "height"_a,
54  "transMat"_a = nullptr,
55  "name"_a = QString("Cylinder"),
56  "precision"_a = []() { return ccCylinder::DEFAULT_DRAWING_PRECISION; }())
57  .def("getRadius", &ccCylinder::getBottomRadius)
58  .def("setRadius", &ccCylinder::setBottomRadius, "radius"_a);
59 }
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
void define_ccCylinder(py::module &m)
Definition: ccCylinder.cpp:20
PointCoordinateType getBottomRadius() const
Returns bottom radius.
Definition: ecvCone.h:60
static const unsigned DEFAULT_DRAWING_PRECISION
Default drawing precision.
Definition: ecvCylinder.h:21
virtual void setBottomRadius(PointCoordinateType radius) override
Sets bottom radius.
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19