]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Dump Python extension
authorouv <ouv@opencascade.com>
Fri, 21 Nov 2008 14:48:48 +0000 (14:48 +0000)
committerouv <ouv@opencascade.com>
Fri, 21 Nov 2008 14:48:48 +0000 (14:48 +0000)
34 files changed:
src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx
src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
src/BlocksGUI/BlocksGUI_TrsfDlg.h
src/DlgRef/DlgRef_1Sel2Spin1View1Check_QTD.ui
src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui
src/DlgRef/DlgRef_1Sel5Spin1Check_QTD.ui
src/DlgRef/DlgRef_2Sel1Spin2Check_QTD.ui
src/DlgRef/DlgRef_2Sel3Spin2Rb_QTD.ui
src/GEOM/GEOM_Engine.cxx
src/GEOMBase/GEOMBase_Skeleton.cxx
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_SWIG/geompyDC.py
src/GenerationGUI/GenerationGUI_FillingDlg.cxx
src/GenerationGUI/GenerationGUI_PrismDlg.cxx
src/GenerationGUI/GenerationGUI_RevolDlg.cxx
src/OperationGUI/OperationGUI_ArchimedeDlg.cxx
src/OperationGUI/OperationGUI_ChamferDlg.cxx
src/OperationGUI/OperationGUI_ChamferDlg.h
src/OperationGUI/OperationGUI_FilletDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx
src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx
src/RepairGUI/RepairGUI_DivideEdgeDlg.h
src/RepairGUI/RepairGUI_GlueDlg.cxx
src/RepairGUI/RepairGUI_GlueDlg.h
src/RepairGUI/RepairGUI_SewingDlg.cxx
src/RepairGUI/RepairGUI_SewingDlg.h
src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx
src/RepairGUI/RepairGUI_ShapeProcessDlg.h

index 1b03969cff226d9a4d1e3a07d89313e882f83622..0a6d834b3e0af255e91dbb59a4cc081e14ff4c77 100644 (file)
@@ -365,8 +365,12 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation()
 // function : isValid()
 // purpose  : Verify validity of input data
 //=================================================================================
-bool BlocksGUI_ExplodeDlg::isValid (QString&)
+bool BlocksGUI_ExplodeDlg::isValid (QString& msg)
 {
+  bool okSP = true;
+  okSP = myGrp1->SpinBox1->isValid( msg, !IsPreview() ) && okSP;
+  okSP = myGrp1->SpinBox2->isValid( msg, !IsPreview() ) && okSP;
+
   bool ok = false;
   switch ( getConstructorId() ) {
   case 0:
@@ -385,7 +389,7 @@ bool BlocksGUI_ExplodeDlg::isValid (QString&)
     break;
   }
 
-  return ok;
+  return ok && okSP;
 }
 
 //=================================================================================
@@ -420,6 +424,10 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
     return objects.size() > 0;
   }
 
+  QStringList aParameters;
+  aParameters << myGrp1->SpinBox1->text();
+  aParameters << myGrp1->SpinBox2->text();
+
   // Throw away sub-shapes not selected by user if not in preview mode
   // and manual selection is active
   if ( !isAllSubShapes() ) {
@@ -441,7 +449,10 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
     for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
       CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
       if ( selected.contains( QString( objStr.in() ) ) )
+      {
+       (*anIter)->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
         objects.push_back( *anIter );
+      }
       else
         toRemoveFromEngine.push_back( *anIter );
     }
@@ -456,7 +467,11 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
   }
   else {
     for ( int i = 0, n = aList->length(); i < n; i++ )
-      objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
+    {
+      GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aList[i] );
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      objects.push_back( anObj._retn() );
+    }
   }
 
   return objects.size();
index 040a64e90da87462dc83884bbe90a1055817cad7..4953c18dbcdc8ded0e42ed239cbd48a380e501be 100644 (file)
@@ -111,7 +111,7 @@ void BlocksGUI_TrsfDlg::Init()
 {
   // Set range of spinboxes
   double SpecificStep = 1.0;
-  QMap<int, QDoubleSpinBox*>::iterator anIter;
+  QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIter;
   for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) {
     //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3);
     initSpinBox(anIter.value(), 1.0, MAX_NUMBER, SpecificStep, 3);
@@ -127,7 +127,7 @@ void BlocksGUI_TrsfDlg::Init()
   for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn)
     connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
 
