</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>
</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>
</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>
</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>
<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>
</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>
//Make a Python command
if (doCopy) {
- GEOM::TPythonDump(aFunction) << "geompy.MakeScaleAlongAxes("
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeScaleAlongAxes("
<< theObject << ", " << thePoint << ", "
<< theFactorX << ", " << theFactorY << ", " << theFactorZ << ")";
return aCopy;
# @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
# @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
# @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
# @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,
# @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
# @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
# -----------------------------------------------------------------------------
# @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.
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.
# @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
# @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
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()));
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 :
// 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;
}
//=================================================================================
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;
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;
}