Export CellViewer::setPixelThreshold() to the Python interface.

This commit is contained in:
Jean-Paul Chaput 2023-01-14 12:06:15 +01:00
parent c86d074f06
commit 83ff59817a
2 changed files with 22 additions and 0 deletions

View File

@ -173,6 +173,22 @@ extern "C" {
}
static PyObject* PyCellViewer_setPixelThreshold ( PyCellViewer* self, PyObject* args )
{
cdebug_log(20,0) << "PyCellViewer_setPixelThreshold ()" << endl;
HTRY
METHOD_HEAD( "CellViewer.setPixelThreshold()" )
int threshold = 20;
if (not PyArg_ParseTuple(args,"i:CellViewer.setPixelThreshold()", &threshold)) {
PyErr_SetString ( ConstructorError, "CellViewer.setPixelThreshold(): Takes exactly one argument." );
return NULL;
}
cw->setPixelThreshold ( threshold );
HCATCH
Py_RETURN_NONE;
}
static PyObject* PyCellViewer_setDbuMode ( PyCellViewer* self, PyObject* args )
{
cdebug_log(20,0) << "PyCellViewer_setDbuMode ()" << endl;
@ -386,6 +402,8 @@ extern "C" {
, "Load a Cell into the viewer." }
, { "setApplicationName" , (PyCFunction)PyCellViewer_setApplicationName , METH_VARARGS
, "Sets the application (binary) name." }
, { "setPixelThreshold" , (PyCFunction)PyCellViewer_setPixelThreshold , METH_VARARGS
, "Sets the size under which graphical shapes are *not* displayeds." }
, { "setDbuMode" , (PyCFunction)PyCellViewer_setDbuMode , METH_VARARGS
, "Sets how the length will be displayed (lambda,physical,grid)." }
, { "setAnonNetSelectable" , (PyCFunction)PyCellViewer_setAnonNetSelectable , METH_VARARGS

View File

@ -116,6 +116,7 @@ namespace Hurricane {
, QString beforePath="" );
inline void setEnableRedrawInterrupt ( bool );
inline void setApplicationName ( const QString& );
inline void setPixelThreshold ( int );
inline void setDbuMode ( int );
inline Observer<CellViewer>* getCellObserver ();
Cell* getCell () const;
@ -216,6 +217,9 @@ namespace Hurricane {
inline void CellViewer::emitCellPreModificated () { emit cellPreModificated(); }
inline void CellViewer::emitCellPostModificated () { emit cellPostModificated(); }
inline void CellViewer::setPixelThreshold ( int threshold )
{ _cellWidget->setPixelThreshold( threshold ); }
inline void CellViewer::setEnableRedrawInterrupt ( bool state )
{ _cellWidget->setEnableRedrawInterrupt(state); }