Part: GeometryDefaultExtensions template
======================================== Generalisation of code for a default geometry extension in the form of a template. Default geometry extensions provide a standard interface for an extension having a single stored value (e.g. one int or one string). Python implementation must be provided separatedly.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
# include <sstream>
|
||||
#endif
|
||||
|
||||
#include "GeometryStringExtension.h"
|
||||
#include "GeometryDefaultExtension.h"
|
||||
|
||||
#include "GeometryStringExtensionPy.h"
|
||||
#include "GeometryStringExtensionPy.cpp"
|
||||
@@ -38,7 +38,7 @@ using namespace Part;
|
||||
std::string GeometryStringExtensionPy::representation(void) const
|
||||
{
|
||||
std::stringstream str;
|
||||
str << "<GeometryStringExtension (" << getGeometryStringExtensionPtr()->str << ") >";
|
||||
str << "<GeometryStringExtension (" << getGeometryStringExtensionPtr()->value << ") >";
|
||||
return str.str();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ int GeometryStringExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
PyErr_Clear();
|
||||
char *pstr;
|
||||
if (PyArg_ParseTuple(args, "s", &pstr)) {
|
||||
this->getGeometryStringExtensionPtr()->str=pstr;
|
||||
this->getGeometryStringExtensionPtr()->value=pstr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -74,12 +74,12 @@ int GeometryStringExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
Py::String GeometryStringExtensionPy::getValue(void) const
|
||||
{
|
||||
return Py::String(this->getGeometryStringExtensionPtr()->str);
|
||||
return Py::String(this->getGeometryStringExtensionPtr()->value);
|
||||
}
|
||||
|
||||
void GeometryStringExtensionPy::setValue(Py::String value)
|
||||
{
|
||||
this->getGeometryStringExtensionPtr()->str = value.as_std_string();
|
||||
this->getGeometryStringExtensionPtr()->value = value.as_std_string();
|
||||
}
|
||||
|
||||
PyObject *GeometryStringExtensionPy::getCustomAttributes(const char* /*attr*/) const
|
||||
|
||||
Reference in New Issue
Block a user