Salome HOME
Dump Python Extension
authorouv <ouv@opencascade.com>
Fri, 31 Oct 2008 13:37:59 +0000 (13:37 +0000)
committerouv <ouv@opencascade.com>
Fri, 31 Oct 2008 13:37:59 +0000 (13:37 +0000)
idl/GEOM_Gen.idl
src/DlgRef/DlgRef_3Spin_QTD.ui
src/GEOM/GEOM_IOperations.hxx
src/GEOM_I/GEOM_IOperations_i.cc
src/GEOM_I/GEOM_IOperations_i.hh
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx

index 0cf8d8573a0862716e03f6b9ecebe6105a2657bd..7c2ffe0df4f1599cc121c7ec109a53494e51695e 100644 (file)
@@ -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();
   };
 
   /*!
index 10959ed5d88d294ebbb17061b31853544c49f89c..4ac7e5d12e15c0f486b7d29af3958b4c5310da2e 100644 (file)
        <number>6</number>
       </property>
       <item row="2" column="1" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
       </item>
       <item row="1" column="1" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
       </item>
       <item row="0" column="1" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
       </item>
       <item row="1" column="0" >
        <widget class="QLabel" name="TextLabel2" >
  <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
  <customwidgets>
   <customwidget>
-   <class>QtxDoubleSpinBox</class>
+   <class>SalomeApp_DoubleSpinBox</class>
    <extends>QDoubleSpinBox</extends>
-   <header location="global" >QtxDoubleSpinBox.h</header>
+   <header location="global" >SalomeApp_DoubleSpinBox.h</header>
   </customwidget>
  </customwidgets>
  <tabstops>
index 1334adeaf14517c0d23cf1772a3a8b9cce12d1e0..944c61b590e39e09dd1ebf97b2a446aa4bfa3a79 100644 (file)
@@ -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
index 3d5c87c468be22892a2cdb04f029c1dfb32e00e0..12a4eaa745a54d7b17797943157f0400a60a87a5 100644 (file)
@@ -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
index c425449dc8406c26a60d7679f446398ced3006a4..22192c3acd23b9360276328530b4f8f6951dda45 100644 (file)
@@ -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; }
 
index 3740a9a1881a75a26143b93c7eda7bf24c1221bf..7f30a1a441cdec12375f43ffe4f5b97061e74886 100644 (file)
@@ -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;
     }