-  QMap<int, QDoubleSpinBox*>::iterator anIterSpin;
+  QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIterSpin;
   for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin)
     connect(anIterSpin.value(), SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
 
@@ -449,7 +449,7 @@ void BlocksGUI_TrsfDlg::createSpinWg (const QString& theLbl,
                                       const int      theId)
 {
   QLabel* lab = new QLabel(theLbl, theParent);
-  mySpinBox[theId] = new QDoubleSpinBox(theParent);
+  mySpinBox[theId] = new SalomeApp_DoubleSpinBox(theParent);
   QGridLayout* l = 0;
   if (!theParent->layout()) {
     l = new QGridLayout(theParent);
@@ -546,20 +546,23 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation()
 // function : isValid
 // purpose  : Verify validity of input data
 //=================================================================================
-bool BlocksGUI_TrsfDlg::isValid (QString&)
+bool BlocksGUI_TrsfDlg::isValid (QString& msg)
 {
-  bool ok = false;
+  bool ok = false, okSP = true;
   switch (getConstructorId()) {
   case 0:
     ok = !myShape->_is_nil() && myFaces[Face1] > 0;
+    okSP = mySpinBox[SpinBox1]->isValid( msg, !IsPreview() );
     break;
   case 1:
     ok = !myShape->_is_nil() && myFaces[Face1U] > 0 && myFaces[Face1V] > 0;
+    okSP = mySpinBox[SpinBox2U]->isValid( msg, !IsPreview() ) && okSP;
+    okSP = mySpinBox[SpinBox2V]->isValid( msg, !IsPreview() ) && okSP;
     break;
   default:
     break;
   }
-  return ok;
+  return ok && okSP;
 }
 
 //=================================================================================
@@ -578,6 +581,13 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
       MakeMultiTransformation1D(myShape,
                                 myFaces[Face1], myFaces[Face2],
                                 (int)mySpinBox[SpinBox1]->value());
+    if (!anObj->_is_nil())
+    {
+      QStringList aParameters;
+      aParameters << "" << "";
+      aParameters << mySpinBox[SpinBox1]->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   case 1:
@@ -587,6 +597,15 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
                                  (int)mySpinBox[SpinBox2U]->value(),
                                  myFaces[Face1V], myFaces[Face2V],
                                  (int)mySpinBox[SpinBox2V]->value());
+    if (!anObj->_is_nil())
+    {
+      QStringList aParameters;
+      aParameters << "" << "";
+      aParameters << mySpinBox[SpinBox2U]->text();
+      aParameters << "" << "";
+      aParameters << mySpinBox[SpinBox2V]->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   default:
index 2087d481bd5c2b6c900b6047a5b8c0873fd7d63b..453bf1d2cf0bdeaf35a49c458042e11f81985fa3 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <QMap>
 
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
 class QGroupBox;
 class QPushButton;
 class QLineEdit;
@@ -78,7 +78,7 @@ private:
 
   QMap<int, QPushButton*>            mySelBtn;
   QMap<int, QLineEdit*>              mySelName;
-  QMap<int, QDoubleSpinBox*>         mySpinBox;
+  QMap<int, SalomeApp_DoubleSpinBox*> mySpinBox;
 
 private slots:
   void                               ClickOnOk();
index 522369808cebae36ab2925e480d8256fd147bd33..675626f544a7864559cc9890c329b3299991d49f 100644 (file)
        <widget class="QTextBrowser" name="TextBrowser1" />
       </item>
       <item row="2" column="2" >
-       <widget class="QSpinBox" name="SpinBox2" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox2" />
       </item>
       <item row="1" column="2" >
-       <widget class="QSpinBox" name="SpinBox1" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox1" />
       </item>
       <item row="4" column="0" colspan="3" >
        <widget class="QCheckBox" name="CheckBox1" >
  </widget>
  <layoutdefault spacing="6" margin="11" />
  <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header location="global" >SalomeApp_IntSpinBox.h</header>
+  </customwidget>
+ </customwidgets>
  <tabstops>
   <tabstop>PushButton1</tabstop>
   <tabstop>LineEdit1</tabstop>
index f8501134c6c107d6b3fddcecaa5400418175e3c0..37a9f4a663594be480054733b4c02a62afaff2c0 100644 (file)
        <number>6</number>
       </property>
       <item row="2" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
       </item>
       <item row="1" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
       </item>
       <item row="4" column="0" colspan="2" >
        <widget class="QCheckBox" name="CheckButton1" >
  <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 1a248292f0660b9fa7a772df34feed4c435eb115..3c50b200c508e5c03145c299aba413c72a5dc0ec 100644 (file)
@@ -82,7 +82,7 @@
          </widget>
         </item>
         <item row="0" column="1" >
-         <widget class="QtxDoubleSpinBox" name="SpinBox1" />
+         <widget class="SalomeApp_DoubleSpinBox" name="SpinBox1" />
         </item>
         <item row="0" column="2" >
          <widget class="QLabel" name="TextLabel3" >
          </widget>
         </item>
         <item row="0" column="3" >
-         <widget class="QtxDoubleSpinBox" name="SpinBox2" />
+         <widget class="SalomeApp_DoubleSpinBox" name="SpinBox2" />
         </item>
         <item row="1" column="0" >
          <widget class="QLabel" name="TextLabel5" >
          </widget>
         </item>
         <item row="1" column="1" >
-         <widget class="QtxDoubleSpinBox" name="SpinBox4" />
+         <widget class="SalomeApp_DoubleSpinBox" name="SpinBox4" />
         </item>
         <item row="1" column="2" >
          <widget class="QLabel" name="TextLabel6" >
          </widget>
         </item>
         <item row="1" column="3" >
-         <widget class="QtxDoubleSpinBox" name="SpinBox5" />
+         <widget class="SalomeApp_DoubleSpinBox" name="SpinBox5" />
         </item>
         <item row="2" column="0" >
          <widget class="QLabel" name="TextLabel4" >
          </widget>
         </item>
         <item row="2" column="1" >
-         <widget class="QtxDoubleSpinBox" name="SpinBox3" />
+         <widget class="SalomeApp_DoubleSpinBox" name="SpinBox3" />
         </item>
         <item row="2" column="2" colspan="2" >
          <widget class="QCheckBox" name="CheckBox1" >
  </widget>
  <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 7998e3abd3951919fd43a2d288c325dd3a379ba5..5bb1b8e388b60b8aa0777aa87ae8dc9a66d497e0 100644 (file)
@@ -56,7 +56,7 @@
        <number>6</number>
       </property>
       <item row="2" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" >
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" >
         <property name="sizePolicy" >
          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
           <horstretch>0</horstretch>
  <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 69722216e9f6da8c11f03941ccdfba9143a04944..050f8baae2f34224b235bc81fe5a7f0dda995d5e 100644 (file)
        </widget>
       </item>
       <item row="2" column="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
       </item>
       <item row="3" column="0" >
        <widget class="QRadioButton" name="RadioButton2" >
        </widget>
       </item>
       <item row="3" column="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY" >
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" >
         <property name="enabled" >
          <bool>false</bool>
         </property>
        </widget>
       </item>
       <item row="3" column="4" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" >
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" >
         <property name="enabled" >
          <bool>false</bool>
         </property>
  </widget>
  <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 6b5a752d5b1efb92ddcbd3f2b612aff73a3f94f4..f6e8709b3db4cfcf4d54a4d824a5775ed0cd5e08 100644 (file)
@@ -63,6 +63,8 @@
 #define COMMA ','
 #define O_BRACKET '('
 #define C_BRACKET ')'
+#define O_SQR_BRACKET '['
+#define C_SQR_BRACKET ']'
 #define PY_NULL "None"
 
 #ifdef _DEBUG_
@@ -778,8 +780,8 @@ Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theStrin
 void ReplaceVariables(TCollection_AsciiString& theCommand, 
                       TVariablesList theVariables)
 {
-  //Get Entry of the result object
-  TCollection_AsciiString anEntry = theCommand.Token("=",1);
+  if (MYDEBUG)
+    cout<<"Command : "<<theCommand<<endl;
 
   if (MYDEBUG) {
     cout<<"All Entries:"<<endl;
@@ -787,93 +789,145 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
     for(;it != theVariables.end();it++)
       cout<<"\t'"<<(*it).first<<"'"<<endl;
   }
-  
-  //Remove white spaces
-  anEntry.RightAdjust();
-  anEntry.LeftAdjust();
-  if(MYDEBUG)
-    cout<<"Result entry : '" <<anEntry<<"'"<<endl;
-    
-  //Find variables used for object construction
-  vector<TVariable> aVariables;
-  TVariablesList::const_iterator it = theVariables.find(anEntry);
-  if( it != theVariables.end() ) 
-    aVariables = (*it).second;
 
-  if(aVariables.empty()) {
+  //Additional case - multi-row commands
+  int aCommandIndex = 1;
+  while( aCommandIndex < 10 ) { // tmp check
+    TCollection_AsciiString aCommand = theCommand.Token("\n",aCommandIndex);
+    if( aCommand.Length() == 0 )
+      break;
+
+    if (MYDEBUG)
+      cout<<"Sub-command : "<<aCommand<<endl;
+
+    Standard_Integer aStartCommandPos = theCommand.Location(aCommand,1,theCommand.Length());
+    Standard_Integer aEndCommandPos = aStartCommandPos + aCommand.Length();
+
+    //Get Entry of the result object
+    TCollection_AsciiString anEntry = aCommand.Token("=",1);
+
+    //Remove white spaces
+    anEntry.RightAdjust();
+    anEntry.LeftAdjust();
     if(MYDEBUG)
-      cout<<"Valiables list empty!!!"<<endl;
-    return;
-  }
+      cout<<"Result entry : '" <<anEntry<<"'"<<endl;
+
+    //Check if result is list of entries - enough to get the first entry in this case
+    int aNbEntries = 1;
+    if( anEntry.Value( 1 ) == O_SQR_BRACKET && anEntry.Value( anEntry.Length() ) == C_SQR_BRACKET ) {
+      while(anEntry.Location(aNbEntries,COMMA,1,anEntry.Length()))
+       aNbEntries++;
+      TCollection_AsciiString aSeparator(COMMA);
+      anEntry = anEntry.Token(aSeparator.ToCString(),1);
+      anEntry.Remove( 1, 1 );
+      anEntry.RightAdjust();
+      anEntry.LeftAdjust();
+      if(MYDEBUG)
+       cout<<"Sub-entry : '" <<anEntry<<"'"<<endl;
+    }
+    
+    //Find variables used for object construction
+    vector<TVariable> aVariables;
+    TVariablesList::const_iterator it = theVariables.find(anEntry);
+    if( it != theVariables.end() ) 
+      aVariables = (*it).second;
+
+    if(aVariables.empty()) {
+      if(MYDEBUG)
+       cout<<"Valiables list empty!!!"<<endl;
+      aCommandIndex++;
+      continue;
+    }
   
-  if(MYDEBUG) {
-    cout<<"Variables from SObject:"<<endl;
-    for (int i = 0; i < aVariables.size();i++)
-      cout<<"\t Variable["<<i<<"]"<<aVariables[i].myVariable<<endl;
-  }
+    if(MYDEBUG) {
+      cout<<"Variables from SObject:"<<endl;
+      for (int i = 0; i < aVariables.size();i++)
+       cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<endl;
+    }
 
-  //Calculate total number of parameter
-  Standard_Integer aTotalNbParams = 1;
-  while(theCommand.Location(aTotalNbParams,COMMA,1,theCommand.Length()))
-    aTotalNbParams++;
-  
-  //Replace parameters by variables
-  Standard_Integer aStartPos = 0;
-  Standard_Integer aEndPos = 0;
-  int iVar = 0;
-  TCollection_AsciiString aReplasedVar, aVar;
-  for(Standard_Integer i=1;i <= aTotalNbParams;i++) {
-        
-    //Replace first parameter (bettwen '(' character and first ',' character)
-    if(i == 1)
+    //Calculate total number of parameters
+    Standard_Integer aTotalNbParams = 1;
+    while(aCommand.Location(aTotalNbParams,COMMA,1,aCommand.Length()))
+      aTotalNbParams++;
+
+    if(MYDEBUG)
+      cout<<"aTotalNbParams = "<<aTotalNbParams<<endl;
+
+    Standard_Integer aFirstParam = aNbEntries;
+
+    //Replace parameters by variables
+    Standard_Integer aStartPos = 0;
+    Standard_Integer aEndPos = 0;
+    int iVar = 0;
+    TCollection_AsciiString aReplasedVar, aVar;
+    for(Standard_Integer i=aFirstParam;i <= aTotalNbParams;i++) {
+      //Replace first parameter (bettwen '(' character and first ',' character)
+      if(i == aFirstParam)
       {
-        aStartPos = theCommand.Location(O_BRACKET, 1, theCommand.Length()) + 1;
-       if(aTotalNbParams != 1 )
-         aEndPos = theCommand.Location(COMMA, 1, theCommand.Length());
+       aStartPos = aCommand.Location(O_BRACKET, 1, aCommand.Length()) + 1;
+       if(aTotalNbParams - aNbEntries > 0 )
+         aEndPos = aCommand.Location(aFirstParam, COMMA, 1, aCommand.Length());
        else
-         aEndPos = theCommand.Location(C_BRACKET, 1, theCommand.Length());     
+         aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length()); 
       }
-    //Replace last parameter (bettwen ',' character and ')' character)
-    else if(i == aTotalNbParams)
+      //Replace last parameter (bettwen ',' character and ')' character)
+      else if(i == aTotalNbParams)
       {
-        aStartPos = theCommand.Location(i-1, COMMA, 1, theCommand.Length()) + 2;
-        aEndPos = theCommand.Location(C_BRACKET, 1, theCommand.Length());
+       aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
+       aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length());
       }
-    //Replace other parameters (bettwen two ',' characters)
-    else if(i != 1 && i != aTotalNbParams )
+      //Replace other parameters (bettwen two ',' characters)
+      else if(i != aFirstParam && i != aTotalNbParams )
       {
-        aStartPos = theCommand.Location(i-1, COMMA, 1, theCommand.Length()) + 2;
-        aEndPos = theCommand.Location(i, COMMA, 1, theCommand.Length());
+       aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
+       aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length());
       }
-    aVar = theCommand.SubString(aStartPos, aEndPos-1);
-    if(MYDEBUG) 
-      cout<<"Current variable 1: '"<< aVar <<"'"<<endl;
 
-    aVar.RightAdjust();
-    aVar.LeftAdjust();
-    
-    if(MYDEBUG) 
-      cout<<"Current variable 2: '"<< aVar <<"'"<<endl;
-    
-    //If parameter is entry or 'None', skip it
-    if(theVariables.find(aVar) != theVariables.end() || aVar == PY_NULL)
-      continue;
+      if( aCommand.Value( aStartPos ) == O_SQR_BRACKET )
+       aStartPos++;
+      if( aCommand.Value( aEndPos-1 ) == C_SQR_BRACKET )
+       aEndPos--;
+
+      if(MYDEBUG) 
+       cout<<"aStartPos = "<<aStartPos<<", aEndPos = "<<aEndPos<<endl;
+
+      aVar = aCommand.SubString(aStartPos, aEndPos-1);
+      aVar.RightAdjust();
+      aVar.LeftAdjust();
     
-    aReplasedVar = aVariables[iVar].myVariable;
+      if(MYDEBUG) 
+       cout<<"Variable: '"<< aVar <<"'"<<endl;
     
+      //If parameter is entry or 'None', skip it
+      if(theVariables.find(aVar) != theVariables.end() || aVar == PY_NULL)
+       continue;
+
+      if(iVar >= aVariables.size())
+       continue;
+
+      aReplasedVar = aVariables[iVar].myVariable;
     
-    if(aReplasedVar.IsEmpty()) {
+      if(aReplasedVar.IsEmpty()) {
+       iVar++;
+       continue;
+      }
+
+      if(aVariables[iVar].isVariable) {
+       aReplasedVar.InsertBefore(1,"\"");
+       aReplasedVar.InsertAfter(aReplasedVar.Length(),"\"");
+      }
+
+      aCommand.Remove(aStartPos, aEndPos - aStartPos);
+      aCommand.Insert(aStartPos, aReplasedVar);
       iVar++;
-      continue;
     }
 
-    if(aVariables[iVar].isVariable) {
-      aReplasedVar.InsertBefore(1,"\"");
-      aReplasedVar.InsertAfter(aReplasedVar.Length(),"\"");
-    }
+    theCommand.Remove(aStartCommandPos, aEndCommandPos - aStartCommandPos);
+    theCommand.Insert(aStartCommandPos, aCommand);
 
-    theCommand.Remove(aStartPos, aEndPos - aStartPos);
-    theCommand.Insert(aStartPos,aReplasedVar);
-    iVar++;
+    aCommandIndex++;
   }
+
+  if (MYDEBUG)
+    cout<<"Command : "<<theCommand<<endl;
 }
index 2816192e6fe8d738c84b83f2ea492e6ee023745a..0dd5d8605a81627ed6bd8b2c22d595a6e115b038 100644 (file)
@@ -152,6 +152,7 @@ void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
                                     double min,  double max, 
                                     double step, int decimals )
 {
+  spinBox->setPrecision( decimals );
   spinBox->setDecimals( decimals ); // it's necessary to set decimals before the range setting,
                                     // by default Qt rounds boundaries to 2 decimals at setRange
   spinBox->setRange( min, max );
index b36a652f7981dab7152f75e29e12ebb7b078a979..ce76a6fad321fadcb6e13a16a32171f34d125927 100644 (file)
@@ -274,31 +274,23 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
   aNameAttrib->SetValue(aShapeName.ToCString());
 
   //Set NoteBook variables used in the object creation
-  TCollection_AsciiString aParams(aShape->GetParameters());
-  if(!aParams.IsEmpty()) {
-    TCollection_AsciiString aVars;
-    int nbVars = 0;
-    int n = 1;
-    TCollection_AsciiString aParam = aParams.Token(":",1);
-    while( aParam.Length() != 0 ) {
-      aParam = aParams.Token(":",n);
-      if(theStudy->IsVariable(aParam.ToCString())){
-       aVars+=aParam;
-       nbVars++;
-      }
-      if(aParam.Length() == 0)
-       break;
-      aVars+=":";
-      n++;
-    }
-    aVars.Remove(aVars.Length(),1);
-    if(nbVars > 0 ) {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString");
-      SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr);
-      aStringAttrib->SetValue(aVars.ToCString());
+  bool isFound = false;
+  TCollection_AsciiString aVars;
+  SALOMEDS::ListOfStrings_var aListOfVars = theStudy->ParseVariables(aShape->GetParameters());
+  for(int i = 0, n = aListOfVars->length(); i < n; i++) {
+    if(theStudy->IsVariable(aListOfVars[i].in())) {
+      aVars += TCollection_AsciiString(aListOfVars[i].in());
+      isFound = true;
     }
+    if(i != n-1)
+      aVars += ":";
   }
-  
+  if(isFound) {
+    anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString");
+    SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr);
+    aStringAttrib->SetValue(aVars.ToCString());
+  }
+
   //Set a name of the GEOM object
   aShape->SetName(theName);
 
index 4d7ed650505d3e2e261d157b317b4747a882d89a..7438859ffb27189eedbacf46a7dd355d34ebafcd 100644 (file)
@@ -117,6 +117,25 @@ def ParseParameters(*parameters):
     Result.append(StringResult)
     return Result
     
+## Return list of variables value from salome notebook
+## @ingroup l1_geompy_auxiliary    
+def ParseList(list):
+    Result = []
+    StringResult = ""
+    for parameter in list:
+        if isinstance(parameter,str) and notebook.isVariable(parameter):
+            Result.append(str(notebook.get(parameter)))
+            pass
+        else:
+            Result.append(str(parameter))
+            pass
+        
+        StringResult = StringResult + str(parameter)
+        StringResult = StringResult + ":"
+        pass
+    StringResult = StringResult[:len(StringResult)-1]
+    return Result,StringResult
+    
 
 ## Kinds of shape enumeration
 #  @ingroup l1_geompy_auxiliary
@@ -992,8 +1011,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_prism "Example"
         def MakePrismVecH(self, theBase, theVec, theH):
             # Example: see GEOM_TestAll.py
+            theH,Parameters = ParseParameters(theH)
             anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
             RaiseIfFailed("MakePrismVecH", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Create a shape by extrusion of the base shape along the vector,
@@ -1007,8 +1028,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_prism "Example"
         def MakePrismVecH2Ways(self, theBase, theVec, theH):
             # Example: see GEOM_TestAll.py
+            theH,Parameters = ParseParameters(theH)
             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
            
        ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
@@ -1019,8 +1042,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_prism "Example"
         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
             # Example: see GEOM_TestAll.py
+            theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
             anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
            
        ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
@@ -1033,8 +1058,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_prism "Example"
         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
             # Example: see GEOM_TestAll.py
+            theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Create a shape by revolution of the base shape around the axis
@@ -1048,14 +1075,18 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_revolution "Example"
         def MakeRevolution(self, theBase, theAxis, theAngle):
             # Example: see GEOM_TestAll.py
+            theAngle,Parameters = ParseParameters(theAngle)
             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## The Same Revolution but in both ways forward&backward.
         def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
+            theAngle,Parameters = ParseParameters(theAngle)
             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Create a filling from the given compound of contours.
@@ -1075,9 +1106,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_creation_filling "Example"
         def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
             # Example: see GEOM_TestAll.py
+            theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
+                                                                                         theTol2D, theTol3D, theNbIter)
             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
                                             theTol2D, theTol3D, theNbIter, isApprox)
             RaiseIfFailed("MakeFilling", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
@@ -1789,8 +1823,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_shape_processing "Example"
         def ProcessShape(self,theShape, theOperators, theParameters, theValues):
             # Example: see GEOM_TestHealing.py
+            theValues,Parameters = ParseList(theValues)
             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
             RaiseIfFailed("ProcessShape", self.HealOp)
+            for string in (theOperators + theParameters):
+                Parameters = ":" + Parameters
+                pass
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Remove faces from the given object (shape).
@@ -1821,8 +1860,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @return New GEOM_Object, containing processed shape.
         def Sew(self, theObject, theTolerance):
             # Example: see MakeSewing() above
+            theTolerance,Parameters = ParseParameters(theTolerance)
             anObj = self.HealOp.Sew(theObject, theTolerance)
             RaiseIfFailed("Sew", self.HealOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Remove internal wires and edges from the given object (face).
@@ -1879,8 +1920,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_add_point_on_edge "Example"
         def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
             # Example: see GEOM_TestHealing.py
+            theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
             RaiseIfFailed("DivideEdge", self.HealOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Change orientation of the given object. Updates given shape.
@@ -1927,9 +1970,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_glue_faces "Example"
         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
             # Example: see GEOM_Spanner.py
+            theTolerance,Parameters = ParseParameters(theTolerance)
             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
             if anObj is None:
                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Find coincident faces in theShape for possible gluing.
@@ -2409,8 +2454,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  \n @ref swig_MakeFilletAll "Example 2"
         def MakeFilletAll(self,theShape, theR):
             # Example: see GEOM_TestOthers.py
+            theR,Parameters = ParseParameters(theR)
             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
             RaiseIfFailed("MakeFilletAll", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Perform a fillet on the specified edges/faces of the given shape
@@ -2424,6 +2471,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_fillet "Example"
         def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
             # Example: see GEOM_TestAll.py
+            theR,Parameters = ParseParameters(theR)
             anObj = None
             if theShapeType == ShapeType["EDGE"]:
                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
@@ -2431,10 +2479,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             else:
                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## The same that MakeFillet but with two Fillet Radius R1 and R2
         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
+            theR1,theR2,Parameters = ParseParameters(theR1,theR2)
             anObj = None
             if theShapeType == ShapeType["EDGE"]:
                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
@@ -2442,6 +2492,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             else:
                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Perform a symmetric chamfer on all edges of the given shape.
@@ -2453,8 +2504,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  \n @ref swig_MakeChamferAll "Example 2"
         def MakeChamferAll(self,theShape, theD):
             # Example: see GEOM_TestOthers.py
+            theD,Parameters = ParseParameters(theD)
             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
             RaiseIfFailed("MakeChamferAll", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Perform a chamfer on edges, common to the specified faces,
@@ -2469,15 +2522,24 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_chamfer "Example"
         def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
             # Example: see GEOM_TestAll.py
+            theD1,theD2,Parameters = ParseParameters(theD1,theD2)
             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## The Same that MakeChamferEdge but with params theD is chamfer length and
-        #  theAngle is Angle of chamfer (angle in radians)
+        #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
+            flag = False
+            if isinstance(theAngle,str):
+                flag = True
+            theD,theAngle,Parameters = ParseParameters(theD,theAngle)
+            if flag:
+                theAngle = theAngle*math.pi/180.0
             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Perform a chamfer on all edges of the specified faces,
@@ -2494,17 +2556,26 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_chamfer "Example"
         def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
             # Example: see GEOM_TestAll.py
+            theD1,theD2,Parameters = ParseParameters(theD1,theD2)
             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
-        #  theAngle is Angle of chamfer (angle in radians)
+        #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
         #
         #  @ref swig_FilletChamfer "Example"
         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
+            flag = False
+            if isinstance(theAngle,str):
+                flag = True
+            theD,theAngle,Parameters = ParseParameters(theD,theAngle)
+            if flag:
+                theAngle = theAngle*math.pi/180.0
             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Perform a chamfer on edges,
@@ -2516,15 +2587,24 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #
         #  @ref swig_FilletChamfer "Example"
         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
+            theD1,theD2,Parameters = ParseParameters(theD1,theD2)
             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
-        #  theAngle is Angle of chamfer (angle in radians)
+        #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
+            flag = False
+            if isinstance(theAngle,str):
+                flag = True
+            theD,theAngle,Parameters = ParseParameters(theD,theAngle)
+            if flag:
+                theAngle = theAngle*math.pi/180.0
             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
@@ -2557,8 +2637,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_archimede "Example"
         def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
             # Example: see GEOM_TestAll.py
+            theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
+              theWeight,theWaterDensity,theMeshDeflection)
             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
             RaiseIfFailed("MakeArchimede", self.LocalOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         # end of l3_basic_op
@@ -3197,8 +3280,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  \n @ref swig_MakeBlockExplode "Example 2"
         def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
             # Example: see GEOM_TestOthers.py
+            theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
+            for anObj in aList:
+                anObj.SetParameters(Parameters)
+                pass
             return aList
 
         ## Find block, containing the given point inside its volume or on boundary.
@@ -3250,8 +3337,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_multi_transformation "Example"
         def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
             # Example: see GEOM_Spanner.py
+            DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Multi-transformate block and glue the result.
@@ -3265,9 +3354,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
                                       DirFace1V, DirFace2V, NbTimesV):
             # Example: see GEOM_Spanner.py
+            DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
+              DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
                                                             DirFace1V, DirFace2V, NbTimesV)
             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Build all possible propagation groups.
index ae4f0251ac9335b1128d33fffe1353dbb646299b..b0dfacc51460af9f4093414801c969e21d2a1829 100644 (file)
@@ -336,9 +336,16 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_FillingDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool GenerationGUI_FillingDlg::isValid( QString& )
+bool GenerationGUI_FillingDlg::isValid( QString& msg )
 {
-  return myOkCompound > 0;
+  bool ok = true;
+  ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok;
+  ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok;
+  ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok;
+  ok = GroupPoints->SpinBox4->isValid( msg, !IsPreview() ) && ok;
+  ok = GroupPoints->SpinBox5->isValid( msg, !IsPreview() ) && ok;
+
+  return myOkCompound > 0 && ok;
 }
 
 //=================================================================================
@@ -351,9 +358,18 @@ bool GenerationGUI_FillingDlg::execute( ObjectList& objects )
 
   anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakeFilling(
     myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter, myIsApprox );
-
   if ( !anObj->_is_nil() )
+  {
+    QStringList aParameters;
+    aParameters << GroupPoints->SpinBox1->text();
+    aParameters << GroupPoints->SpinBox2->text();
+    aParameters << GroupPoints->SpinBox3->text();
+    aParameters << GroupPoints->SpinBox4->text();
+    aParameters << GroupPoints->SpinBox5->text();
+    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
     objects.push_back( anObj._retn() );
+  }
 
   return true;
 }
index 7d6eacefcc961c1ef95e29201558320dc6c0aeda..ebf53a93c11a4dd1c50e77fe7108b405c285d824 100644 (file)
@@ -476,6 +476,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
 
     QString aName = GEOMBase::GetName(aSelectedObject);
     myBase = aSelectedObject;
+    myOkBase = true;
     myEditCurrentArgument->setText(aName);
   }
 
@@ -619,14 +620,24 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool GenerationGUI_PrismDlg::isValid (QString&)
+bool GenerationGUI_PrismDlg::isValid (QString& msg)
 {
+  bool ok = true;
+  if( getConstructorId() == 0 )
+    ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+  else if( getConstructorId() == 2 )
+  {
+    ok = GroupPoints3->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+    ok = GroupPoints3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+    ok = GroupPoints3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+  }
+
   if (getConstructorId() == 0)
-    return (myOkBase && myOkVec);     // by vector and height
+    return (myOkBase && myOkVec) && ok;     // by vector and height
   else if (getConstructorId() == 1)
     return (myOkBase && myOkPnt1 && myOkPnt2);   // by two points
   else if (getConstructorId() == 2)
-    return true;
+    return myOkBase && ok;
 
   return false;
 }
@@ -637,6 +648,7 @@ bool GenerationGUI_PrismDlg::isValid (QString&)
 //=================================================================================
 bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
 {
+  QStringList aParameters;
   GEOM::GEOM_Object_var anObj;
 
   switch (getConstructorId()) {
@@ -649,6 +661,13 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakePrismVecH2Ways(myBase, myVec, getHeight());
     }
+
+    if (!anObj->_is_nil())
+    {
+      aParameters << GroupPoints->SpinBox_DX->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
+
     break;
   case 1:
     if (!myBothway2) {
@@ -673,6 +692,15 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakePrismDXDYDZ2Ways(myBase, dx, dy, dz);
     }
+
+    if (!anObj->_is_nil())
+    {
+      aParameters << GroupPoints3->SpinBox_DX->text();
+      aParameters << GroupPoints3->SpinBox_DY->text();
+      aParameters << GroupPoints3->SpinBox_DZ->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
+
     break;
   }
 
index 0c4a91703b1648dda2dbdb69b5b9e14bbd0c589d..9abb8e77051ed574908de94324a92269cb24c5c2 100644 (file)
@@ -389,9 +389,10 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_RevolDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool GenerationGUI_RevolDlg::isValid (QString&)
+bool GenerationGUI_RevolDlg::isValid (QString& msg)
 {
-  return myOkBase && myOkAxis;
+  bool ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() );
+  return myOkBase && myOkAxis && ok;
 }
 
 //=================================================================================
@@ -412,7 +413,13 @@ bool GenerationGUI_RevolDlg::execute (ObjectList& objects)
   }
 
   if (!anObj->_is_nil())
+  {
+    QStringList aParameters;
+    aParameters << GroupPoints->SpinBox_DX->text();
+    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
     objects.push_back(anObj._retn());
+  }
 
   return true;
 }
index 853cee04bbcb509db7116808fcb5376e69bc639e..909c79444e43b9ea5f82b7ec3d9bf3b581fa2455 100644 (file)
@@ -248,9 +248,13 @@ GEOM::GEOM_IOperations_ptr OperationGUI_ArchimedeDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool OperationGUI_ArchimedeDlg::isValid( QString& )
+bool OperationGUI_ArchimedeDlg::isValid( QString& msg )
 {
-  return !myShape->_is_nil();
+  bool ok = true;
+  ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+  ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+  ok = GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+  return !myShape->_is_nil() && ok;
 }
 
 //=================================================================================
@@ -269,7 +273,15 @@ bool OperationGUI_ArchimedeDlg::execute( ObjectList& objects )
     getOperation() )->MakeArchimede( myShape, aWeight, aWaterDensity, aMeshDeflection );
 
   if ( !anObj->_is_nil() )
+  {
+    QStringList aParameters;
+    aParameters << GroupPoints->SpinBox_DX->text();
+    aParameters << GroupPoints->SpinBox_DY->text();
+    aParameters << GroupPoints->SpinBox_DZ->text();
+    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
     objects.push_back( anObj._retn() );
+  }
 
   return true;
 }
