43 #include <pybind11/include/pybind11/pybind11.h> 44 #include <pybind11/include/pybind11/embed.h> 47 #include <MeshObjectInfoPlugin.hh> 51 #include <OpenFlipper/BasePlugin/PythonFunctions.hh> 52 #include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh> 58 PYBIND11_EMBEDDED_MODULE(InfoMeshObject, m) {
60 QObject* pluginPointer = getPluginPointer(
"InfoMeshObject");
63 std::cerr <<
"Error Getting plugin pointer for Plugin-InfoMeshObject" << std::endl;
70 std::cerr <<
"Error converting plugin pointer for Plugin-InfoMeshObject" << std::endl;
76 py::class_< InfoMeshObjectPlugin,std::unique_ptr<InfoMeshObjectPlugin, py::nodelete> > info(m,
"InfoMeshObject");
81 info.def(py::init([plugin]() {
return plugin; }));
85 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get total number of verticies of a given object").toLatin1().data(),
86 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
89 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get total number of edges of a given object").toLatin1().data(),
90 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
93 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get total number of faces of a given object").toLatin1().data(),
94 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
97 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get total number of boundaries of a given object").toLatin1().data(),
98 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
101 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get total number of components of a given object").toLatin1().data(),
102 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
105 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get the genus of a given object").toLatin1().data(),
106 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
109 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get the center of gravity of a given object").toLatin1().data(),
110 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
113 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get minimum point of the axis-aligned bounding box").toLatin1().data(),
114 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
117 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get maximum point of the axis-aligned bounding box").toLatin1().data(),
118 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
121 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"get the size of the axis-aligned bounding box").toLatin1().data(),
122 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
126 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the length of an edge").toLatin1().data(),
127 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()),
128 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the edge").toLatin1().data()));
131 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the area of a face").toLatin1().data(),
132 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()),
133 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the face").toLatin1().data()));
136 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the aspect ratio of a face").toLatin1().data(),
137 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()),
138 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the face").toLatin1().data()));
141 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the valence of a vertex").toLatin1().data(),
142 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()),
143 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the vertex").toLatin1().data()));
146 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the minimal edge length of an object").toLatin1().data(),
147 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
150 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the maximal edge length of an object").toLatin1().data(),
151 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
154 QCoreApplication::translate(
"PythonDocInfoMeshObject",
"Get the mean edge length of an object").toLatin1().data(),
155 py::arg(QCoreApplication::translate(
"PythonDocInfoMeshObject",
"ID of the object").toLatin1().data()));
Plugin to visualize information about objects in the scene.
double meanEdgeLength(int _id)
get the mean edge length
int vertexCount(int _id)
get total number of vertices for a given object
Vector cog(int _id)
get the center of gravity
double aspectRatio(int _id, int _faceHandle)
get the aspect ratio of a face
double maxEdgeLength(int _id)
get the maximal edge length
int vertexValence(int _id, int _vertexHandle)
get vertex valence
double edgeLength(int _id, int _edgeHandle)
get the length of an edge
int boundaryCount(int _id)
get the number of boundaries for a given object
double faceArea(int _id, int _faceHandle)
get the area of a face
int edgeCount(int _id)
get total number of edges for a given object
Vector boundingBoxMax(int _id)
get maximum bounding box point
int faceCount(int _id)
get total number of faces for a given object
Vector boundingBoxSize(int _id)
get the size of the bounding box
Vector boundingBoxMin(int _id)
get minumum bounding box point
int componentCount(int _id)
get the number of components for a given object
double minEdgeLength(int _id)
get the minimal edge length
int genus(int _id)
get the genus of the given object