ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccSphere.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 <ecvSphere.h>
13 
14 #include "../casters.h"
15 
16 namespace py = pybind11;
17 using namespace pybind11::literals;
18 
19 void define_ccSphere(py::module &m)
20 {
21  py::class_<ccSphere, ccGenericPrimitive>(m, "ccSphere", R"doc(
22  ccSphere
23 
24  Parameters
25  ----------
26  radius : PointCoordinateType
27  radius of the sphere
28  transMat : , optional
29  optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)
30  name : str, default: Sphere
31  name of the sphere object
32  precision : int, default: 24
33  drawing precision (angular step = 360/precision)
34  uniqueID : int, optional
35  unique ID (handle with care)
36 
37  Example
38  -------
39 
40  .. code:: Python
41 
42  sphere = pycc.ccSphere(3.0)
43  sphere2 = pycc.ccSphere(5.0, name="Sphere2")
44 )doc")
45  .def(py::init<PointCoordinateType, const ccGLMatrix *, QString, unsigned>(),
46  "radius"_a,
47  "transMat"_a = nullptr,
48  "name"_a = QString("Sphere"),
49  "precision"_a = 24)
50  .def("getRadius", &ccSphere::getRadius)
51  .def("setRadius", &ccSphere::setRadius, "radius"_a);
52 }
void define_ccSphere(py::module &m)
Definition: ccSphere.cpp:19
void setRadius(PointCoordinateType radius)
Sets radius.
PointCoordinateType getRadius() const
Returns radius.
Definition: ecvSphere.h:45