index 02519e43480c4a303a590c7f4750308cfda3e925..bfb9cf90519f85766482548106715ac8511727ff 100644 (file)
@@ -84,7 +84,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg (GeometryGUI* theGeometryGUI, Q
 
   int row = aLayout->rowCount();
   aLayout->addWidget(new QLabel(tr("D"), myGrp1), row, 0);
-  aLayout->addWidget((mySpinBox[ SpinBox1 ] = new QDoubleSpinBox(myGrp1)), row++, 2);
+  aLayout->addWidget((mySpinBox[ SpinBox1 ] = new SalomeApp_DoubleSpinBox(myGrp1)), row++, 2);
   aLayout->setRowStretch(row, 10);
 
   // Create second group
@@ -145,7 +145,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg (GeometryGUI* theGeometryGUI, Q
 
   // Set range of spinboxes
   double SpecificStep = 10.0;
-  QMap< int, QDoubleSpinBox* >::iterator anIter;
+  QMap< int, SalomeApp_DoubleSpinBox* >::iterator anIter;
   for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) {
     if (anIter.key() == SpinBox44 || anIter.key() == SpinBox34 || anIter.key() == SpinBox24)
       initSpinBox(anIter.value(), 0.001, 89.999, 5, 0);
@@ -175,7 +175,7 @@ OperationGUI_ChamferDlg::~OperationGUI_ChamferDlg()
 void OperationGUI_ChamferDlg::Init()
 {
   // Set Initial values of spinboxes
-  QMap< int, QDoubleSpinBox* >::iterator anIter;
+  QMap< int, SalomeApp_DoubleSpinBox* >::iterator anIter;
   for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter)
     anIter.value()->setValue(5);
 
@@ -213,7 +213,7 @@ void OperationGUI_ChamferDlg::Init()
             this, SLOT(LineEditReturnPressed()));
 
   // spin boxes
-  QMap< int, QDoubleSpinBox* >::iterator anIterSpin;
+  QMap< int, SalomeApp_DoubleSpinBox* >::iterator anIterSpin;
   for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin)
     connect(anIterSpin.value(), SIGNAL(valueChanged(double)),
             this, SLOT(ValueChangedInSpinBox(double)));
