35 polyline(m,
"Polyline",
36 "The polyline is considered as a cloud of points "
37 "(in a specific order) with a open closed state "
39 polyline.def(py::init([](std::shared_ptr<GenericIndexedCloudPersist>
43 "Polyline constructor",
"associated_cloud"_a)
47 "cloudViewer::Polyline with {} points and is "
53 "Returns whether the polyline is closed or not.")
55 "Sets whether the polyline is closed or not.",
"state"_a);
60 py::class_<ccPolyline, PyGeometry<ccPolyline>, std::shared_ptr<ccPolyline>,
62 pyply(m,
"ccPolyline", py::multiple_inheritance(),
63 "Colored polyline, Extends the cloudViewer::Polyline class.");
64 py::detail::bind_copy_functions<ccPolyline>(pyply);
69 pyply.def(py::init([](std::shared_ptr<ccPointCloud> cloud) {
76 "cloud -> the associated point cloud (i.e. the vertices)",
80 bool is2D = polyline.is2DMode();
83 "ccPolyline with segment count {}, length {} and "
85 polyline.segmentCount(),
length,
86 is2D ?
"True" :
"False");
89 .def(py::self + py::self)
90 .def(py::self += py::self)
94 "Defines if the polyline is considered as 2D or 3D.",
97 "Returns whether the polyline is considered as 2D or 3D.")
99 "Defines if the polyline is considered as processed polyline.",
102 "Returns whether the polyline is considered as 2D or 3D.")
104 "Sets the width of the line.",
"width"_a)
106 "Returns the width of the line.")
108 "Computes the polyline length.")
110 " Returns the number of segments.")
112 " Assigns each line in the polyline the same color.",
119 "Sets the polyline color.",
"color"_a)
125 "Returns the polyline color.")
130 std::vector<ccPolyline*> parts;
131 bool success = polyline.split(max_edge_length, parts);
132 std::vector<std::shared_ptr<ccPolyline>> outParts;
133 for (
size_t i = 0; i < parts.size(); ++i) {
135 std::shared_ptr<ccPolyline>(parts[i]));
137 return std::make_tuple(outParts, success);
139 "Splits the polyline into several parts based on a maximum "
143 "Returns arrow index.")
145 "Returns arrow length.")
147 "Whether the polyline vertices should be displayed or not.")
149 "Sets whether to display or hide the polyline vertices.",
152 "Returns the width of vertex markers.")
154 "Sets the width of vertex markers.",
"width"_a)
160 return polyline.initWith(cloud, other_polyline);
162 "Initializes the polyline with a given set of vertices and "
163 "the parameters of another polyline",
164 "vertices"_a,
"other_polyline"_a)
166 "import_parameters_from",
168 polyline.importParametersFrom(other_polyline);
170 "Copy the parameters from another polyline",
173 "Shows an arrow in place of a given vertex.",
"state"_a,
174 "vertex_index"_a,
"length"_a)
178 double sampling_parameter,
bool with_rgb) {
180 density_based, sampling_parameter, with_rgb);
181 return std::shared_ptr<ccPointCloud>(sampledCloud);
183 "Samples points on the polyline",
"density_based"_a,
184 "sampling_parameter"_a,
"with_rgb"_a);
196 {{
"color",
"The polyline rgb color."}});
199 {{
"width",
"The polyline width."}});
201 m,
"ccPolyline",
"split",
203 "maximum edge length "
204 "(warning output polylines set (parts) may be "
205 "empty if all the vertices are too far from each other!)"}});
213 m,
"ccPolyline",
"init_with",
215 "set of vertices (can be null, in which case the polyline "
216 "vertices will be cloned)."},
217 {
"other_polyline",
"The other polyline."}});
219 m,
"ccPolyline",
"import_parameters_from",
220 {{
"other_polyline",
"The other polyline."}});
222 {{
"state",
"The state."},
223 {
"vertex_index",
"The vertex index."},
224 {
"length",
"The length."}});
226 m,
"ccPolyline",
"sample_points",
227 {{
"density_based",
"The density based."},
228 {
"sampling_parameter",
"The sampling parameter."},
229 {
"with_rgb",
"with rgb."}});
232 py::class_<ccCircle, PyGeometry<ccCircle>, std::shared_ptr<ccCircle>,
234 pycircle(m,
"ccCircle", py::multiple_inheritance(),
235 "A 3D circle represented as a polyline.");
236 py::detail::bind_copy_functions<ccCircle>(pycircle);
237 pycircle.def(py::init([](
double radius,
unsigned resolution,
239 return new ccCircle(radius, resolution, uniqueID);
241 "Circle constructor",
"radius"_a = 0.0,
"resolution"_a = 48,
246 "ccCircle with radius {}, resolution {} and {} "
253 "Returns the radius of the circle.")
255 "Sets the radius of the circle.",
"radius"_a)
257 "Returns the resolution of the displayed circle.")
259 "Sets the resolution of the displayed circle.",
"resolution"_a)
263 return std::shared_ptr<ccCircle>(circle.
clone());
265 "Clones this circle.");
269 {{
"radius",
"The desired radius."}});
272 m,
"ccCircle",
"set_resolution",
273 {{
"resolution",
"The displayed resolution (>= 4)."}});
float PointCoordinateType
Type of the coordinates of a (N-D) point.
filament::Texture::InternalFormat format
ccCircle * clone() const
Clones this circle.
double getRadius() const
Returns the radius of the circle.
unsigned getResolution() const
Returns the resolution of the displayed circle.
void setRadius(double radius)
Sets the radius of the circle.
void setResolution(unsigned resolution)
Sets the resolution of the displayed circle.
Hierarchical CLOUDVIEWER Object.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
void setTransformFlag(bool state)
Defines if the polyline is considered as processed polyline.
ccPolyline & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each line in the LineSet the same color.
PointCoordinateType computeLength() const
Computes the polyline length.
PointCoordinateType getArrowLength() const
bool verticesShown() const
Whether the polyline vertices should be displayed or not.
void set2DMode(bool state)
Defines if the polyline is considered as 2D or 3D.
bool needTransform() const
Returns whether the polyline is considered as 2D or 3D.
bool is2DMode() const
Returns whether the polyline is considered as 2D or 3D.
void showArrow(bool state, unsigned vertIndex, PointCoordinateType length)
Shows an arrow in place of a given vertex.
void setVertexMarkerWidth(int width)
Sets the width of vertex markers.
unsigned getArrowIndex() const
void showVertices(bool state)
Sets whether to display or hide the polyline vertices.
bool add(const ccPointCloud &cloud)
Add another reference cloud.
unsigned segmentCount() const
Returns the number of segments.
PointCoordinateType getWidth() const
Returns the width of the line.
int getVertexMarkerWidth() const
Returns the width of vertex markers.
void setWidth(PointCoordinateType width)
Sets the width of the line.
static constexpr unsigned InvalidUniqueID
void setClosed(bool state)
Sets whether the polyline is closed or not.
bool isClosed() const
Returns whether the polyline is closed or not.
A very simple point cloud (no point duplication)
unsigned size() const override
Returns the number of points.
constexpr static RgbTpl FromEigen(const Eigen::Vector3d &t)
static Eigen::Vector3d ToEigen(const Type col[3])
__host__ __device__ float length(float2 v)
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
void pybind_polyline(py::module &m)
void pybind_polyline_methods(py::module &m)
Generic file read and write utility for python interface.