ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccCone.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 
14 #include "../casters.h"
15 
16 namespace py = pybind11;
17 using namespace pybind11::literals;
18 
19 void define_ccCone(py::module &m)
20 {
21  py::class_<ccCone, ccGenericPrimitive>(m, "ccCone", R"doc(
22  ccCone
23 
24  Parameters
25  ----------
26  bottomRadius : PointCoordinateType
27  topRadius : PointCoordinateType
28  height : PointCoordinateType
29  cone height (transformation should point to the axis center)
30  xOff : PointCoordinateType, default = 0
31  displacement of axes along X-axis (Snout mode)
32  yOff : PointCoordinateType, default = 0
33  displacement of axes along Y-axis (Snout mode)
34  transMat : , optional
35  optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)
36  name : str, default: Sphere
37  name of the sphere object
38  precision : int, default: 24
39  drawing precision (angular step = 360/precision)
40  uniqueID : int, optional
41  unique ID (handle with care)
42 
43  Example
44  -------
45 
46  .. code:: Python
47 
48  cone = pycc.ccCone(10.0, 5.0, 20.0)
49 )doc")
50  .def(
51  py::init<PointCoordinateType,
56  const ccGLMatrix *,
57  QString,
58  unsigned>(),
59  "bottomRadius"_a,
60  "topRadius"_a,
61  "height"_a,
62  "xOff"_a = 0,
63  "yOff"_a = 0,
64  "transMat"_a = nullptr,
65  "name"_a = QString("Cone"),
66  "precision"_a = []() { return ccCone::DEFAULT_DRAWING_PRECISION; }())
67  .def("getHeight", &ccCone::getHeight)
68  .def("setHeight", &ccCone::setHeight, "height"_a)
69  .def("getBottomRadius", &ccCone::getBottomRadius)
70  .def("setBottomRadius", &ccCone::setBottomRadius, "radius"_a)
71  .def("getTopRadius", &ccCone::getTopRadius)
72  .def("setTopRadius", &ccCone::setTopRadius, "radius"_a)
73  .def("getBottomCenter", &ccCone::getBottomCenter)
74  .def("getTopCenter", &ccCone::getTopCenter)
75  .def("getSmallCenter", &ccCone::getSmallCenter)
76  .def("getLargeCenter", &ccCone::getLargeCenter)
77  .def("getSmallRadius", &ccCone::getSmallRadius)
78  .def("getLargeRadius", &ccCone::getLargeRadius)
79  .def("isSnoutMode", &ccCone::isSnoutMode);
80 }
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
void define_ccCone(py::module &m)
Definition: ccCone.cpp:19
PointCoordinateType getTopRadius() const
Returns top radius.
Definition: ecvCone.h:70
virtual CCVector3 getLargeCenter() const
Returns cone axis end point associated with whichever radii is larger.
static const unsigned DEFAULT_DRAWING_PRECISION
Default drawing precision.
Definition: ecvCone.h:21
virtual PointCoordinateType getLargeRadius() const
Returns whichever cone radii is larger.
virtual CCVector3 getTopCenter() const
Returns cone axis top end point after applying transformation.
PointCoordinateType getHeight() const
Returns height.
Definition: ecvCone.h:52
virtual PointCoordinateType getSmallRadius() const
Returns whichever cone radii is smaller.
virtual bool isSnoutMode() const
Returns true if the Cone was created in snout mode.
Definition: ecvCone.h:94
virtual void setTopRadius(PointCoordinateType radius)
Sets top radius.
virtual CCVector3 getSmallCenter() const
Returns cone axis end point associated with whichever radii is smaller.
PointCoordinateType getBottomRadius() const
Returns bottom radius.
Definition: ecvCone.h:60
void setHeight(PointCoordinateType height)
Sets height.
virtual CCVector3 getBottomCenter() const
Returns cone axis bottom end point after applying transformation.
virtual void setBottomRadius(PointCoordinateType radius)
Sets bottom radius.
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19