expose Geometry::getTag to Python

This commit is contained in:
wmayer
2017-04-08 16:56:59 +02:00
parent 8c40bb0ca2
commit aae7ebef24
2 changed files with 14 additions and 0 deletions

View File

@@ -55,5 +55,11 @@ means that it is not part of a later built shape.</UserDocu>
</Documentation>
<Parameter Name="Construction" Type="Boolean"/>
</Attribute>
<Attribute Name="Tag" ReadOnly="true">
<Documentation>
<UserDocu>Gives the tag of the geometry as string.</UserDocu>
</Documentation>
<Parameter Name="Tag" Type="String"/>
</Attribute>
</PythonExport>
</GenerateModel>

View File

@@ -35,6 +35,8 @@
# include <Standard_Failure.hxx>
#endif
#include <boost/uuid/uuid_io.hpp>
#include <Base/GeometryPyCXX.h>
#include <Base/Matrix.h>
#include <Base/MatrixPy.h>
@@ -221,6 +223,12 @@ void GeometryPy::setConstruction(Py::Boolean arg)
getGeometryPtr()->Construction = arg;
}
Py::String GeometryPy::getTag(void) const
{
std::string tmp = boost::uuids::to_string(getGeometryPtr()->getTag());
return Py::String(tmp);
}
PyObject *GeometryPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;