@@ -249,26 +249,26 @@ void OperationGUI_ChamferDlg::ConstructorsClicked (int constructorId)
   //disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
 
   // Get values from previous widget
-  double D1 = 5, D2 = 5, D = 5, Angle = 5;
+  QString D1 = "5", D2 = "5", D = "5", Angle = "5";
   if (myConstructorId == 0)
-    D1 = D2 = mySpinBox[ SpinBox1 ]->value();
+    D1 = D2 = mySpinBox[ SpinBox1 ]->text();
   else if (myConstructorId == 1) {
-    D1 = mySpinBox[ SpinBox21 ]->value();
-    D2 = mySpinBox[ SpinBox22 ]->value();
-    D =  mySpinBox[ SpinBox23 ]->value();
-    Angle = mySpinBox[ SpinBox24 ]->value();
+    D1 = mySpinBox[ SpinBox21 ]->text();
+    D2 = mySpinBox[ SpinBox22 ]->text();
+    D =  mySpinBox[ SpinBox23 ]->text();
+    Angle = mySpinBox[ SpinBox24 ]->text();
   }
   else if (myConstructorId == 2) {
-    D1 = mySpinBox[ SpinBox31 ]->value();
-    D2 = mySpinBox[ SpinBox32 ]->value();
-    D =  mySpinBox[ SpinBox33 ]->value();
-    Angle = mySpinBox[ SpinBox34 ]->value();
+    D1 = mySpinBox[ SpinBox31 ]->text();
+    D2 = mySpinBox[ SpinBox32 ]->text();
+    D =  mySpinBox[ SpinBox33 ]->text();
+    Angle = mySpinBox[ SpinBox34 ]->text();
   }
   else if (myConstructorId == 3) {
-    D1 = mySpinBox[ SpinBox41 ]->value();
-    D2 = mySpinBox[ SpinBox42 ]->value();
-    D =  mySpinBox[ SpinBox43 ]->value();
-    Angle = mySpinBox[ SpinBox44 ]->value();
+    D1 = mySpinBox[ SpinBox41 ]->text();
+    D2 = mySpinBox[ SpinBox42 ]->text();
+    D =  mySpinBox[ SpinBox43 ]->text();
+    Angle = mySpinBox[ SpinBox44 ]->text();
   }
 
   myConstructorId = constructorId;
@@ -279,38 +279,38 @@ void OperationGUI_ChamferDlg::ConstructorsClicked (int constructorId)
     myGrp3->hide();
     myGrp4->hide();
     myGrp1->show();
-    mySpinBox[ SpinBox1 ]->setValue(D1);
+    mySpinBox[ SpinBox1 ]->setText(D1);
     break;
   case 1:
     myGrp1->hide();
     myGrp3->hide();
     myGrp4->hide();
     myGrp2->show();
-    mySpinBox[ SpinBox21 ]->setValue(D1);
-    mySpinBox[ SpinBox22 ]->setValue(D2);
-    mySpinBox[ SpinBox23 ]->setValue(D);
-    mySpinBox[ SpinBox24 ]->setValue(Angle);
+    mySpinBox[ SpinBox21 ]->setText(D1);
+    mySpinBox[ SpinBox22 ]->setText(D2);
+    mySpinBox[ SpinBox23 ]->setText(D);
+    mySpinBox[ SpinBox24 ]->setText(Angle);
     break;
   case 2:
     myGrp1->hide();
     myGrp2->hide();
     myGrp4->hide();
     myGrp3->show();
-    mySpinBox[ SpinBox31 ]->setValue(D1);
-    mySpinBox[ SpinBox32 ]->setValue(D2);
-    mySpinBox[ SpinBox32 ]->setValue(D2);
-    mySpinBox[ SpinBox33 ]->setValue(D);
-    mySpinBox[ SpinBox34 ]->setValue(Angle);
+    mySpinBox[ SpinBox31 ]->setText(D1);
+    mySpinBox[ SpinBox32 ]->setText(D2);
+    mySpinBox[ SpinBox32 ]->setText(D2);
+    mySpinBox[ SpinBox33 ]->setText(D);
+    mySpinBox[ SpinBox34 ]->setText(Angle);
     break;
   case 3:
     myGrp1->hide();
     myGrp2->hide();
     myGrp3->hide();
     myGrp4->show();
-    mySpinBox[ SpinBox41 ]->setValue(D1);
-    mySpinBox[ SpinBox42 ]->setValue(D2);
-    mySpinBox[ SpinBox43 ]->setValue(D);
-    mySpinBox[ SpinBox44 ]->setValue(Angle);
+    mySpinBox[ SpinBox41 ]->setText(D1);
+    mySpinBox[ SpinBox42 ]->setText(D2);
+    mySpinBox[ SpinBox43 ]->setText(D);
+    mySpinBox[ SpinBox44 ]->setText(Angle);
     break;
   default:
     break;
