App: [skip ci] add GeoFeaturePy::getPropertyOfGeometry
This commit is contained in:
@@ -33,6 +33,17 @@ for a mesh the value Mesh and so on.
|
||||
If an object has no such property then None is returned.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getPropertyOfGeometry">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the property of the actual geometry or None.
|
||||
For example for a part object it returns its Shape property,
|
||||
for a mesh its Mesh property and so on.
|
||||
If an object has no such property then None is returned.
|
||||
Unlike to getPropertyNameOfGeometry this function returns the geometry,
|
||||
not its name.
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<CustomAttributes />
|
||||
</PythonExport>
|
||||
</GenerateModel>
|
||||
|
||||
@@ -62,7 +62,8 @@ PyObject* GeoFeaturePy::getGlobalPlacement(PyObject * args) {
|
||||
PyObject* GeoFeaturePy::getPropertyNameOfGeometry(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
GeoFeature* object = this->getGeoFeaturePtr();
|
||||
const PropertyComplexGeoData* prop = object->getPropertyOfGeometry();
|
||||
const char* name = prop ? prop->getName() : 0;
|
||||
@@ -72,6 +73,19 @@ PyObject* GeoFeaturePy::getPropertyNameOfGeometry(PyObject * args)
|
||||
return Py::new_reference_to(Py::None());
|
||||
}
|
||||
|
||||
PyObject* GeoFeaturePy::getPropertyOfGeometry(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
GeoFeature* object = this->getGeoFeaturePtr();
|
||||
const PropertyComplexGeoData* prop = object->getPropertyOfGeometry();
|
||||
if (prop) {
|
||||
return const_cast<PropertyComplexGeoData*>(prop)->getPyObject();
|
||||
}
|
||||
return Py::new_reference_to(Py::None());
|
||||
}
|
||||
|
||||
PyObject *GeoFeaturePy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user