Added optional scaling factor to Voronoi construction.
This commit is contained in:
committed by
sliptonic
parent
94a44bcbfe
commit
f860339658
@@ -107,6 +107,9 @@ namespace Path
|
||||
return new T(vd, index);
|
||||
}
|
||||
|
||||
double getScale() const { return vd->getScale(); }
|
||||
void setScale(double scale) { vd->setScale(scale); }
|
||||
|
||||
private:
|
||||
Base::Reference<diagram_type> vd;
|
||||
};
|
||||
|
||||
@@ -68,10 +68,13 @@ PyObject *VoronoiPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
|
||||
// constructor
|
||||
int VoronoiPy::PyInit(PyObject* args, PyObject* /*kwds*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "no arguments accepted");
|
||||
Voronoi *vo = getVoronoiPtr();
|
||||
double scale = vo->getScale();
|
||||
if (!PyArg_ParseTuple(args, "|d", &scale)) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "scale argument (double) accepted, default = 1000");
|
||||
return -1;
|
||||
}
|
||||
vo->setScale(scale);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user