@@ -641,8 +641,8 @@ void OperationGUI_ChamferDlg::createRadioWg(const QString& theLbl1,
   myRadioButton[ theRbId ] = new QRadioButton(theParent);
   QLabel* lab1 = new QLabel(theLbl1, theParent);
   QLabel* lab2 = new QLabel(theLbl2, theParent);
-  mySpinBox[ theSpin1Id ]  = new QDoubleSpinBox(theParent);
-  mySpinBox[ theSpin2Id ]  = new QDoubleSpinBox(theParent);
+  mySpinBox[ theSpin1Id ]  = new SalomeApp_DoubleSpinBox(theParent);
+  mySpinBox[ theSpin2Id ]  = new SalomeApp_DoubleSpinBox(theParent);
   int row = theLayout->rowCount();
   theLayout->addWidget(myRadioButton[ theRbId ], row, 0);
   theLayout->addWidget(lab1,                     row, 2);
@@ -738,14 +738,50 @@ GEOM::GEOM_IOperations_ptr OperationGUI_ChamferDlg::createOperation()
 // function : isValid()
 // purpose  : Verify validity of input data
 //=================================================================================
-bool OperationGUI_ChamferDlg::isValid (QString&)
+bool OperationGUI_ChamferDlg::isValid (QString& msg)
 {
+  bool ok = true;
   switch (getConstructorId())
   {
-    case 0: return !myShape->_is_nil();
-    case 1: return !myShape->_is_nil() && myFace[ Face1 ] > 0 && myFace[ Face2 ] > 0;
-    case 2: return !myShape->_is_nil() && myFaces.Extent() > 0;
-    case 3: return !myShape->_is_nil() && myEdges.Extent() > 0;
+    case 0:
+      ok = mySpinBox[ SpinBox1 ]->isValid( msg, !IsPreview() );
+      return !myShape->_is_nil() && ok;
+    case 1:
+      if (myRadioButton[ RadioButton21 ]->isChecked())
+      {
+       ok = mySpinBox[ SpinBox21 ]->isValid( msg, !IsPreview() ) && ok;
+       ok = mySpinBox[ SpinBox22 ]->isValid( msg, !IsPreview() ) && ok;
+      }
+      else
+      {
+       ok = mySpinBox[ SpinBox23 ]->isValid( msg, !IsPreview() ) && ok;
+       ok = mySpinBox[ SpinBox24 ]->isValid( msg, !IsPreview() ) && ok;
+      }
+      return !myShape->_is_nil() && myFace[ Face1 ] > 0 && myFace[ Face2 ] > 0 && ok;
+    case 2:
+      if (myRadioButton[ RadioButton31 ]->isChecked())
+      {
+       ok = mySpinBox[ SpinBox31 ]->isValid( msg, !IsPreview() ) && ok;
+       ok = mySpinBox[ SpinBox32 ]->isValid( msg, !IsPreview() ) && ok;
+      }
+      else
+      {
+       ok = mySpinBox[ SpinBox33 ]->isValid( msg, !IsPreview() ) && ok;
+       ok = mySpinBox[ SpinBox34 ]->isValid( msg, !IsPreview() ) && ok;
+      }
+      return !myShape->_is_nil() && myFaces.Extent() > 0 && ok;
+    case 3:
+      if (myRadioButton[ RadioButton41 ]->isChecked())
+      {
+       ok = mySpinBox[ SpinBox41 ]->isValid( msg, !IsPreview() ) && ok;
+       ok = mySpinBox[ SpinBox42 ]->isValid( msg, !IsPreview() ) && ok;
+      }
+      else
+      {
+       ok = mySpinBox[ SpinBox43 ]->isValid( msg, !IsPreview() ) && ok;
+       ok = mySpinBox[ SpinBox44 ]->isValid( msg, !IsPreview() ) && ok;
+      }
+      return !myShape->_is_nil() && myEdges.Extent() > 0 && ok;
     default: return false;
   }
 }
@@ -756,6 +792,7 @@ bool OperationGUI_ChamferDlg::isValid (QString&)
 //=================================================================================
 bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
 {
+  QStringList aParameters;
   GEOM::GEOM_Object_var anObj;
   bool flag = (myRadioButton[ RadioButton21 ]->isChecked() &&
                myRadioButton[ RadioButton31 ]->isChecked() &&
@@ -765,6 +802,8 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
   if (anId == 0) {
     anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
       MakeChamferAll(myShape, mySpinBox[ SpinBox1 ]->value());
+    if (!anObj->_is_nil())
+      aParameters << mySpinBox[ SpinBox1 ]->text();
   }
   else if (anId == 1) {
     if (flag) {
@@ -774,6 +813,11 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
                         mySpinBox[ SpinBox22 ]->value(),
                         myFace[ Face1 ],
                         myFace[ Face2 ]);
+      if (!anObj->_is_nil())
+      {
+       aParameters << mySpinBox[ SpinBox21 ]->text();
+       aParameters << mySpinBox[ SpinBox22 ]->text();
+      }
     }
     else {
       anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
@@ -782,6 +826,11 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
                           mySpinBox[ SpinBox24 ]->value() * PI180,
                           myFace[ Face1 ],
                           myFace[ Face2 ]);
+      if (!anObj->_is_nil())
+      {
+       aParameters << mySpinBox[ SpinBox23 ]->text();
+       aParameters << mySpinBox[ SpinBox24 ]->text();
+      }
     }
   }
   else if (anId == 2)
@@ -792,18 +841,30 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
     for (int i = 1, n = myFaces.Extent(); i <= n; i++)
       anArray[ i - 1 ] = myFaces(i);
 
-    if (flag)
-    anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
-      MakeChamferFaces(myShape,
-                       mySpinBox[ SpinBox31 ]->value(),
-                       mySpinBox[ SpinBox32 ]->value(),
-                       anArray);
-    else
-    anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
-      MakeChamferFacesAD(myShape,
-                         mySpinBox[ SpinBox33 ]->value(),
-                         mySpinBox[ SpinBox34 ]->value() * PI180,
-                         anArray);
+    if (flag) {
+      anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
+       MakeChamferFaces(myShape,
+                        mySpinBox[ SpinBox31 ]->value(),
+                        mySpinBox[ SpinBox32 ]->value(),
+                        anArray);
+      if (!anObj->_is_nil())
+      {
+       aParameters << mySpinBox[ SpinBox31 ]->text();
+       aParameters << mySpinBox[ SpinBox32 ]->text();
+      }
+    }
+    else {
+      anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
+       MakeChamferFacesAD(myShape,
+                          mySpinBox[ SpinBox33 ]->value(),
+                          mySpinBox[ SpinBox34 ]->value() * PI180,
+                          anArray);
+      if (!anObj->_is_nil())
+      {
+       aParameters << mySpinBox[ SpinBox33 ]->text();
+       aParameters << mySpinBox[ SpinBox34 ]->text();
+      }
+    }
   }
   else if (anId == 3) {
     GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
@@ -816,6 +877,11 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
                          mySpinBox[ SpinBox41 ]->value(),
                          mySpinBox[ SpinBox42 ]->value(),
                          anArray);
+      if (!anObj->_is_nil())
+      {
+       aParameters << mySpinBox[ SpinBox41 ]->text();
+       aParameters << mySpinBox[ SpinBox42 ]->text();
+      }
     }
     else {
       anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
@@ -823,11 +889,19 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
                            mySpinBox[ SpinBox43 ]->value(),
                            mySpinBox[ SpinBox44 ]->value() * PI180,
                            anArray);
+      if (!anObj->_is_nil())
+      {
+       aParameters << mySpinBox[ SpinBox43 ]->text();
+       aParameters << mySpinBox[ SpinBox44 ]->text();
+      }
     }
   }
 
   if (!anObj->_is_nil())
+  {
+    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
     objects.push_back(anObj._retn());
+  }
 
   return true;
 }
index eb81ae377a3bb2b23e1a3414d1745ef1649bb71b..bfc4a318e39db4176446519482a1539ccf06070f 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <QMap>
 
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
 class QGroupBox;
 class QPushButton;
 class QLineEdit;
@@ -106,7 +106,7 @@ private:
   
   QMap< int, QPushButton* >           mySelBtn;
   QMap< int, QLineEdit* >             mySelName;
-  QMap< int, QDoubleSpinBox* >        mySpinBox;
+  QMap< int, SalomeApp_DoubleSpinBox* > mySpinBox;
   QMap< int, QRadioButton* >          myRadioButton;
 };
 
index 447374237cbfbcf81af7e771924a6f9b282372d1..7b79a146b20d60440ddded0e1d3de9c18fdbe894 100644 (file)
@@ -217,19 +217,19 @@ void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId)
     return;
 
   // Get radius from previous widget
-  double R = 5, R1 = 5, R2 = 5;
+  QString R = "5", R1 = "5", R2 = "5";
   if      (myConstructorId == 0) {
-    R = Group1->SpinBox_DX->value();
+    R = Group1->SpinBox_DX->text();
   }
   else if (myConstructorId == 1) {
-    R = Group2->SpinBox_DX->value();
-    R1 = Group2->SpinBox_DY->value();
-    R2 = Group2->SpinBox_DZ->value();
+    R = Group2->SpinBox_DX->text();
+    R1 = Group2->SpinBox_DY->text();
+    R2 = Group2->SpinBox_DZ->text();
   }
   else {
-    R = Group3->SpinBox_DX->value();
-    R1 = Group3->SpinBox_DY->value();
-    R2 = Group3->SpinBox_DZ->value();
+    R = Group3->SpinBox_DX->text();
+    R1 = Group3->SpinBox_DY->text();
+    R2 = Group3->SpinBox_DZ->text();
   }
 
   myConstructorId = constructorId;
@@ -239,23 +239,23 @@ void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId)
     Group2->hide();
     Group3->hide();
     Group1->show();
-    Group1->SpinBox_DX->setValue(R);
+    Group1->SpinBox_DX->setText(R);
     break;
   case 1:
     Group1->hide();
     Group3->hide();
     Group2->show();
-    Group2->SpinBox_DX->setValue(R);
-    Group2->SpinBox_DY->setValue(R1);
-    Group2->SpinBox_DZ->setValue(R2);
+    Group2->SpinBox_DX->setText(R);
+    Group2->SpinBox_DY->setText(R1);
+    Group2->SpinBox_DZ->setText(R2);
     break;
   case 2:
     Group1->hide();
     Group2->hide();
     Group3->show();
-    Group3->SpinBox_DX->setValue(R);
-    Group3->SpinBox_DY->setValue(R1);
-    Group3->SpinBox_DZ->setValue(R2);
+    Group3->SpinBox_DX->setText(R);
+    Group3->SpinBox_DY->setText(R1);
+    Group3->SpinBox_DZ->setText(R2);
     break;
   default:
     break;
@@ -585,13 +585,32 @@ GEOM::GEOM_IOperations_ptr OperationGUI_FilletDlg::createOperation()
 // function : isValid()
 // purpose  : Verify validity of input data
 //=================================================================================
