]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Implementation Notebook in the GEOM.
authorrnv <rnv@opencascade.com>
Fri, 21 Nov 2008 17:00:36 +0000 (17:00 +0000)
committerrnv <rnv@opencascade.com>
Fri, 21 Nov 2008 17:00:36 +0000 (17:00 +0000)
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.ui
src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui
src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui
src/DlgRef/DlgRef_3Sel3Spin2Check_QTD.ui
src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui
src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.ui
src/GEOMImpl/GEOMImpl_ITransformOperations.cxx
src/GEOM_SWIG/geompyDC.py
src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx

index 9001ffd15b3abef4361057eccfde1c20e135551c..ab8c89f83e3ede98718599cba539e68b297276d6 100644 (file)
@@ -79,7 +79,7 @@
        </widget>
       </item>
       <item row="1" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
       </item>
       <item row="0" column="0" >
        <widget class="QLabel" name="TextLabel1" >
  <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 40f7335909af67d6fc2ed70139bd232be0a7b4a6..07800a567be5ac9ae43ced24a3f2c1f3119fca00 100644 (file)
        </widget>
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
       </item>
       <item row="2" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
       </item>
       <item row="3" column="0" >
        <widget class="QLabel" name="TextLabel4" >
  <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 a25d1159e7e40ace09d0aecbff8271087af1b92a..27e0b7e5640bfc69efea47f3406d54c4992aad5c 100644 (file)
        </widget>
       </item>
       <item row="6" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY2" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY2" />
       </item>
       <item row="5" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX2" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX2" />
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY1" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY1" />
       </item>
       <item row="2" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX1" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX1" />
       </item>
       <item row="6" column="0" >
        <widget class="QLabel" name="TextLabel6" >
  <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 e2c68c662ac4a5b903633eb3991fd3b9fd5faad4..10ee30bc3a3eb94f54329275b1e8431bc0dd5f7c 100644 (file)
        </widget>
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox1" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox1" />
       </item>
       <item row="4" column="0" >
        <widget class="QLabel" name="TextLabel5" >
        </widget>
       </item>
       <item row="4" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox2" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox2" />
       </item>
       <item row="5" column="0" >
        <widget class="QLabel" name="TextLabel6" >
        </widget>
       </item>
       <item row="5" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox3" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox3" />
       </item>
       <item row="6" column="0" colspan="3" >
        <widget class="QCheckBox" name="CheckBox1" >
  <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 9329141a8e1a12032c1bab9a5ba9e9a2fd8739a8..41fcdd0d0f169e971af3e115ad3e86093fd029ac 100644 (file)
        <number>6</number>
       </property>
       <item row="7" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY2" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY2" />
       </item>
       <item row="6" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX2" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX2" />
       </item>
       <item row="4" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DY1" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY1" />
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="QtxDoubleSpinBox" name="SpinBox_DX1" />
+       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX1" />
       </item>
       <item row="5" column="0" colspan="3" >
        <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 43217034f93a241048ce522fa68a5e830ce1f77c..fd51fd4a221bac945790fa3f0394deac235d40e8 100644 (file)
@@ -76,7 +76,7 @@
        </widget>
       </item>
       <item row="4" 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 957197365a65f9d326dfd2d8c51444ff90edd764..d6043d2c5d7470a92ce24ad203f1825b71157a8e 100644 (file)
