From 66713229be98e86a3f5d71d14bf24bd68fc81824 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 31 Oct 2008 13:37:59 +0000 Subject: [PATCH] Dump Python Extension --- idl/GEOM_Gen.idl | 11 +++++++++++ src/DlgRef/DlgRef_3Spin_QTD.ui | 10 +++++----- src/GEOM/GEOM_IOperations.hxx | 12 +++++++++++- src/GEOM_I/GEOM_IOperations_i.cc | 20 ++++++++++++++++++++ src/GEOM_I/GEOM_IOperations_i.hh | 4 ++++ src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 11 ++++++++++- 6 files changed, 61 insertions(+), 7 deletions(-) diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 0cf8d8573..7c2ffe0df 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -275,6 +275,17 @@ module GEOM * Aborts the previously opened transaction */ void AbortOperation(); + + /*! + * Set list of parameters + * \param theParameters is a string containing the list of parameters separated by ":" symbol + */ + void SetParameters (in string theParameters); + + /*! + * Get list of parameters + */ + string GetParameters(); }; /*! diff --git a/src/DlgRef/DlgRef_3Spin_QTD.ui b/src/DlgRef/DlgRef_3Spin_QTD.ui index 10959ed5d..4ac7e5d12 100644 --- a/src/DlgRef/DlgRef_3Spin_QTD.ui +++ b/src/DlgRef/DlgRef_3Spin_QTD.ui @@ -56,13 +56,13 @@ 6 - + - + - + @@ -121,9 +121,9 @@ qPixmapFromMimeSource - QtxDoubleSpinBox + SalomeApp_DoubleSpinBox QDoubleSpinBox -
QtxDoubleSpinBox.h
+
SalomeApp_DoubleSpinBox.h
diff --git a/src/GEOM/GEOM_IOperations.hxx b/src/GEOM/GEOM_IOperations.hxx index 1334adeaf..944c61b59 100644 --- a/src/GEOM/GEOM_IOperations.hxx +++ b/src/GEOM/GEOM_IOperations.hxx @@ -65,6 +65,16 @@ class GEOM_IOperations return (char*) _errorCode.ToCString(); } + //Sets a parameters of the operation + Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters) { + _parameters = theParameters; + } + + //Returns a parameters of the operation + Standard_EXPORT char* GetParameters() { + return (char*) _parameters.ToCString(); + } + //Returns a pointer to GEOM_Engine which this operation interface is associated Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; } @@ -80,7 +90,7 @@ class GEOM_IOperations GEOM_Engine* _engine; GEOM_Solver* _solver; int _docID; - + TCollection_AsciiString _parameters; }; #endif diff --git a/src/GEOM_I/GEOM_IOperations_i.cc b/src/GEOM_I/GEOM_IOperations_i.cc index 3d5c87c46..12a4eaa74 100644 --- a/src/GEOM_I/GEOM_IOperations_i.cc +++ b/src/GEOM_I/GEOM_IOperations_i.cc @@ -122,6 +122,26 @@ void GEOM_IOperations_i::AbortOperation() _impl->AbortOperation(); } +//============================================================================= +/*! + * SetParameters + */ +//============================================================================= +void GEOM_IOperations_i::SetParameters(const char* theParameters) +{ + _impl->SetParameters((char*)theParameters); +} + +//============================================================================= +/*! + * GetParameters + */ +//============================================================================= +char* GEOM_IOperations_i::GetParameters() +{ + return CORBA::string_dup(_impl->GetParameters()); +} + //============================================================================= /*! * GetObject diff --git a/src/GEOM_I/GEOM_IOperations_i.hh b/src/GEOM_I/GEOM_IOperations_i.hh index c425449dc..22192c3ac 100644 --- a/src/GEOM_I/GEOM_IOperations_i.hh +++ b/src/GEOM_I/GEOM_IOperations_i.hh @@ -53,6 +53,10 @@ class GEOM_I_EXPORT GEOM_IOperations_i : public virtual POA_GEOM::GEOM_IOperatio virtual void AbortOperation(); + virtual void SetParameters(const char* theParameters); + + virtual char* GetParameters(); + ::GEOM_IOperations* GetImpl() { return _impl; } diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 3740a9a18..7f30a1a44 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -427,7 +427,10 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_BoxDlg::createOperation() //================================================================================= bool PrimitiveGUI_BoxDlg::isValid (QString&) { - return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : true; + return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : + GroupDimensions->SpinBox_DX->isValid() && + GroupDimensions->SpinBox_DY->isValid() && + GroupDimensions->SpinBox_DZ->isValid(); } //================================================================================= @@ -455,6 +458,12 @@ bool PrimitiveGUI_BoxDlg::execute (ObjectList& objects) double y = GroupDimensions->SpinBox_DY->value(); double z = GroupDimensions->SpinBox_DZ->value(); + QStringList aParameters; + aParameters << GroupDimensions->SpinBox_DX->text(); + aParameters << GroupDimensions->SpinBox_DY->text(); + aParameters << GroupDimensions->SpinBox_DZ->text(); + getOperation()->SetParameters( aParameters.join( ":" ).toLatin1().constData() ); + anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z); res = true; } -- 2.39.2