-bool OperationGUI_FilletDlg::isValid (QString&)
+bool OperationGUI_FilletDlg::isValid (QString& msg)
 {
+  bool ok = true;
   switch (getConstructorId())
   {
-    case 0: return !myShape->_is_nil();
-    case 1: return !myShape->_is_nil() && myEdges.Extent() > 0;
-    case 2: return !myShape->_is_nil() && myFaces.Extent() > 0;
+    case 0:
+      ok = Group1->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+      return !myShape->_is_nil() && ok;
+    case 1:
+      if (Group2->RadioButton1->isChecked())
+       ok = Group2->SpinBox_DX->isValid( msg, !IsPreview() );
+      else
+      {
+       ok = Group2->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+       ok = Group2->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+      }
+      return !myShape->_is_nil() && myEdges.Extent() > 0 && ok;
+    case 2:
+      if (Group3->RadioButton1->isChecked())
+       ok = Group3->SpinBox_DX->isValid( msg, !IsPreview() );
+      else
+      {
+       ok = Group3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+       ok = Group3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+      }
+      return !myShape->_is_nil() && myFaces.Extent() > 0 && ok;
     default: return false;
   }
 }
@@ -602,12 +621,16 @@ bool OperationGUI_FilletDlg::isValid (QString&)
 //=================================================================================
 bool OperationGUI_FilletDlg::execute (ObjectList& objects)
 {
+  QStringList aParameters;
   GEOM::GEOM_Object_var anObj;
 
   int anId = getConstructorId();
-  if (anId == 0)
+  if (anId == 0) {
     anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
       MakeFilletAll(myShape, getRadius());
+    if (!anObj->_is_nil())
+      aParameters << Group1->SpinBox_DX->text();
+  }
   else if (anId == 1) {
     GEOM::ListOfLong_var aList = new GEOM::ListOfLong;
     aList->length(myEdges.Extent());
@@ -616,14 +639,25 @@ bool OperationGUI_FilletDlg::execute (ObjectList& objects)
       aList[ i - 1 ] = myEdges(i);
 
     if (Group2->RadioButton1->isChecked())
+    {
       anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
         MakeFilletEdges(myShape, getRadius(), aList);
+      if (!anObj->_is_nil())
+       aParameters << Group2->SpinBox_DX->text();
+    }
     else
+    {
       anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
         MakeFilletEdgesR1R2(myShape,
                             Group2->SpinBox_DY->value(),
                             Group2->SpinBox_DZ->value(),
                             aList);
+      if (!anObj->_is_nil())
+      {
+       aParameters << Group2->SpinBox_DY->text();
+       aParameters << Group2->SpinBox_DZ->text();
+      }
+    }
   }
   else if (anId == 2) {
     GEOM::ListOfLong_var aList = new GEOM::ListOfLong;
@@ -635,17 +669,27 @@ bool OperationGUI_FilletDlg::execute (ObjectList& objects)
     if (Group3->RadioButton1->isChecked()) {
       anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
         MakeFilletFaces(myShape, getRadius(), aList);
+      if (!anObj->_is_nil())
+       aParameters << Group3->SpinBox_DX->text();
     }
     else {
       anObj = GEOM::GEOM_ILocalOperations::_narrow(getOperation())->
         MakeFilletFacesR1R2(myShape,
                             Group3->SpinBox_DY->value(),
                             Group3->SpinBox_DZ->value(), aList);
+      if (!anObj->_is_nil())
+      {
+       aParameters << Group3->SpinBox_DY->text();
+       aParameters << Group3->SpinBox_DZ->text();
+      }
     }
   }
 
   if (!anObj->_is_nil())
+  {
+    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
     objects.push_back(anObj._retn());
+  }
 
   return true;
 }
index 7910450bca622b47eccaf445a280249eafba25d1..85d3d810b6694f76dfc5dee50635b9b2a96d793c 100644 (file)
@@ -433,6 +433,10 @@ bool PrimitiveGUI_BoxDlg::isValid (QString& msg)
     ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
     ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
     ok = GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+
+    ok = fabs( GroupDimensions->SpinBox_DX->value() ) > Precision::Confusion() && ok;
+    ok = fabs( GroupDimensions->SpinBox_DY->value() ) > Precision::Confusion() && ok;
+    ok = fabs( GroupDimensions->SpinBox_DZ->value() ) > Precision::Confusion() && ok;
   }
   return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : ok;
 }
@@ -463,13 +467,14 @@ bool PrimitiveGUI_BoxDlg::execute (ObjectList& objects)
       double z = GroupDimensions->SpinBox_DZ->value();
 
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z);
-
-      QStringList aParameters;
-      aParameters << GroupDimensions->SpinBox_DX->text();
-      aParameters << GroupDimensions->SpinBox_DY->text();
-      aParameters << GroupDimensions->SpinBox_DZ->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+      if (!anObj->_is_nil())
+      {
+       QStringList aParameters;
+       aParameters << GroupDimensions->SpinBox_DX->text();
+       aParameters << GroupDimensions->SpinBox_DY->text();
+       aParameters << GroupDimensions->SpinBox_DZ->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      }
       res = true;
     }
     break;
index 8e85515bc04132fc71ea1860e000660250779fba..b6cb0ef17d4b84c509c76f50a19e1d14e95a6fd3 100644 (file)
@@ -451,6 +451,7 @@ bool  PrimitiveGUI_ConeDlg::isValid (QString& msg)
     ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
     ok = GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
   }
+  ok = fabs( getHeight() ) > Precision::Confusion() && ok;
   return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok;
 }
 
@@ -469,26 +470,28 @@ bool PrimitiveGUI_ConeDlg::execute (ObjectList& objects)
     if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakeConePntVecR1R2H(myPoint, myDir, getRadius1(), getRadius2(), getHeight());
-
-      QStringList aParameters;
-      aParameters << GroupPoints->SpinBox_DX->text();
-      aParameters << GroupPoints->SpinBox_DY->text();
-      aParameters << GroupPoints->SpinBox_DZ->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+      if (!anObj->_is_nil())
+      {
+       QStringList aParameters;
+       aParameters << GroupPoints->SpinBox_DX->text();
+       aParameters << GroupPoints->SpinBox_DY->text();
+       aParameters << GroupPoints->SpinBox_DZ->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      }
       res = true;
     }
     break;
   case 1:
     anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
       MakeConeR1R2H(getRadius1(), getRadius2(), getHeight());
-
-    QStringList aParameters;
-    aParameters << GroupDimensions->SpinBox_DX->text();
-    aParameters << GroupDimensions->SpinBox_DY->text();
-    aParameters << GroupDimensions->SpinBox_DZ->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      QStringList aParameters;
+      aParameters << GroupDimensions->SpinBox_DX->text();
+      aParameters << GroupDimensions->SpinBox_DY->text();
+      aParameters << GroupDimensions->SpinBox_DZ->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   }
index 76f5ec915185b4d3378e969dd050a713c6c7afb3..4f2536393e54f821933f3267ee672969d24e5c3b 100644 (file)
@@ -445,6 +445,7 @@ bool PrimitiveGUI_CylinderDlg::isValid (QString& msg)
     ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
     ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
   }
+  ok = fabs( getHeight() ) > Precision::Confusion() && ok;
   return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok;
 }
 
@@ -463,24 +464,26 @@ bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects)
     if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
-
-      QStringList aParameters;
-      aParameters << GroupPoints->SpinBox_DX->text();
-      aParameters << GroupPoints->SpinBox_DY->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+      if (!anObj->_is_nil())
+      {
+       QStringList aParameters;
+       aParameters << GroupPoints->SpinBox_DX->text();
+       aParameters << GroupPoints->SpinBox_DY->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      }
       res = true;
     }
     break;
   case 1:
     anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
       MakeCylinderRH(getRadius(), getHeight());
-
-    QStringList aParameters;
-    aParameters << GroupDimensions->SpinBox_DX->text();
-    aParameters << GroupDimensions->SpinBox_DY->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      QStringList aParameters;
+      aParameters << GroupDimensions->SpinBox_DX->text();
+      aParameters << GroupDimensions->SpinBox_DY->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   }
index eb883ad5eec0b5fc3839f9e2d9d9725f2bb9a813..0cb1a61f35e2b1381c9765ef7b157714d2d6bcda 100755 (executable)
@@ -575,19 +575,21 @@ bool PrimitiveGUI_DiskDlg::execute (ObjectList& objects)
   case 0:
     anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
       MakeDiskR(getRadius(), myOrientationType);
-
-    aParameters << GroupDimensions->SpinBox_DX->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      aParameters << GroupDimensions->SpinBox_DX->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   case 1:
     anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
       MakeDiskPntVecR(myPoint, myDir, getRadius());
-
-    aParameters << GroupPntVecR->SpinBox_DX->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      aParameters << GroupPntVecR->SpinBox_DX->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   case 2:
index 2b20a429fe16cf01873f4c5d0fe70efb22bf0d5e..e4a77f4fd60d8fdf7ce5c127ba61a383cfebda4a 100755 (executable)
@@ -497,11 +497,12 @@ bool PrimitiveGUI_FaceDlg::execute (ObjectList& objects)
     anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
       MakeFaceHW(GroupDimensions->SpinBox_DX->value(),
                  GroupDimensions->SpinBox_DY->value(), myOrientationType);
-
-    aParameters << GroupDimensions->SpinBox_DX->text();
-    aParameters << GroupDimensions->SpinBox_DY->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      aParameters << GroupDimensions->SpinBox_DX->text();
+      aParameters << GroupDimensions->SpinBox_DY->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   case 1:
@@ -511,11 +512,12 @@ bool PrimitiveGUI_FaceDlg::execute (ObjectList& objects)
     else if (GroupType->RadioButton2->isChecked())
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakeFaceObjHW(myFace, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value());
-
-    aParameters << GroupPlane->SpinBox_DX->text();
-    aParameters << GroupPlane->SpinBox_DY->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      aParameters << GroupPlane->SpinBox_DX->text();
+      aParameters << GroupPlane->SpinBox_DY->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   }
index 5d662591c9b99c11b9695f9fcea059d9547151f2..be4e7ca0be9a078cc67bb933275e21f313bcf90b 100644 (file)
@@ -401,11 +401,12 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
     {
       if ( !CORBA::is_nil( myPoint ) ) {
        anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSpherePntR( myPoint, getRadius() );
-
-       QStringList aParameters;
-       aParameters << GroupPoints->SpinBox_DX->text();
-       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+       if (!anObj->_is_nil())
+        {
+         QStringList aParameters;
+         aParameters << GroupPoints->SpinBox_DX->text();
+         anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+       }
        res = true;
       }
       break;
@@ -413,11 +414,12 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
   case 1 :
     {
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSphereR( getRadius() );
-
-      QStringList aParameters;
-      aParameters << GroupDimensions->SpinBox_DX->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+      if (!anObj->_is_nil())
+      {
+       QStringList aParameters;
+       aParameters << GroupDimensions->SpinBox_DX->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      }
       res = true;
       break;
     }
index 6b988d0f665e912fe27a0f06077e3b2abc733422..ba8288a82ffc12caf5f627b380a19b3de7f07439 100644 (file)
@@ -460,24 +460,26 @@ bool PrimitiveGUI_TorusDlg::execute (ObjectList& objects)
     if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
       anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
         MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
-
-      QStringList aParameters;
-      aParameters << GroupPoints->SpinBox_DX->text();
-      aParameters << GroupPoints->SpinBox_DY->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+      if (!anObj->_is_nil())
+      {
+       QStringList aParameters;
+       aParameters << GroupPoints->SpinBox_DX->text();
+       aParameters << GroupPoints->SpinBox_DY->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+      }
       res = true;
     }
     break;
   case 1:
     anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
       MakeTorusRR(getRadius1(), getRadius2());