@@ -1206,7 +1206,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeAlongAxes (Handle(G
 
   //Make a Python command
   if (doCopy) {
-    GEOM::TPythonDump(aFunction) << "geompy.MakeScaleAlongAxes("
+    GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeScaleAlongAxes("
                                  << theObject << ", " << thePoint << ", "
                                  << theFactorX << ", " << theFactorY << ", " << theFactorZ << ")";
     return aCopy;
index 7438859ffb27189eedbacf46a7dd355d34ebafcd..1996716ace3cb0500082a0c6523438978297ee8c 100644 (file)
@@ -2189,7 +2189,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_translation "Example"
         def MakeTranslation(self,theObject, theDX, theDY, theDZ):
             # Example: see GEOM_TestAll.py
+            theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
+            anObj.SetParameters(Parameters)
             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
             return anObj
 
@@ -2216,8 +2218,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_translation "Example"
         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
             # Example: see GEOM_TestAll.py
+            theDistance,Parameters = ParseParameters(theDistance)
             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Rotate the given object around the given axis
@@ -2230,8 +2234,15 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_rotation "Example"
         def MakeRotation(self,theObject, theAxis, theAngle):
             # Example: see GEOM_TestAll.py
+            flag = False
+            if isinstance(theAngle,str):
+                flag = True
+            theAngle, Parameters = ParseParameters(theAngle)
+            if flag:
+                theAngle = theAngle*math.pi/180.0
             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
             RaiseIfFailed("RotateCopy", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Rotate given object around vector perpendicular to plane
@@ -2259,8 +2270,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_scale "Example"
         def MakeScaleTransform(self, theObject, thePoint, theFactor):
             # Example: see GEOM_TestAll.py
+            theFactor, Parameters = ParseParameters(theFactor)
             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Scale the given object by different factors along coordinate axes,
@@ -2274,9 +2287,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref swig_scale "Example"
         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
             # Example: see GEOM_TestAll.py
+            theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
                                                         theFactorX, theFactorY, theFactorZ)
             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Create an object, symmetrical
@@ -2344,8 +2359,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_offset "Example"
         def MakeOffset(self,theObject, theOffset):
             # Example: see GEOM_TestAll.py
+            theOffset, Parameters = ParseParameters(theOffset)
             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         # -----------------------------------------------------------------------------
@@ -2363,8 +2380,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_multi_translation "Example"
         def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
             # Example: see GEOM_TestAll.py
+            theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Conseqently apply two specified translations to theObject specified number of times.
@@ -2382,9 +2401,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
                                    theVector2, theStep2, theNbTimes2):
             # Example: see GEOM_TestAll.py
+            theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
                                                  theVector2, theStep2, theNbTimes2)
             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Rotate the given object around the given axis a given number times.
@@ -2398,8 +2419,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_multi_rotation "Example"
         def MultiRotate1D(self,theObject, theAxis, theNbTimes):
             # Example: see GEOM_TestAll.py
+            theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
             RaiseIfFailed("MultiRotate1D", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Rotate the given object around the
@@ -2419,8 +2442,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref tui_multi_rotation "Example"
         def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
             # Example: see GEOM_TestAll.py
+            theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## The same, as MultiRotate1D(), but axis is given by direction and point
index 439a147535719b856c251f4b42b8b3a8a175913a..c94a58629d8752b5401a69c093ccb2c56fd16242 100644 (file)
@@ -174,6 +174,9 @@ void TransformationGUI_MultiRotationDlg::Init()
   connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
   connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
 
+  connect(GroupDimensions->SpinBox_DX1,SIGNAL(textChanged( const QString& )),
+          this, SLOT(TextValueChangedInSpinBox( const QString& )));
+
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
 
   connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
@@ -460,6 +463,17 @@ void TransformationGUI_MultiRotationDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
+//=================================================================================
+// function : TextValueChangedInSpinBox()
+// purpose  :
+//=================================================================================
+void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox(const QString& s){
+  bool isDigit;
+  s.toDouble(&isDigit);
+  if(!isDigit)
+    GroupDimensions->CheckButton1->setChecked(false);
+  GroupDimensions->CheckButton1->setEnabled(isDigit);
+}
 //=================================================================================
 // function : ValueChangedInSpinBox()
 // purpose  :
@@ -511,9 +525,21 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool TransformationGUI_MultiRotationDlg::isValid (QString& /*msg*/)
+bool TransformationGUI_MultiRotationDlg::isValid (QString& msg)
 {
-  return !(myBase->_is_nil() || myVector->_is_nil());
+  bool ok = true;
+  switch(getConstructorId()){
+  case 0:
+    ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+    break;
+  case 1:                                           
+    ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) && ok;
+    ok = GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) && ok;
+    ok = GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) && ok;
+    ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok;        
+    break;
+  }
+  return !(myBase->_is_nil() || myVector->_is_nil()) && ok;
 }
 
 //=================================================================================
@@ -525,12 +551,15 @@ bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
   bool res = false;
 
   GEOM::GEOM_Object_var anObj;
+  QStringList aParameters;
 
   switch (getConstructorId()) {
   case 0:
     if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) {
       anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
         MultiRotate1D(myBase, myVector, myNbTimes1);
+      if(!IsPreview())
+        aParameters<<GroupPoints->SpinBox_DX->text();
       res = true;
     }
     break;
@@ -538,13 +567,22 @@ bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
     if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVector)) {
       anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
         MultiRotate2D(myBase, myVector, myAng, myNbTimes1, myStep, myNbTimes2);
+      if(!IsPreview()) {
+        aParameters<<GroupDimensions->SpinBox_DX1->text();
+        aParameters<<GroupDimensions->SpinBox_DY1->text();
+        aParameters<<GroupDimensions->SpinBox_DX2->text();
+        aParameters<<GroupDimensions->SpinBox_DY2->text();
+      }
       res = true;
     }
     break;
   }
 
-  if (!anObj->_is_nil())
+  if (!anObj->_is_nil()) {
+    if(!IsPreview())
+      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
     objects.push_back(anObj._retn());
+  }
 
   return res;
 }