8 #include <pybind11/pybind11.h>
9 #include <pybind11/stl.h>
10 #include <pybind11/stl_bind.h>
16 #include "../casters.h"
19 using namespace pybind11::literals;
23 py::class_<cc2DLabel, ccHObject, ccInteractor> Pycc2DLabel(m,
"cc2DLabel");
24 Pycc2DLabel.def(py::init<QString>(),
"name"_a = QString(
"Label"));
29 Pycc2DLabel.def(
"getPosition",
33 pos[0] =
self.getPosition()[0];
34 pos[1] =
self.getPosition()[1];
38 "clear", &
cc2DLabel::clear,
"ignoreDependencies"_a =
false,
"ignoreCaption"_a =
true);
40 Pycc2DLabel.def(
"addPickedPoint",
45 "entityCenter"_a =
false);
46 Pycc2DLabel.def(
"addPickedPoint",
52 "entityCenter"_a =
false);
61 py::class_<cc2DLabel::PickedPoint>(Pycc2DLabel,
"PickedPoint")
69 .def(
"cloudOrVertices",
71 py::return_value_policy::reference)
77 .def(py::init<ccGenericPointCloud *, unsigned, bool>(),
80 "centerPoint"_a =
false)
81 .def(py::init<ccGenericMesh *, unsigned, const CCVector2d &, bool>(),
85 "centerPoint"_a =
false);
87 Pycc2DLabel.def(
"addPickedPoint",
91 Pycc2DLabel.def(
"getPickedPoint",
95 Pycc2DLabel.def(
"getPickedPoint",
void define_cc2DLabel(py::module &m)
2D label (typically attached to points)
bool addPickedPoint(ccGenericPointCloud *cloud, unsigned pointIndex, bool entityCenter=false)
Adds a point to this label.
const PickedPoint & getPickedPoint(unsigned index) const
Returns a given point.
QString getTitle(int precision) const
Returns the (3D) label title.
bool isCollapsed() const
Returns whether the label is collapsed or not.
QString getRawName() const
Returns 'raw' name (no replacement of default keywords)
void clear(bool ignoreDependencies=false, bool ignoreCaption=true)
Clears label.
void setRelativeMarkerScale(float scale)
Sets marker (relative) scale.
void setCollapsed(bool state)
Whether to collapse label or not.
bool isPointLegendDisplayed() const
Returns whether the point(s) legend is displayed.
void setDisplayedIn2D(bool state)
Whether to display the label in 2D.
unsigned size() const
Returns current size.
QStringList getLabelContent(int precision) const
Gets label content (as it will be displayed)
void setPosition(float x, float y)
Sets relative position.
bool isDisplayedIn2D() const
Returns whether the label is displayed in 2D.
void displayPointLegend(bool state)
Whether to display the point(s) legend (title only)
A 3D cloud interface with associated features (color, normals, octree, etc.)
CCVector2d uv
Barycentric coordinates (for triangles)
CCVector3 getPointPosition() const
Returns the point position (3D)
unsigned index
Point/triangle index.
QString itemTitle() const
ccGenericPointCloud * cloudOrVertices() const
Returns the cloud or the mesh vertices.
ccGenericMesh * mesh
Mesh.
ccHObject * entity() const
Returns the associated entity (cloud or mesh)
bool entityCenterPoint
Entity center mode (index will be invalid)
CCVector3d pos2D
Last known '2D' position (i.e. in screen space)
ccGenericPointCloud * cloud
Cloud.
QString prefix(const char *pointTag) const
Returns the point prefix ('Point' or 'Point@Tri' or 'IDXX Center')
unsigned getUniqueID() const
Returns the cloud or the mesh unique ID.