-
-    QStringList aParameters;
-    aParameters << GroupDimensions->SpinBox_DX->text();
-    aParameters << GroupDimensions->SpinBox_DY->text();
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-
+    if (!anObj->_is_nil())
+    {
+      QStringList aParameters;
+      aParameters << GroupDimensions->SpinBox_DX->text();
+      aParameters << GroupDimensions->SpinBox_DY->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+    }
     res = true;
     break;
   }
index 7cea1fd993597e5fb4f4f6a0d2fb9c7dc7ebae01..90ab2c9b4df0e22d94b8cf14bf61434dceeb5a08 100644 (file)
@@ -83,7 +83,7 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q
   myIsParameterGr->addButton( rb2, 1 );
   rb1->setChecked( true );
 
-  myValEdt = new QDoubleSpinBox( GroupPoints->Box );
+  myValEdt = new SalomeApp_DoubleSpinBox( GroupPoints->Box );
   initSpinBox( myValEdt, 0., 1., 0.1, 3 );
   myValEdt->setValue( 0.5 );
   QLabel* aLbl1 = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->Box );
@@ -338,9 +338,9 @@ GEOM::GEOM_IOperations_ptr RepairGUI_DivideEdgeDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool RepairGUI_DivideEdgeDlg::isValid( QString& )
+bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
 {
-  return !myObject->_is_nil();
+  return !myObject->_is_nil() && myValEdt->isValid( msg, !IsPreview() );
 }
 
 //=================================================================================
@@ -353,7 +353,15 @@ bool RepairGUI_DivideEdgeDlg::execute( ObjectList& objects )
     ( myObject, -1, myValEdt->value(), getIsByParameter() );
   bool aResult = !anObj->_is_nil();
   if ( aResult )
+  {
+    QStringList aParameters;
+    aParameters << "";
+    aParameters << myValEdt->text();
+    aParameters << "";
+    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
     objects.push_back( anObj._retn() );
+  }
 
   return aResult;
 }
index 59de84f19c86b1920f088123648817b5ee05fd7d..93af6dfa905d67f718c0594cf817fe44e2b22d19 100644 (file)
@@ -29,7 +29,7 @@
 #include <GEOMBase_Skeleton.h>
 
 class DlgRef_1SelExt;
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
 class QButtonGroup;
 
 //=================================================================================
@@ -63,7 +63,7 @@ private:
   
   DlgRef_1SelExt*                    GroupPoints;
   QButtonGroup*                      myIsParameterGr;
-  QDoubleSpinBox*                    myValEdt;
+  SalomeApp_DoubleSpinBox*           myValEdt;
 
 protected slots:
   void                               ClickOnOk();
index c3ddfef0eb2a930007f9d9601fa2891d2d78b302..bdd2eaabb94a551bae84172982894621da5670b5 100644 (file)
@@ -81,7 +81,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg( GeometryGUI* theGeometryGUI, QWidget* pare
   GroupPoints->LineEdit1->setReadOnly( true );
   
   QLabel* aTolLab = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box );
-  myTolEdt = new QDoubleSpinBox( GroupPoints->Box );
+  myTolEdt = new SalomeApp_DoubleSpinBox( GroupPoints->Box );
   initSpinBox( myTolEdt,  0, 100, 1e-7, 7 );
   myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
 
@@ -98,7 +98,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg( GeometryGUI* theGeometryGUI, QWidget* pare
   GroupPoints2->LineEdit1->setReadOnly( true );
 
   QLabel* aTolLab2 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints2->Box );
-  myTolEdt2 = new QDoubleSpinBox( GroupPoints2->Box );
+  myTolEdt2 = new SalomeApp_DoubleSpinBox( GroupPoints2->Box );
   initSpinBox( myTolEdt2, 0, 100, 1e-7, 7 );
   myTolEdt2->setValue( DEFAULT_TOLERANCE_VALUE );
 
@@ -380,17 +380,22 @@ GEOM::GEOM_IOperations_ptr RepairGUI_GlueDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool RepairGUI_GlueDlg::isValid( QString& )
+bool RepairGUI_GlueDlg::isValid( QString& msg )
 {
+  bool ok = true;
   double v = 0;
   switch ( getConstructorId() )
   {
   case 0:
-    v = myTolEdt->value();  break;
+    v = myTolEdt->value();
+    ok = myTolEdt->isValid( msg, !IsPreview() );
+    break;
   case 1:
-    v = myTolEdt2->value(); break;
+    v = myTolEdt2->value(); 
+    ok = myTolEdt2->isValid( msg, !IsPreview() );
+    break;
   }
-  return !myObject->_is_nil() && ( IsPreview() || v > 0. );
+  return !myObject->_is_nil() && ( IsPreview() || v > 0. ) && ok;
 }
 
 //=================================================================================
@@ -409,7 +414,13 @@ bool RepairGUI_GlueDlg::execute( ObjectList& objects )
         ( getOperation() )->MakeGlueFaces( myObject, myTolEdt->value(), true );
       aResult = !anObj->_is_nil();
       if ( aResult )
+      {
+       QStringList aParameters;
+       aParameters << myTolEdt->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
         objects.push_back( anObj._retn() );
+      }
       break;
     }
   case 1:
@@ -456,7 +467,13 @@ bool RepairGUI_GlueDlg::execute( ObjectList& objects )
       aResult = !anObj->_is_nil();
 
       if ( aResult )
+      {
+       QStringList aParameters;
+       aParameters << myTolEdt2->text();
+       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
         objects.push_back( anObj._retn() );
+      }
 
       // Remove from engine useless objects
       clearTemporary();
index efdd034d23b80800002c45386685fe5f8b26e50e..ff3c7026d40f2bf8a5f595dc9b26662e64d7f2cb 100644 (file)
@@ -29,7 +29,7 @@
 #include <GEOMBase_Skeleton.h>
 
 class DlgRef_1SelExt;
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
 class QPushButton;
 class QCheckBox;
 
@@ -73,8 +73,8 @@ private:
     
   DlgRef_1SelExt*                    GroupPoints;
   DlgRef_1SelExt*                    GroupPoints2;
-  QDoubleSpinBox*                    myTolEdt;
-  QDoubleSpinBox*                    myTolEdt2;
+  SalomeApp_DoubleSpinBox*           myTolEdt;
+  SalomeApp_DoubleSpinBox*           myTolEdt2;
   QPushButton*                       myDetectBtn;
   QCheckBox*                         mySubShapesChk;
   
index a6d8f1cbadf86600f4066d52e678cb87abb416e1..e285fdfac00242a0f1d4fa6bf49921d2416379dc 100644 (file)
@@ -74,7 +74,7 @@ RepairGUI_SewingDlg::RepairGUI_SewingDlg( GeometryGUI* theGeometryGUI, QWidget*
 
   QGridLayout* aLay = new QGridLayout( GroupPoints->Box );
   aLay->setMargin( 0 ); aLay->setSpacing( 6 );
-  myTolEdt = new QDoubleSpinBox( GroupPoints->Box );
+  myTolEdt = new SalomeApp_DoubleSpinBox( GroupPoints->Box );
   initSpinBox( myTolEdt, 0, 100, 1e-7, 10 );
   myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
   QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box );
@@ -263,10 +263,10 @@ GEOM::GEOM_IOperations_ptr RepairGUI_SewingDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool RepairGUI_SewingDlg::isValid( QString& )
+bool RepairGUI_SewingDlg::isValid( QString& msg )
 {
   myClosed = -1;
-  return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. );
+  return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && myTolEdt->isValid( msg, !IsPreview() );
 }
 
 //=================================================================================
@@ -297,7 +297,13 @@ bool RepairGUI_SewingDlg::execute( ObjectList& objects )
     GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->Sew( myObject, myTolEdt->value() );
     aResult = !anObj->_is_nil();
     if ( aResult )
+    {
+      QStringList aParameters;
+      aParameters << myTolEdt->text();
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
       objects.push_back( anObj._retn() );
+    }
   }
 
   return aResult;
index 4830d979ca71ea32b50a762ad2febdcbd40c9b61..fa7fb2868d9ad2e80da5db7e4b9133589591bdd8 100644 (file)
@@ -29,7 +29,7 @@
 #include <GEOMBase_Skeleton.h>
 
 class DlgRef_1SelExt;
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
 class QPushButton;
 
 //=================================================================================
@@ -59,7 +59,7 @@ private:
   GEOM::GEOM_Object_var              myObject;
 
   DlgRef_1SelExt*                    GroupPoints;
-  QDoubleSpinBox*                    myTolEdt;
+  SalomeApp_DoubleSpinBox*           myTolEdt;
   QPushButton*                       myFreeBoundBtn;
   
   int                                myClosed; // Number of free closed boundaries detected. Calculated in execute(), used in onDetect().
index 1abf61dc17933905400be268abb1c6caa8aa21cb..9536fefb5b71a8d3d790f9745742cdfb53e1084a 100755 (executable)
@@ -31,6 +31,8 @@
 #include <GEOMImpl_Types.hxx>
 
 #include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
 #include <LightApp_SelectionMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -123,9 +125,9 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      myFixShapeTol3D = new QDoubleSpinBox( w );
+      myFixShapeTol3D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myFixShapeTol3D, 0, 100, 1e-7, 10 );
-      myFixShapeMaxTol3D = new QDoubleSpinBox( w );
+      myFixShapeMaxTol3D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myFixShapeMaxTol3D, 0, 100, 1e-7, 10 );
       
       aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
@@ -140,7 +142,7 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      myFixFaceSizeTol = new QDoubleSpinBox( w );
+      myFixFaceSizeTol = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myFixFaceSizeTol, 0, 100, 1e-7, 10 );
       
       aLay->addWidget( new QLabel( tr( "GEOM_TOLERANCE" ), w ), 0, 0 );
@@ -153,7 +155,7 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      myDropSmallEdgesTol3D = new QDoubleSpinBox( w );
+      myDropSmallEdgesTol3D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myDropSmallEdgesTol3D, 0, 100, 1e-7, 10 );
   
       aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
@@ -166,9 +168,9 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      mySplitAngleAngle = new QDoubleSpinBox( w );
+      mySplitAngleAngle = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( mySplitAngleAngle, 0, 360, 1 );
-      mySplitAngleMaxTol = new QDoubleSpinBox( w );
+      mySplitAngleMaxTol = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( mySplitAngleMaxTol, 0, 100, 1e-7, 10 );
       
       aLay->addWidget( new QLabel( tr( "GEOM_ANGLE_1" ), w ), 0, 0 );
