Part: Move default geometry extension for int to internally use long
This commit is contained in:
@@ -83,20 +83,20 @@ PyObject * GeometryDefaultExtension<T>::getPyObject(void)
|
||||
|
||||
// ----------------------------- Template specialisations----------------------------------------------------
|
||||
|
||||
//typedef Part::GeometryDefaultExtension<int> GeometryIntExtension;
|
||||
//typedef Part::GeometryDefaultExtension<long> GeometryIntExtension;
|
||||
//typedef Part::GeometryStringExtension<std::string> GeometryStringExtension;
|
||||
|
||||
// ---------- GeometryIntExtension ----------
|
||||
TYPESYSTEM_SOURCE_TEMPLATE_T(Part::GeometryIntExtension,Part::GeometryExtension)
|
||||
|
||||
template <>
|
||||
PyObject * GeometryDefaultExtension<int>::getPyObject(void)
|
||||
PyObject * GeometryDefaultExtension<long>::getPyObject(void)
|
||||
{
|
||||
return new GeometryIntExtensionPy(new GeometryIntExtension(this->value));
|
||||
}
|
||||
|
||||
template <>
|
||||
void GeometryDefaultExtension<int>::Restore(Base::XMLReader &reader)
|
||||
void GeometryDefaultExtension<long>::Restore(Base::XMLReader &reader)
|
||||
{
|
||||
value = reader.getAttributeAsInteger("value");
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Part {
|
||||
// 6. Register your type and corresponding python type in AppPart.cpp
|
||||
|
||||
// Prefer alias to typedef item 9
|
||||
using GeometryIntExtension = GeometryDefaultExtension<int>;
|
||||
using GeometryIntExtension = GeometryDefaultExtension<long>;
|
||||
using GeometryStringExtension = GeometryDefaultExtension<std::string>;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ int GeometryIntExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
int Id;
|
||||
long Id;
|
||||
if (PyArg_ParseTuple(args, "i", &Id)) {
|
||||
this->getGeometryIntExtensionPtr()->setValue(Id);
|
||||
return 0;
|
||||
@@ -65,7 +65,7 @@ int GeometryIntExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "GeometryIntExtension constructor accepts:\n"
|
||||
"-- empty parameter list\n"
|
||||
"-- int\n");
|
||||
"-- long int\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user