@@ -183,7 +185,7 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      mySplitClosedFacesNum = new QSpinBox( w );
+      mySplitClosedFacesNum = new SalomeApp_IntSpinBox( w );
   
       aLay->addWidget( new QLabel( tr( "GEOM_NUM_SPLIT_POINTS" ), w ), 0, 0 );
       aLay->addWidget( mySplitClosedFacesNum, 0, 1 );
@@ -195,7 +197,7 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
 
-      mySplitContTol3D = new QDoubleSpinBox( w );
+      mySplitContTol3D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( mySplitContTol3D, 0, 100, 1e-7, 10 );
       mySplitContSurfCont = new QComboBox( w );
       mySplitContSurfCont->addItems( aContinueties );
@@ -220,14 +222,14 @@ void RepairGUI_ShapeProcessDlg::init()
       myBSpline3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
       myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
 
-      myBSplineTol3D = new QDoubleSpinBox( w );
+      myBSplineTol3D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myBSplineTol3D, 0, 100, 1e-7, 10 );
       
-      myBSplineTol2D = new QDoubleSpinBox( w );
+      myBSplineTol2D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myBSplineTol2D, 0, 100, 1e-7, 10 );
 
-      myBSplineDegree = new QSpinBox( w );
-      myBSplineSegments = new QSpinBox( w );
+      myBSplineDegree = new SalomeApp_IntSpinBox( w );
+      myBSplineSegments = new SalomeApp_IntSpinBox( w );
       myBSpline2DCont = new QComboBox( w );
       myBSpline2DCont->addItems( aContinueties );
       myBSpline3DCont = new QComboBox( w );
@@ -264,7 +266,7 @@ void RepairGUI_ShapeProcessDlg::init()
       myToBezier3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
       myToBezier2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
   
-      myToBezierMaxTol = new QDoubleSpinBox( w );
+      myToBezierMaxTol = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( myToBezierMaxTol, 0, 100, 1e-7, 10 );
 
       aLay->addWidget( myToBezierSurfModeChk, 0, 0 );
@@ -280,7 +282,7 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
 
-      mySameParameterTol3D = new QDoubleSpinBox( w );
+      mySameParameterTol3D = new SalomeApp_DoubleSpinBox( w );
       initSpinBox( mySameParameterTol3D, 0, 100, 1e-7, 10 );
       
       aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
@@ -508,10 +510,10 @@ void RepairGUI_ShapeProcessDlg::loadDefaults()
 void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& theValue )
 {
   if ( theControl && !theValue.isNull() ) {
-    if ( qobject_cast<QDoubleSpinBox*>( theControl ) )
-      qobject_cast<QDoubleSpinBox*>( theControl )->setValue( theValue.toDouble() );
-    else if ( qobject_cast<QSpinBox*>( theControl ) )
-      qobject_cast<QSpinBox*>( theControl )->setValue( theValue.toInt() );
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+      qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->setValue( theValue.toDouble() );
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+      qobject_cast<SalomeApp_IntSpinBox*>( theControl )->setValue( theValue.toInt() );
     else if ( qobject_cast<QComboBox*>( theControl ) )
       qobject_cast<QComboBox*>( theControl )->setEditText( theValue );
     else if ( qobject_cast<QCheckBox*>( theControl ) )
@@ -526,10 +528,10 @@ void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& th
 QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
 {
   if ( theControl ) {
-    if ( qobject_cast<QDoubleSpinBox*>( theControl ) )
-      return QString::number( qobject_cast<QDoubleSpinBox*>( theControl )->value() );
-    else if ( qobject_cast<QSpinBox*>( theControl ) )
-      return QString::number( qobject_cast<QSpinBox*>( theControl )->value() );
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+      return QString::number( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->value() );
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+      return QString::number( qobject_cast<SalomeApp_IntSpinBox*>( theControl )->value() );
     else if ( qobject_cast<QComboBox*>( theControl ) )
       return qobject_cast<QComboBox*>( theControl )->currentText();
     else if ( qobject_cast<QCheckBox*>( theControl ) )
@@ -538,6 +540,21 @@ QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
   return 0;
 }
 
+//=================================================================================
+// function : getText()
+// purpose  : get text in the proper way
+//=================================================================================
+QString RepairGUI_ShapeProcessDlg::getText( QWidget* theControl ) const
+{
+  if ( theControl ) {
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+      return qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->text();
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+      return qobject_cast<SalomeApp_IntSpinBox*>( theControl )->text();
+  }   
+  return QString::null;
+}
+
 //=================================================================================
 // function : createOperation
 // purpose  :
@@ -553,6 +570,22 @@ GEOM::GEOM_IOperations_ptr RepairGUI_ShapeProcessDlg::createOperation()
 //=================================================================================
 bool RepairGUI_ShapeProcessDlg::isValid( QString& msg )
 {
+  bool ok = true;
+  QMapIterator<QString,QStringList> aMapIter( myValMap );
+  while( aMapIter.hasNext() ) {
+    aMapIter.next();
+    const QStringList& aList = aMapIter.value();
+    QListIterator<QString> aListIter( aList );
+    while( aListIter.hasNext() ) {
+      const QString& aParam = aListIter.next();
+      QWidget* aControl = getControl( aParam );
+      if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ) )
+       ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
+      else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ) )
+       ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
+    }
+  }
+
   bool error = false;
   GEOM::string_array_var anOperators = getActiveOperators();
   if ( !myObjects->length() ) {
@@ -565,7 +598,7 @@ bool RepairGUI_ShapeProcessDlg::isValid( QString& msg )
     msg += tr( "ERROR_NO_OPERATORS" );
     error = true;
   }
-  return !error;
+  return !error && ok;
 }
 
 //=================================================================================
@@ -603,7 +636,20 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects )
     if ( anObj->_is_nil() )
       anErrorObjNames << GEOMBase::GetName( obj );
     else
+    {
+      QStringList aParameters;
+
+      for ( int i = 0; i < anOperators->length(); i++ )
+       aParameters << QString( anOperators[i] );
+
+      for ( int i = 0; i < aParams->length(); i++ )
+       aParameters << QString( aParams[i] );
+
+      aParameters << getTexts( aParams );
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
       objects.push_back( anObj._retn() );
+    }
   }
 
   if ( !anErrorObjNames.empty() )
@@ -764,6 +810,27 @@ GEOM::string_array* RepairGUI_ShapeProcessDlg::getValues( const GEOM::string_arr
   return aValues._retn();
 }
 
+//=================================================================================
+// function : getTexts
+// purpose  :
+//=================================================================================
+QStringList RepairGUI_ShapeProcessDlg::getTexts( const GEOM::string_array& theParams )
+{
+  QStringList aTexts;
+    
+  for ( int i = 0; i < theParams.length(); i++ ) {
+    QWidget* aCtrl = getControl( (const char*)theParams[i] );
+    if ( aCtrl )
+    {
+      QString aText = getText( aCtrl );
+      if( !aText.isNull() )
+       aTexts.append( aText );
+    }
+  }
+    
+  return aTexts;
+}
+
 //=================================================================================
 // function : initSelection
 // purpose  : set selection of ALL shape types except vertexes
index 4cfd35302623c093f3db2ee9bba5b7413a55095d..0d35a3665004b064eebff41093fdaf3ed387600b 100755 (executable)
@@ -31,8 +31,8 @@
 #include <QMap>
 
 class DlgRef_1Sel;
-class QSpinBox;
-class QDoubleSpinBox;
+class SalomeApp_IntSpinBox;
+class SalomeApp_DoubleSpinBox;
 class QComboBox;
 class QCheckBox;
 class QListWidget;
@@ -64,12 +64,15 @@ private:
   GEOM::string_array*                getParameters( const GEOM::string_array& );
   GEOM::string_array*                getValues( const GEOM::string_array& );
 
+  QStringList                        getTexts( const GEOM::string_array& );
+
   void                               enterEvent( QEvent* );
 
   QWidget*                           getControl( const QString&  );
   void                               setValue( QWidget*, const QString& ); // initialize the given control in the proper way
   // (analize its class and convert the value string)
   QString                            getValue( QWidget* ) const; // retrieve value of the control in the proper way
+  QString                            getText( QWidget* ) const; // retrieve text of the control (for spin-boxes only)
 
   //QDict<QString,QWidget*>            myCtrlMap;  // map of controls (values) of parameters
   void                               initParamsValues(); // initialize the data structures
@@ -84,38 +87,38 @@ private:
   DlgRef_1Sel*                       mySelectWdgt;
   QListWidget*                       myOpList;
   
-  QDoubleSpinBox*                    myFixShapeTol3D;
-  QDoubleSpinBox*                    myFixShapeMaxTol3D;
+  SalomeApp_DoubleSpinBox*           myFixShapeTol3D;
+  SalomeApp_DoubleSpinBox*           myFixShapeMaxTol3D;
 
-  QDoubleSpinBox*                    myFixFaceSizeTol;
+  SalomeApp_DoubleSpinBox*           myFixFaceSizeTol;
   
-  QDoubleSpinBox*                    myDropSmallEdgesTol3D;
+  SalomeApp_DoubleSpinBox*           myDropSmallEdgesTol3D;
 
-  QDoubleSpinBox*                    mySplitAngleAngle;
-  QDoubleSpinBox*                    mySplitAngleMaxTol;
+  SalomeApp_DoubleSpinBox*           mySplitAngleAngle;
+  SalomeApp_DoubleSpinBox*           mySplitAngleMaxTol;
   
-  QSpinBox*                          mySplitClosedFacesNum;
+  SalomeApp_IntSpinBox*              mySplitClosedFacesNum;
   
-  QDoubleSpinBox*                    mySplitContTol3D;
+  SalomeApp_DoubleSpinBox*           mySplitContTol3D;
   QComboBox*                         mySplitContSurfCont;
   QComboBox*                         mySplitContCurvCont;
   
   QCheckBox*                         myBSplineSurfModeChk;
   QCheckBox*                         myBSpline3DCurveChk;
   QCheckBox*                         myBSpline2DCurveChk;
-  QDoubleSpinBox*                    myBSplineTol3D;
-  QDoubleSpinBox*                    myBSplineTol2D;
-  QSpinBox*                          myBSplineDegree;
-  QSpinBox*                          myBSplineSegments;
+  SalomeApp_DoubleSpinBox*           myBSplineTol3D;
+  SalomeApp_DoubleSpinBox*           myBSplineTol2D;
+  SalomeApp_IntSpinBox*              myBSplineDegree;
+  SalomeApp_IntSpinBox*              myBSplineSegments;
   QComboBox*                         myBSpline2DCont;
   QComboBox*                         myBSpline3DCont;
   
   QCheckBox*                         myToBezierSurfModeChk;
   QCheckBox*                         myToBezier3DCurveChk;
   QCheckBox*                         myToBezier2DCurveChk;
-  QDoubleSpinBox*                    myToBezierMaxTol;
+  SalomeApp_DoubleSpinBox*           myToBezierMaxTol;
   
-  QDoubleSpinBox*                    mySameParameterTol3D;
+  SalomeApp_DoubleSpinBox*           mySameParameterTol3D;
   
 private slots:
   void                               onOk();