this way you don't need to create them in advance).
\n <b>TUI Command:</b> <em>geompy.MakeBox(x1,y1,z1,x2,y2,z2)</em>
\n <b>Arguments:</b> Name + X, Y and Z coordinates of both points.
+\note You can also use variables defined in the SALOME \b NoteBook
+to specify any numerical parameters of the box.
+
+\image html box3.png
<b>Example:</b>
various algorithms;</li>
<li>\subpage repairing_operations_page "optimization of geometrical objects";</li>
<li>\subpage using_measurement_tools_page "provision of information about geometrical objects".</li>
+<li>\subpage using_notebook_geom_page.</li>
</ul>
Almost all geometry module functionalities are accessible via
--- /dev/null
+/*!
+
+\page using_notebook_geom_page Using SALOME NoteBook
+
+It is possible to use variables defined through <b>SALOME NoteBook</b> for
+creation and modification of objects in the Geometry module with the following
+limitations:
+
+<ul>
+<li> \ref create_lcs_page "Local Coordinate System" dialog box.\n
+ The notebook parameters are correctly applied, but the study
+ update is problematic in case if the LCS is defined using an
+ object whose dimensions are given by parameters.
+<li> \ref color_page "Select color" dialog box.
+<li> \ref isolines_page "Select Number of Isos" dialog box.
+</ul>
+*/
+
* For example, method return false for GEOM_MARKER
*/
boolean IsShape();
+
+ /*!
+ * Set list of parameters
+ * \param theParameters is a string containing the notebook variables separated by ":" symbol,
+ * used for object creation
+ */
+ void SetParameters (in string theParameters);
+
+ /*!
+ * Return list of notebook variables used for object creation separated by ":" symbol
+ */
+ string GetParameters();
};
bool BasicGUI_CircleDlg::isValid( QString& msg )
{
const int id = getConstructorId();
- if ( id == 0 )
+ if ( id == 0 ) {
//return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0;
//nil point means origin of global CS
//nil vector means Z axis
- return getRadius() > 0;
+ bool ok = GroupPntVecR->SpinBox_DX->isValid(msg, !IsPreview());
+ return getRadius() > 0 && ok;
+ }
else if ( id == 1 )
return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
!isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
switch ( getConstructorId() ) {
case 0 :
- anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCirclePntVecR( myPoint, myDir, getRadius() );
- res = true;
- break;
+ {
+ QStringList aParameters;
+ aParameters << GroupPntVecR->SpinBox_DX->text();
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCirclePntVecR( myPoint, myDir, getRadius() );
+ if ( !anObj->_is_nil() && !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ res = true;
+ break;
+ }
case 1 :
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCircleThreePnt( myPoint1, myPoint2, myPoint3 );
res = true;
//return !myPoint->_is_nil() && !myDir->_is_nil();
//nil point means origin of global CS
//nil vector means Z axis
- return true;
+ bool ok = true;
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ return ok;
}
//=================================================================================
{
double aMajorR = GroupPoints->SpinBox_DX->value();
double aMinorR = GroupPoints->SpinBox_DY->value();
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse( myPoint, myDir, aMajorR, aMinorR );
- if ( !anObj->_is_nil() )
+ QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox_DX->text();
+ aParameters<<GroupPoints->SpinBox_DY->text();
+
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse( myPoint, myDir, aMajorR, aMinorR );
+ if ( !anObj->_is_nil() ) {
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( anObj._retn() );
-
+ }
return true;
}
QVBoxLayout* anOriGrpLayout = new QVBoxLayout( anOriGrp );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), anOriGrp ) );
- myData[ X ] = new QtxDoubleSpinBox( anOriGrp );
+ myData[ X ] = new SalomeApp_DoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ X ] );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), anOriGrp ) );
- myData[ Y ] = new QtxDoubleSpinBox( anOriGrp );
+ myData[ Y ] = new SalomeApp_DoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ Y ] );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), anOriGrp ) );
- myData[ Z ] = new QtxDoubleSpinBox( anOriGrp );
+ myData[ Z ] = new SalomeApp_DoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ Z ] );
aMainGrpLayout->addWidget( anOriGrp );
QVBoxLayout* aXAxisGrpLayout = new QVBoxLayout( aXAxisGrp );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), aXAxisGrp ) );
- myData[ DX1 ] = new QtxDoubleSpinBox( aXAxisGrp );
+ myData[ DX1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DX1 ] );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), aXAxisGrp ) );
- myData[ DY1 ] = new QtxDoubleSpinBox( aXAxisGrp );
+ myData[ DY1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DY1 ] );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), aXAxisGrp ) );
- myData[ DZ1 ] = new QtxDoubleSpinBox( aXAxisGrp );
+ myData[ DZ1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DZ1 ] );
aMainGrpLayout->addWidget( aXAxisGrp );
QVBoxLayout* anYAxisGrpLayout = new QVBoxLayout( anYAxisGrp );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), anYAxisGrp ) );
- myData[ DX2 ] = new QtxDoubleSpinBox( anYAxisGrp );
+ myData[ DX2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DX2 ] );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), anYAxisGrp ) );
- myData[ DY2 ] = new QtxDoubleSpinBox( anYAxisGrp );
+ myData[ DY2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DY2 ] );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), anYAxisGrp ) );
- myData[ DZ2 ] = new QtxDoubleSpinBox( anYAxisGrp );
+ myData[ DZ2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DZ2 ] );
aMainGrpLayout->addWidget( anYAxisGrp );
}
switch ( id ) {
- case 0:
- return isOk;
+ case 0: {
+ bool ok = true;
+ for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
+ ok = anIter.value()->isValid( msg, !IsPreview()) && ok;
+ return isOk && ok;
+ }
case 1:
return !Group1->LineEdit1->text().isEmpty() && isOk;
case 2:
getOperation() )->MakeMarker( myData[ X ]->value(), myData[ Y ]->value(), myData[ Z ]->value(),
myData[ DX1 ]->value(), myData[ DY1 ]->value(), myData[ DZ1 ]->value(),
myData[ DX2 ]->value(), myData[ DY2 ]->value(), myData[ DZ2 ]->value() );
-
- if ( !anObj->_is_nil() )
+ QStringList aParameters;
+ aParameters<<myData[X]->text();
+ aParameters<<myData[Y]->text();
+ aParameters<<myData[Z]->text();
+ aParameters<<myData[ DX1 ]->text();
+ aParameters<<myData[ DY1 ]->text();
+ aParameters<<myData[ DZ1 ]->text();
+ aParameters<<myData[ DX2 ]->text();
+ aParameters<<myData[ DY2 ]->text();
+ aParameters<<myData[ DZ2 ]->text();
+
+ if ( !anObj->_is_nil() ) {
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( anObj._retn() );
+ }
return true;
}
class DlgRef_1Sel;
class DlgRef_3Sel;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QFrame;
class BasicGUI_MarkerDlg : public GEOMBase_Skeleton
private:
enum { X, Y, Z, DX1, DY1, DZ1, DX2, DY2, DZ2 };
- typedef QMap< int, QtxDoubleSpinBox* > DataMap;
+ typedef QMap< int, SalomeApp_DoubleSpinBox* > DataMap;
public:
BasicGUI_MarkerDlg( GeometryGUI*, QWidget* );
return 0.;
}
+//=================================================================================
+// function : getSize()
+// purpose :
+//=================================================================================
+QString BasicGUI_PlaneDlg::getSizeAsString() const
+{
+ switch ( getConstructorId() ) {
+ case 0 : return GroupPntDir->SpinBox_DX->text();
+ case 1 : return Group3Pnts->SpinBox_DX->text();
+ case 2 : return GroupFace->SpinBox_DX->text();
+ }
+ return QString();
+}
+
//=================================================================================
// function : createOperation
// purpose :
msg = QString( "Please, enter size greater than 0." );
return false;
}
- if ( id == 0 )
- return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir );
- else if ( id == 1 )
+
+ if ( id == 0 ) {
+ bool ok = GroupPntDir->SpinBox_DX->isValid( msg, !IsPreview() );
+ return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) && ok;
+ }
+ else if ( id == 1 ) {
+ bool ok = Group3Pnts->SpinBox_DX->isValid( msg, !IsPreview() );
return !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) &&
- !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
- else if ( id == 2 )
- return !CORBA::is_nil( myFace );
+ !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 ) && ok;
+ }
+ else if ( id == 2 ) {
+ bool ok = GroupFace->SpinBox_DX->isValid( msg, !IsPreview() );
+ return !CORBA::is_nil( myFace ) && ok;
+ }
return false;
}
res = true;
break;
}
-
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
+ if ( !anObj->_is_nil() ) {
+ if ( !IsPreview() )
+ anObj->SetParameters(getSizeAsString().toLatin1().constData());
+ objects.push_back( anObj._retn() );
+ }
return res;
}
//=================================================================================
void Init();
void enterEvent( QEvent* );
double getSize() const;
+ QString getSizeAsString() const;
private:
GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3, myFace;
// function : isValid
// purpose :
//=================================================================================
-bool BasicGUI_PointDlg::isValid( QString& /*msg*/ )
+bool BasicGUI_PointDlg::isValid( QString& msg )
{
const int id = getConstructorId();
- if ( id == 0 )
- return true;
- else if ( id == 1 )
- return !myRefPoint->_is_nil();
- else if ( id == 2 )
- return !myEdge->_is_nil();
+ if ( id == 0 ) {
+ bool ok = true;
+ ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+ return ok;
+ }
+ else if ( id == 1 ) {
+ bool ok = true;
+ ok = GroupRefPoint->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupRefPoint->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupRefPoint->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+
+ return !myRefPoint->_is_nil() && ok;
+ }
+ else if ( id == 2 ) {
+ bool ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
+ return !myEdge->_is_nil() && ok;
+ }
else if ( id == 3 )
return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
- else if ( id == 4 )
- return !myFace->_is_nil();
+ else if ( id == 4 ) {
+ bool ok = true;
+ ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupOnSurface->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ return !myFace->_is_nil() && ok;
+
+ }
return false;
}
bool res = false;
GEOM::GEOM_Object_var anObj;
+ QStringList aParameters;
switch ( getConstructorId() ) {
case 0 :
double x = GroupXYZ->SpinBox_DX->value();
double y = GroupXYZ->SpinBox_DY->value();
double z = GroupXYZ->SpinBox_DZ->value();
+
+ aParameters << GroupXYZ->SpinBox_DX->text();
+ aParameters << GroupXYZ->SpinBox_DY->text();
+ aParameters << GroupXYZ->SpinBox_DZ->text();
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x, y, z );
res = true;
double dx = GroupRefPoint->SpinBox_DX->value();
double dy = GroupRefPoint->SpinBox_DY->value();
double dz = GroupRefPoint->SpinBox_DZ->value();
+
+ aParameters << GroupRefPoint->SpinBox_DX->text();
+ aParameters << GroupRefPoint->SpinBox_DY->text();
+ aParameters << GroupRefPoint->SpinBox_DZ->text();
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointWithReference( myRefPoint, dx, dy, dz );
case 2 :
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointOnCurve( myEdge, getParameter() );
+ aParameters<<GroupOnCurve->SpinBox_DX->text();
res = true;
break;
case 3 :
case 4 :
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointOnSurface( myFace, getUParameter(), getVParameter() );
+ aParameters<<GroupOnSurface->SpinBox_DX->text();
+ aParameters<<GroupOnSurface->SpinBox_DY->text();
res = true;
break;
}
+ if(!anObj->_is_nil() && !IsPreview() && (getConstructorId()==0 ||
+ getConstructorId() == 1 ||
+ getConstructorId() == 2 ||
+ getConstructorId() == 4) ) {
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
+
+
if ( getConstructorId() == 1 || getConstructorId() == 2 ||
getConstructorId() == 4 ) {
TopoDS_Shape aShape;
//=================================================================================
bool BasicGUI_VectorDlg::isValid( QString& msg )
{
- return getConstructorId() == 0 ? !myPoint1->_is_nil() && !myPoint2->_is_nil() : true;
+ if(getConstructorId() == 0)
+ return !myPoint1->_is_nil() && !myPoint2->_is_nil();
+ else if(getConstructorId() == 1)
+ {
+ bool ok = true;
+ ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+ return ok;
+ }
+ return false;
}
//=================================================================================
double dx = GroupDimensions->SpinBox_DX->value();
double dy = GroupDimensions->SpinBox_DY->value();
double dz = GroupDimensions->SpinBox_DZ->value();
+
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ aParameters << GroupDimensions->SpinBox_DZ->text();
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeVectorDXDYDZ( dx, dy, dz );
+
+ if ( !anObj->_is_nil() && !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
res = true;
break;
}
// 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:
break;
}
- return ok;
+ return ok && okSP;
}
//=================================================================================
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() ) {
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() ) ) )
+ {
+ if ( !IsPreview() )
+ (*anIter)->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( *anIter );
+ }
else
toRemoveFromEngine.push_back( *anIter );
}
}
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] );
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ objects.push_back( anObj._retn() );
+ }
}
return objects.size();
{
// Set range of spinboxes
double SpecificStep = 1.0;
- QMap<int, QtxDoubleSpinBox*>::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, 999, SpecificStep, 3);
for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn)
connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- QMap<int, QtxDoubleSpinBox*>::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)));
+ connect(anIterSpin.value(), SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
// init controls and fields
initName(tr("GEOM_BLOCK_MULTITRSF"));
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
-void BlocksGUI_TrsfDlg::ValueChangedInSpinBox(double)
+void BlocksGUI_TrsfDlg::ValueChangedInSpinBox(int)
{
displayPreview();
}
const int theId)
{
QLabel* lab = new QLabel(theLbl, theParent);
- mySpinBox[theId] = new QtxDoubleSpinBox(theParent);
+ mySpinBox[theId] = new SalomeApp_DoubleSpinBox(theParent);
QGridLayout* l = 0;
if (!theParent->layout()) {
l = new QGridLayout(theParent);
// 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;
}
//=================================================================================
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
MakeMultiTransformation1D(myShape,
myFaces[Face1], myFaces[Face2],
- (int)mySpinBox[SpinBox1]->value());
+ mySpinBox[SpinBox1]->value());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << "" << "";
+ aParameters << mySpinBox[SpinBox1]->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
case 1:
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
MakeMultiTransformation2D (myShape,
myFaces[Face1U], myFaces[Face2U],
- (int)mySpinBox[SpinBox2U]->value(),
+ mySpinBox[SpinBox2U]->value(),
myFaces[Face1V], myFaces[Face2V],
- (int)mySpinBox[SpinBox2V]->value());
+ mySpinBox[SpinBox2V]->value());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << "" << "";
+ aParameters << mySpinBox[SpinBox2U]->text();
+ aParameters << "" << "";
+ aParameters << mySpinBox[SpinBox2V]->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
default:
#include <QMap>
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QGroupBox;
class QPushButton;
class QLineEdit;
QMap<int, QPushButton*> mySelBtn;
QMap<int, QLineEdit*> mySelName;
- QMap<int, QtxDoubleSpinBox*> mySpinBox;
+ QMap<int, SalomeApp_DoubleSpinBox*> mySpinBox;
private slots:
void ClickOnOk();
void SelectionIntoArgument();
void SetEditCurrentArgument();
- void ValueChangedInSpinBox (double);
+ void ValueChangedInSpinBox (int);
};
#endif // BLOCKSGUI_TRSFDLG_H
</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="1" column="1" colspan="2" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
</layout>
</widget>
<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 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>
<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="1" column="1" colspan="2" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
- <class>QtxDoubleSpinBox</class>
+ <class>SalomeApp_DoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
- <header location="global" >QtxDoubleSpinBox.h</header>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<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>
<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="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
- <class>QtxDoubleSpinBox</class>
+ <class>SalomeApp_DoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
- <header location="global" >QtxDoubleSpinBox.h</header>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
</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>
</widget>
</item>
<item row="0" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
</layout>
</widget>
<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>
<resources/>
<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>
<number>6</number>
</property>
<item row="2" column="1" colspan="2" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="TextLabel3" >
<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>
<number>6</number>
</property>
<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="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>
</widget>
</item>
<item row="2" column="1" colspan="2" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="4" column="1" colspan="2" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
<item row="3" column="1" colspan="2" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
</layout>
</widget>
<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="0" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
</widget>
</item>
<item row="1" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
</layout>
</widget>
<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>
<resources/>
</widget>
</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="2" >
<spacer name="verticalSpacer" >
<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_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
</layout>
</widget>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
- <class>QtxDoubleSpinBox</class>
+ <class>SalomeApp_DoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
- <header location="global" >QtxDoubleSpinBox.h</header>
- </customwidget>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
</customwidgets>
<tabstops>
<tabstop>PushButton1</tabstop>
</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="0" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="2" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
</layout>
</widget>
<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="2" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
<item row="1" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="0" column="1" >
- <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
- <class>QtxDoubleSpinBox</class>
+ <class>SalomeApp_DoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
- <header location="global" >QtxDoubleSpinBox.h</header>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<number>6</number>
</property>
<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>
<number>6</number>
</property>
<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>
<number>6</number>
</property>
<item row="0" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="2" >
<layout class="QGridLayout" >
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>SpinBox_DX</tabstop>
<tabstop>buttonApply</tabstop>
<number>6</number>
</property>
<item row="1" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="0" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<number>6</number>
</property>
<item row="2" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DZ" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
<item row="1" column="2" >
<layout class="QGridLayout" >
</widget>
</item>
<item row="1" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="0" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
<number>6</number>
</property>
<item row="2" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DZ" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
<item row="3" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DS" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DS" />
</item>
<item row="1" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DY" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="0" column="1" >
- <widget class="QDoubleSpinBox" name="SpinBox_DX" />
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="2" >
<layout class="QGridLayout" >
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global" >SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>SpinBox_DX</tabstop>
<tabstop>SpinBox_DY</tabstop>
const double lineWidth )
: QDialog( parent, fl ),
myIsAllAdded( false ),
+ myIsApply( false ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeometryGUI( GUI ),
myLineWidth( lineWidth )
}
}
- if (event->type() == QEvent::KeyRelease) {
- // NPAL16010 (Sketcher Apply non available if only one line is modified)
- // To have Apply active as soon as value text changed
- QtxDoubleSpinBox* aDoubleSpinBox = (QtxDoubleSpinBox*)object;
- if (aDoubleSpinBox)
- ValueChangedInSpinBox( aDoubleSpinBox->value() );
- }
-
+ // Fix of the NPAL16010 bug is removed, because it's not actual with the Qt-4.x
+
return QDialog::eventFilter(object, event);
}
return;
}
- QString Command = myCommand.join( "" ) + GetNewCommand();
+ QString Parameters;
+ QString Command = myCommand.join( "" ) + GetNewCommand( Parameters );
Sketcher_Profile aProfile( Command.toAscii() );
Command = myCommand.join( "" );
if ( sender() && sender()->inherits( "QPushButton" ) )
( (QPushButton*)sender() )->setFocus(); // to update value of currently edited spin-box (PAL11948)
- myCommand.append( GetNewCommand() );
+ QString aParameters;
+ myCommand.append( GetNewCommand( aParameters ) );
mySketchState = NEXT_POINT;
myUndoCommand.clear();
myUndoCommand.append( "Sketcher" );
+ myParameters.append( aParameters );
+ myUndoParameters.clear();
+
MainWidget->GroupConstructors->setEnabled( true );
MainWidget->GroupDest1->setEnabled( true );
setEnabledUndo( true );
setEnabledRedo( false );
+ myIsApply = true;
GEOMBase_Helper::displayPreview( false, true, true, myLineWidth );
+ myIsApply = false;
// Set focus to SpinBox_DX
if ( sender() == Group1Spin->buttonApply ) {
myUndoCommand.append( myCommand.last() );
myCommand.pop_back();
+ myUndoParameters.append( myParameters.last() );
+ myParameters.pop_back();
+
if ( myCommand.count() == 1 ) {
mySketchState = FIRST_POINT;
myCommand.append( myUndoCommand.last() );
myUndoCommand.pop_back();
+ myParameters.append( myUndoParameters.last() );
+ myUndoParameters.pop_back();
+
mySketchState = NEXT_POINT;
MainWidget->GroupConstructors->setEnabled( true );
Standard_Real vx, vy, vz, vs;
vx = vy = vz = vs = 0.0;
+ QString vxStr, vyStr, vzStr, vsStr;
+
+ QString newValueStr;
+ if( SalomeApp_DoubleSpinBox* aDoubleSpinBox = (SalomeApp_DoubleSpinBox*)send )
+ newValueStr = aDoubleSpinBox->text();
+
if ( send == Group1Spin->SpinBox_DX ) {
- vx = newValue;
+ vx = newValue; vxStr = newValueStr;
}
else if ( send == Group2Spin->SpinBox_DX ) {
- vx = newValue;
- vy = Group2Spin->SpinBox_DY->value();
+ vx = newValue; vxStr = newValueStr;
+ vy = Group2Spin->SpinBox_DY->value(); vyStr = Group2Spin->SpinBox_DY->text();
}
else if ( send == Group2Spin->SpinBox_DY ) {
- vx = Group2Spin->SpinBox_DX->value();
- vy = newValue;
+ vx = Group2Spin->SpinBox_DX->value(); vxStr = Group2Spin->SpinBox_DX->text();
+ vy = newValue; vyStr = newValueStr;
}
else if ( send == Group3Spin->SpinBox_DX ) {
- vx = newValue;
- vy = Group3Spin->SpinBox_DY->value();
- vz = Group3Spin->SpinBox_DZ->value();
+ vx = newValue; vxStr = newValueStr;
+ vy = Group3Spin->SpinBox_DY->value(); vyStr = Group3Spin->SpinBox_DY->text();
+ vz = Group3Spin->SpinBox_DZ->value(); vzStr = Group3Spin->SpinBox_DZ->text();
}
else if ( send == Group3Spin->SpinBox_DY ) {
- vx = Group3Spin->SpinBox_DX->value();
- vy = newValue;
- vz = Group3Spin->SpinBox_DZ->value();
+ vx = Group3Spin->SpinBox_DX->value(); vxStr = Group3Spin->SpinBox_DX->text();
+ vy = newValue; vyStr = newValueStr;
+ vz = Group3Spin->SpinBox_DZ->value(); vzStr = Group3Spin->SpinBox_DZ->text();
}
else if ( send == Group3Spin->SpinBox_DZ ) {
- vx = Group3Spin->SpinBox_DX->value();
- vy = Group3Spin->SpinBox_DY->value();
- vz = newValue;
+ vx = Group3Spin->SpinBox_DX->value(); vxStr = Group3Spin->SpinBox_DX->text();
+ vy = Group3Spin->SpinBox_DY->value(); vyStr = Group3Spin->SpinBox_DY->text();
+ vz = newValue; vzStr = newValueStr;
}
else if ( send == Group4Spin->SpinBox_DX ) {
- vx = newValue;
- vy = Group4Spin->SpinBox_DY->value();
- vz = Group4Spin->SpinBox_DZ->value();
- vs = Group4Spin->SpinBox_DS->value();
+ vx = newValue; vxStr = newValueStr;
+ vy = Group4Spin->SpinBox_DY->value(); vyStr = Group4Spin->SpinBox_DY->text();
+ vz = Group4Spin->SpinBox_DZ->value(); vzStr = Group4Spin->SpinBox_DZ->text();
+ vs = Group4Spin->SpinBox_DS->value(); vsStr = Group4Spin->SpinBox_DS->text();
}
else if ( send == Group4Spin->SpinBox_DY ) {
- vx = Group4Spin->SpinBox_DX->value();
- vy = newValue;
- vz = Group4Spin->SpinBox_DZ->value();
- vs = Group4Spin->SpinBox_DS->value();
+ vx = Group4Spin->SpinBox_DX->value(); vxStr = Group4Spin->SpinBox_DX->text();
+ vy = newValue; vyStr = newValueStr;
+ vz = Group4Spin->SpinBox_DZ->value(); vzStr = Group4Spin->SpinBox_DZ->text();
+ vs = Group4Spin->SpinBox_DS->value(); vsStr = Group4Spin->SpinBox_DS->text();
}
else if ( send == Group4Spin->SpinBox_DZ ) {
- vx = Group4Spin->SpinBox_DX->value();
- vy = Group4Spin->SpinBox_DY->value();
- vz = newValue;
- vs = Group4Spin->SpinBox_DS->value();
+ vx = Group4Spin->SpinBox_DX->value(); vxStr = Group4Spin->SpinBox_DX->text();
+ vy = Group4Spin->SpinBox_DY->value(); vyStr = Group4Spin->SpinBox_DY->text();
+ vz = newValue; vzStr = newValueStr;
+ vs = Group4Spin->SpinBox_DS->value(); vsStr = Group4Spin->SpinBox_DS->text();
}
else if ( send == Group4Spin->SpinBox_DS ) {
- vx = Group4Spin->SpinBox_DX->value();
- vy = Group4Spin->SpinBox_DY->value();
- vz = Group4Spin->SpinBox_DZ->value();
- vs = newValue;
- }
- // NPAL16010 (Sketcher Apply non available if only one line is modified)
- // if ValueChangedInSpinBox() called from eventFilter()
- else if ( Group1Spin->SpinBox_DX->hasFocus() ) {
- vx = newValue;
- }
- else if ( Group2Spin->SpinBox_DX ->hasFocus() ) {
- vx = newValue;
- vy = Group2Spin->SpinBox_DY->value();
- }
- else if ( Group2Spin->SpinBox_DY->hasFocus() ) {
- vx = Group2Spin->SpinBox_DX->value();
- vy = newValue;
- }
- else if ( Group3Spin->SpinBox_DX->hasFocus() ) {
- vx = newValue;
- vy = Group3Spin->SpinBox_DY->value();
- vz = Group3Spin->SpinBox_DZ->value();
- }
- else if ( Group3Spin->SpinBox_DY->hasFocus() ) {
- vx = Group3Spin->SpinBox_DX->value();
- vy = newValue;
- vz = Group3Spin->SpinBox_DZ->value();
- }
- else if ( Group3Spin->SpinBox_DZ->hasFocus() ) {
- vx = Group3Spin->SpinBox_DX->value();
- vy = Group3Spin->SpinBox_DY->value();
- vz = newValue;
- }
- else if ( Group4Spin->SpinBox_DX->hasFocus() ) {
- vx = newValue;
- vy = Group4Spin->SpinBox_DY->value();
- vz = Group4Spin->SpinBox_DZ->value();
- vs = Group4Spin->SpinBox_DS->value();
- }
- else if ( Group4Spin->SpinBox_DY->hasFocus() ) {
- vx = Group4Spin->SpinBox_DX->value();
- vy = newValue;
- vz = Group4Spin->SpinBox_DZ->value();
- vs = Group4Spin->SpinBox_DS->value();
- }
- else if ( Group4Spin->SpinBox_DZ->hasFocus() ) {
- vx = Group4Spin->SpinBox_DX->value();
- vy = Group4Spin->SpinBox_DY->value();
- vz = newValue;
- vs = Group4Spin->SpinBox_DS->value();
- }
- else if ( Group4Spin->SpinBox_DS->hasFocus() ) {
- vx = Group4Spin->SpinBox_DX->value();
- vy = Group4Spin->SpinBox_DY->value();
- vz = Group4Spin->SpinBox_DZ->value();
- vs = newValue;
+ vx = Group4Spin->SpinBox_DX->value(); vxStr = Group4Spin->SpinBox_DX->text();
+ vy = Group4Spin->SpinBox_DY->value(); vyStr = Group4Spin->SpinBox_DY->text();
+ vz = Group4Spin->SpinBox_DZ->value(); vzStr = Group4Spin->SpinBox_DZ->text();
+ vs = newValue; vsStr = newValueStr;
}
+ // Fix of the NPAL16010 bug is removed, because it's not actual with the Qt-4.x
if ( myConstructorId == 0 ) { // SEGMENT
if ( mySketchType == PT_ABS ) {
myX = vx;
myY = vy;
+ myXStr = vxStr;
+ myYStr = vyStr;
}
else if ( mySketchType == PT_RELATIVE ) {
myDX = vx;
myDY = vy;
+ myDXStr = vxStr;
+ myDYStr = vyStr;
}
else if ( mySketchType == DIR_ANGLE_LENGTH ) {
myAngle = vx;
myLength = vy;
+ myAngleStr = vxStr;
+ myLengthStr = vyStr;
}
else if ( mySketchType == DIR_ANGLE_X ) {
myAngle = vx;
myX = vy;
+ myAngleStr = vxStr;
+ myXStr = vyStr;
}
else if ( mySketchType == DIR_ANGLE_Y ) {
myAngle = vx;
myY = vy;
+ myAngleStr = vxStr;
+ myYStr = vyStr;
}
else if ( mySketchType == DIR_PER_LENGTH ) {
myLength = vx;
+ myLengthStr = vxStr;
}
else if ( mySketchType == DIR_PER_X ) {
myX = vx;
+ myXStr = vxStr;
}
else if ( mySketchType == DIR_PER_Y ) {
myY = vx;
+ myYStr = vxStr;
}
else if ( mySketchType == DIR_TAN_LENGTH ) {
myLength = vx;
+ myLengthStr = vxStr;
}
else if ( mySketchType == DIR_TAN_X ) {
myX = vx;
+ myXStr = vxStr;
}
else if ( mySketchType == DIR_TAN_Y ) {
myY = vx;
+ myYStr = vxStr;
}
else if ( mySketchType == DIR_DXDY_LENGTH ) {
myDX = vx;
myDY = vy;
myLength = vz;
+ myDXStr = vxStr;
+ myDYStr = vyStr;
+ myLengthStr = vzStr;
}
else if ( mySketchType == DIR_DXDY_X ) {
myDX = vx;
myDY = vy;
myX = vz;
+ myDXStr = vxStr;
+ myDYStr = vyStr;
+ myXStr = vzStr;
}
else if ( mySketchType == DIR_DXDY_Y ) {
myDX = vx;
myDY = vy;
myY = vz;
+ myDXStr = vxStr;
+ myDYStr = vyStr;
+ myYStr = vzStr;
}
}
else if ( myConstructorId == 1 ) { // ARC
myAngle = vx;
myRadius = vy;
myLength = vz;
+ myAngleStr = vxStr;
+ myRadiusStr = vyStr;
+ myLengthStr = vzStr;
}
else if ( mySketchType == DIR_PER_LENGTH ) {
myRadius = vx;
myLength = vy;
+ myRadiusStr = vxStr;
+ myLengthStr = vyStr;
}
else if ( mySketchType == DIR_TAN_LENGTH ) {
myRadius = vx;
myLength = vy;
+ myRadiusStr = vxStr;
+ myLengthStr = vyStr;
}
else if ( mySketchType == DIR_DXDY_LENGTH ) {
myDX = vx;
myDY = vy;
myRadius = vz;
myLength = vs;
+ myDXStr = vxStr;
+ myDYStr = vyStr;
+ myRadiusStr = vzStr;
+ myLengthStr = vsStr;
}
}
// function : GetNewCommand()
// purpose : Build the new command with context
//=================================================================================
-QString EntityGUI_SketcherDlg::GetNewCommand()
+QString EntityGUI_SketcherDlg::GetNewCommand( QString& theParameters )
{
+ theParameters.clear();
QString myNewCommand = ":";
if ( mySketchState == FIRST_POINT ) {
- if ( mySketchType == PT_ABS || mySketchType == PT_SEL )
+ if ( mySketchType == PT_ABS || mySketchType == PT_SEL ) {
myNewCommand = myNewCommand + "F " + QString::number( myX ) + " " + QString::number( myY );
- if ( mySketchType == PT_RELATIVE)
+ theParameters = myXStr + ":" + myYStr;
+ }
+ if ( mySketchType == PT_RELATIVE) {
myNewCommand = myNewCommand + "F " + QString::number( myDX ) + " " + QString::number( myDY );
+ theParameters = myDXStr + ":" + myDYStr;
+ }
return myNewCommand;
}
if ( myConstructorId == 0 ) { // SEGMENT
- if ( mySketchType == PT_ABS || mySketchType == PT_SEL )
+ if ( mySketchType == PT_ABS || mySketchType == PT_SEL ) {
myNewCommand = myNewCommand + "TT " + QString::number( myX ) + " " + QString::number( myY );
- if ( mySketchType == PT_RELATIVE)
+ theParameters = myXStr + ":" + myYStr;
+ }
+ if ( mySketchType == PT_RELATIVE) {
myNewCommand = myNewCommand + "T " + QString::number( myDX ) + " " + QString::number( myDY );
+ theParameters = myDXStr + ":" + myDYStr;
+ }
if ( mySketchType == DIR_ANGLE_LENGTH ) {
myNewCommand = myNewCommand + "R " + QString::number( myAngle );
myNewCommand = myNewCommand + ":" + "L " + QString::number( myLength );
+ theParameters = myAngleStr + ":" + myLengthStr;
}
if ( mySketchType == DIR_ANGLE_X ) {
myNewCommand = myNewCommand + "R " + QString::number( myAngle );
myNewCommand = myNewCommand + ":" + "IX " + QString::number( myX );
+ theParameters = myAngleStr + ":" + myXStr;
}
if ( mySketchType == DIR_ANGLE_Y ) {
myNewCommand = myNewCommand + "R " + QString::number( myAngle );
myNewCommand = myNewCommand + ":" + "IY " + QString::number( myY );
+ theParameters = myAngleStr + ":" + myYStr;
}
if ( mySketchType == DIR_PER_LENGTH ) {
myNewCommand = myNewCommand + "R " + QString::number( 90.0 );
myNewCommand = myNewCommand + ":" + "L " + QString::number( myLength );
+ theParameters = QString::number( 90.0 ) + ":" + myLengthStr;
}
if ( mySketchType == DIR_PER_X ) {
myNewCommand = myNewCommand + "R " + QString::number( 90.0 );
myNewCommand = myNewCommand + ":" + "IX " + QString::number( myX );
+ theParameters = QString::number( 90.0 ) + ":" + myXStr;
}
if ( mySketchType == DIR_PER_Y ) {
myNewCommand = myNewCommand + "R " + QString::number( 90.0 );
myNewCommand = myNewCommand + ":" + "IY " + QString::number( myY );
+ theParameters = QString::number( 90.0 ) + ":" + myYStr;
}
- if ( mySketchType == DIR_TAN_LENGTH )
+ if ( mySketchType == DIR_TAN_LENGTH ) {
myNewCommand = myNewCommand + "L " + QString::number( myLength );
- if ( mySketchType == DIR_TAN_X )
+ theParameters = myLengthStr;
+ }
+ if ( mySketchType == DIR_TAN_X ) {
myNewCommand = myNewCommand + "IX " + QString::number( myX );
- if ( mySketchType == DIR_TAN_Y)
+ theParameters = myXStr;
+ }
+ if ( mySketchType == DIR_TAN_Y) {
myNewCommand = myNewCommand + "IY " + QString::number(myY);
+ theParameters = myYStr;
+ }
if ( mySketchType == DIR_DXDY_LENGTH ) {
myNewCommand = myNewCommand + "D " + QString::number( myDX ) + " " + QString::number( myDY );
myNewCommand = myNewCommand + ":" + "L " + QString::number( myLength );
+ theParameters = myDXStr + ":" + myDYStr + ":" + myLengthStr;
}
if ( mySketchType == DIR_DXDY_X ) {
myNewCommand = myNewCommand + "D " + QString::number( myDX ) + " " + QString::number( myDY );
myNewCommand = myNewCommand + ":" + "IX " + QString::number( myX );
+ theParameters = myDXStr + ":" + myDYStr + ":" + myXStr;
}
if ( mySketchType == DIR_DXDY_Y ) {
myNewCommand = myNewCommand + "D " + QString::number( myDX ) + " " + QString::number( myDY );
myNewCommand = myNewCommand + ":" + "IY " + QString::number( myY );
+ theParameters = myDXStr + ":" + myDYStr + ":" + myYStr;
}
}
else if ( myConstructorId == 1 ) { // ARC
if ( mySketchType == DIR_ANGLE_LENGTH ) {
myNewCommand = myNewCommand + "R " + QString::number( myAngle );
myNewCommand = myNewCommand + ":" + "C " + QString::number( myRadius ) + " " + QString::number( myLength );
+ theParameters = myAngleStr + ":" + myRadiusStr + ":" + myLengthStr;
}
if ( mySketchType == DIR_PER_LENGTH ) {
myNewCommand = myNewCommand + "R " + QString::number( 90.0 );
myNewCommand = myNewCommand + ":" + "C " + QString::number( myRadius ) + " " + QString::number( myLength );
+ theParameters = QString::number( 90.0 ) + ":" + myRadiusStr + ":" + myLengthStr;
}
if ( mySketchType == DIR_TAN_LENGTH ) {
myNewCommand = myNewCommand + "C " + QString::number( myRadius ) + " " + QString::number( myLength );
+ theParameters = myRadiusStr + ":" + myLengthStr;
}
if ( mySketchType == DIR_DXDY_LENGTH ) {
myNewCommand = myNewCommand + "D " + QString::number( myDX ) + " " + QString::number( myDY );
myNewCommand = myNewCommand + ":" + "C " + QString::number( myRadius ) + " " + QString::number( myLength );
+ theParameters = myDXStr + ":" + myDYStr + ":" + myRadiusStr + ":" + myLengthStr;
}
}
return myNewCommand;
//=================================================================================
bool EntityGUI_SketcherDlg::isValid( QString& msg )
{
- return true;
+ bool ok = true;
+ bool toCorrect = !IsPreview() || myIsApply;
+
+ if( Group1Spin->isVisible() ) {
+ ok = Group1Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok;
+ }
+ else if( Group2Spin->isVisible() ) {
+ ok = Group2Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok;
+ ok = Group2Spin->SpinBox_DY->isValid( msg, toCorrect ) && ok;
+ }
+ else if( Group3Spin->isVisible() ) {
+ ok = Group3Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok;
+ ok = Group3Spin->SpinBox_DY->isValid( msg, toCorrect ) && ok;
+ ok = Group3Spin->SpinBox_DZ->isValid( msg, toCorrect ) && ok;
+ }
+ else if( Group4Spin->isVisible() ) {
+ ok = Group4Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok;
+ ok = Group4Spin->SpinBox_DY->isValid( msg, toCorrect ) && ok;
+ ok = Group4Spin->SpinBox_DZ->isValid( msg, toCorrect ) && ok;
+ ok = Group4Spin->SpinBox_DS->isValid( msg, toCorrect ) && ok;
+ }
+
+ if( myIsApply && !ok )
+ showError( msg );
+
+ return ok;
}
//=================================================================================
//=================================================================================
bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
{
+ QString aParameters;
+
if ( mySketchState == FIRST_POINT ) {
myLastX2 = myX;
myLastY2 = myY;
myShape1 = aProfile1.GetShape();
//Current Shape
- QString Command2 = Command1 + GetNewCommand();
+ QString Command2 = Command1 + GetNewCommand( aParameters );
Sketcher_Profile aProfile2( Command2.toAscii() );
if ( aProfile2.IsDone() )
myShape2 = aProfile2.GetShape();
}
}
else {
- cmd = myCommand.join( "" ) + GetNewCommand();
+ cmd = myCommand.join( "" ) + GetNewCommand( aParameters );
if ( Group1Sel->isVisible() ) {
Group1Sel->buttonApply->setEnabled( true );
GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSketcher( cmd.toLatin1(), WPlane );
if ( !anObj->_is_nil() )
+ {
+ if( !IsPreview() ) {
+ QStringList aCurrentParameters = myParameters;
+ aCurrentParameters << aParameters;
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aCurrentParameters));
+ }
+
objects.push_back( anObj._retn() );
+ }
return true;
}
}
}
-void EntityGUI_SketcherDlg::initSpinBox( QDoubleSpinBox* spinBox,
+void EntityGUI_SketcherDlg::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
double min, double max,
double step, int decimals )
{
#include <QDialog>
class QLineEdit;
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class EntityGUI_1Sel;
class EntityGUI_1Spin;
class EntityGUI_2Spin;
bool eventFilter (QObject* object, QEvent* event);
protected:
- void initSpinBox( QDoubleSpinBox*,
+ void initSpinBox( SalomeApp_DoubleSpinBox*,
double, double, double = 0.1,
int = 3 );
void setEnabledUndo( bool );
void setEnabledRedo( bool );
- QString GetNewCommand();
+ QString GetNewCommand( QString& );
virtual void displayPreview( GEOM::GEOM_Object_ptr,
const bool = false,
int mySketchState;
bool myIsAllAdded;
+ bool myIsApply;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
QStringList myCommand;
QStringList myUndoCommand;
+ QStringList myParameters;
+ QStringList myUndoParameters;
+
Standard_Real myX, myY, myDX, myDY;
Standard_Real myLength, myAngle, myRadius;
Standard_Real myLastX1, myLastY1;
Standard_Real myLastX2, myLastY2;
+ QString myXStr, myYStr, myDXStr, myDYStr;
+ QString myLengthStr, myAngleStr, myRadiusStr;
+ QString myLastX1Str, myLastY1Str;
+ QString myLastX2Str, myLastY2Str;
+
EntityGUI_Skeleton* MainWidget;
EntityGUI_Point* GroupPt;
#include <set>
#include <map>
#include <string>
+#include <vector>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+#define COMMA ','
+#define O_BRACKET '('
+#define C_BRACKET ')'
+#define O_SQR_BRACKET '['
+#define C_SQR_BRACKET ']'
+#define PY_NULL "None"
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
static GEOM_Engine* TheEngine = NULL;
+using namespace std;
+
static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_Object)& theObject)
{
TCollection_AsciiString anID(theObject->GetDocID()), anEntry;
void ProcessFunction(Handle(GEOM_Function)& theFunction,
TCollection_AsciiString& theScript,
+ TVariablesList theVariables,
TDF_LabelMap& theProcessed,
std::set<std::string>& theDumpedObjs);
+void ReplaceVariables(TCollection_AsciiString& theCommand,
+ TVariablesList theVariables);
+
+
+
Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theString);
+
//=============================================================================
/*!
* GetEngine
//=============================================================================
TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+ TVariablesList theVariables,
bool isPublished,
bool& aValidScript)
{
MESSAGE ( "Null function !!!!" );
continue;
}
- ProcessFunction(aFunction, aScript, aFuncMap, anObjMap);
+ ProcessFunction(aFunction, aScript, theVariables, aFuncMap, anObjMap);
}
}
//===========================================================================
void ProcessFunction(Handle(GEOM_Function)& theFunction,
TCollection_AsciiString& theScript,
+ TVariablesList theVariables,
TDF_LabelMap& theProcessed,
std::set<std::string>& theDumpedObjs)
{
//Check if its internal function which doesn't requires dumping
if(aDescr == "None") return;
+ //Replace parameter by notebook variables
+ ReplaceVariables(aDescr,theVariables);
theScript += "\n\t";
theScript += aDescr;
return aSeq;
}
+
+//=============================================================================
+/*!
+ * ReplaceVariables: Replace parameters of the function by variales from
+ * Notebook if need
+ */
+//=============================================================================
+void ReplaceVariables(TCollection_AsciiString& theCommand,
+ TVariablesList theVariables)
+{
+ if (MYDEBUG)
+ cout<<"Command : "<<theCommand<<endl;
+
+ if (MYDEBUG) {
+ cout<<"All Entries:"<<endl;
+ TVariablesList::const_iterator it = theVariables.begin();
+ for(;it != theVariables.end();it++)
+ cout<<"\t'"<<(*it).first<<"'"<<endl;
+ }
+
+ //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;
+ if( aCommand.Search("=") != -1 ) // command returns an object
+ anEntry = aCommand.Token("=",1);
+ else { // command modifies the object
+ int aStartEntryPos = aCommand.Location(1,'(',1,aCommand.Length());
+ int aEndEntryPos = aCommand.Location(1,',',aStartEntryPos,aCommand.Length());
+ anEntry = aCommand.SubString(aStartEntryPos+1, aEndEntryPos-1);
+ }
+
+ //Remove white spaces
+ anEntry.RightAdjust();
+ anEntry.LeftAdjust();
+ if(MYDEBUG)
+ 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
+ ObjectStates* aStates = 0;
+ TVariablesList::const_iterator it = theVariables.find(anEntry);
+ if( it != theVariables.end() )
+ aStates = (*it).second;
+
+ if(!aStates) {
+ if(MYDEBUG)
+ cout<<"Valiables list empty!!!"<<endl;
+ aCommandIndex++;
+ continue;
+ }
+
+ TState aVariables = aStates->GetCurrectState();
+
+ 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 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 aVar, aReplacedVar;
+ for(Standard_Integer i=aFirstParam;i <= aTotalNbParams;i++) {
+ //Replace first parameter (bettwen '(' character and first ',' character)
+ if(i == aFirstParam)
+ {
+ aStartPos = aCommand.Location(O_BRACKET, 1, aCommand.Length()) + 1;
+ if(aTotalNbParams - aNbEntries > 0 )
+ aEndPos = aCommand.Location(aFirstParam, COMMA, 1, aCommand.Length());
+ else
+ aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length());
+ }
+ //Replace last parameter (bettwen ',' character and ')' character)
+ else if(i == aTotalNbParams)
+ {
+ 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 != aFirstParam && i != aTotalNbParams )
+ {
+ aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
+ aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length());
+ }
+
+ 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();
+
+ if(MYDEBUG)
+ cout<<"Variable: '"<< aVar <<"'"<<endl;
+
+ // specific case for sketcher
+ if(aVar.Location( TCollection_AsciiString("Sketcher:"), 1, aVar.Length() ) != 0) {
+ Standard_Integer aNbSections = 1;
+ while( aVar.Location( aNbSections, ':', 1, aVar.Length() ) )
+ aNbSections++;
+ aNbSections--;
+
+ int aStartSectionPos = 0, aEndSectionPos = 0;
+ TCollection_AsciiString aSection, aReplacedSection;
+ for(Standard_Integer aSectionIndex = 1; aSectionIndex <= aNbSections; aSectionIndex++) {
+ aStartSectionPos = aVar.Location( aSectionIndex, ':', 1, aVar.Length() ) + 1;
+ if( aSectionIndex != aNbSections )
+ aEndSectionPos = aVar.Location( aSectionIndex + 1, ':', 1, aVar.Length() );
+ else
+ aEndSectionPos = aVar.Length();
+
+ aSection = aVar.SubString(aStartSectionPos, aEndSectionPos-1);
+ if(MYDEBUG)
+ cout<<"aSection: "<<aSection<<endl;
+
+ Standard_Integer aNbParams = 1;
+ while( aSection.Location( aNbParams, ' ', 1, aSection.Length() ) )
+ aNbParams++;
+ aNbParams--;
+
+ int aStartParamPos = 0, aEndParamPos = 0;
+ TCollection_AsciiString aParameter, aReplacedParameter;
+ for(Standard_Integer aParamIndex = 1; aParamIndex <= aNbParams; aParamIndex++) {
+ aStartParamPos = aSection.Location( aParamIndex, ' ', 1, aSection.Length() ) + 1;
+ if( aParamIndex != aNbParams )
+ aEndParamPos = aSection.Location( aParamIndex + 1, ' ', 1, aSection.Length() );
+ else
+ aEndParamPos = aSection.Length() + 1;
+
+ aParameter = aSection.SubString(aStartParamPos, aEndParamPos-1);
+ if(MYDEBUG)
+ cout<<"aParameter: "<<aParameter<<endl;
+
+ if(iVar >= aVariables.size())
+ continue;
+
+ aReplacedParameter = aVariables[iVar].myVariable;
+ if(aReplacedParameter.IsEmpty()) {
+ iVar++;
+ continue;
+ }
+
+ if(aVariables[iVar].isVariable) {
+ aReplacedParameter.InsertBefore(1,"'");
+ aReplacedParameter.InsertAfter(aReplacedParameter.Length(),"'");
+ }
+
+ if(MYDEBUG)
+ cout<<"aSection before : "<<aSection<<endl;
+ aSection.Remove(aStartParamPos, aEndParamPos - aStartParamPos);
+ aSection.Insert(aStartParamPos, aReplacedParameter);
+ if(MYDEBUG)
+ cout<<"aSection after : "<<aSection<<endl<<endl;
+ iVar++;
+ }
+ if(MYDEBUG)
+ cout<<"aVar before : "<<aVar<<endl;
+ aVar.Remove(aStartSectionPos, aEndSectionPos - aStartSectionPos);
+ aVar.Insert(aStartSectionPos, aSection);
+ if(MYDEBUG)
+ cout<<"aVar after : "<<aVar<<endl<<endl;
+ }
+
+ if(MYDEBUG)
+ cout<<"aCommand before : "<<aCommand<<endl;
+ aCommand.Remove(aStartPos, aEndPos - aStartPos);
+ aCommand.Insert(aStartPos, aVar);
+ if(MYDEBUG)
+ cout<<"aCommand after : "<<aCommand<<endl;
+
+ break;
+ } // end of specific case for sketcher
+
+ //If parameter is entry or 'None', skip it
+ if(theVariables.find(aVar) != theVariables.end() || aVar.Search(":") != -1 || aVar == PY_NULL)
+ continue;
+
+ if(iVar >= aVariables.size())
+ continue;
+
+ aReplacedVar = aVariables[iVar].myVariable;
+ if(aReplacedVar.IsEmpty()) {
+ iVar++;
+ continue;
+ }
+
+ if(aVariables[iVar].isVariable) {
+ aReplacedVar.InsertBefore(1,"\"");
+ aReplacedVar.InsertAfter(aReplacedVar.Length(),"\"");
+ }
+
+ aCommand.Remove(aStartPos, aEndPos - aStartPos);
+ aCommand.Insert(aStartPos, aReplacedVar);
+ iVar++;
+ }
+
+ theCommand.Remove(aStartCommandPos, aEndCommandPos - aStartCommandPos);
+ theCommand.Insert(aStartCommandPos, aCommand);
+
+ aCommandIndex++;
+
+ aStates->IncrementState();
+ }
+
+ if (MYDEBUG)
+ cout<<"Command : "<<theCommand<<endl;
+}
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+ObjectStates::ObjectStates()
+{
+ _dumpstate = 0;
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+ObjectStates::~ObjectStates()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Return current object state
+ * \retval state - Object state (vector of notebook variable)
+ */
+//================================================================================
+TState ObjectStates::GetCurrectState() const
+{
+ if(_states.size() > _dumpstate)
+ return _states[_dumpstate];
+ return TState();
+}
+
+//================================================================================
+/*!
+ * \brief Add new object state
+ * \param theState - Object state (vector of notebook variable)
+ */
+//================================================================================
+void ObjectStates::AddState(const TState &theState)
+{
+ _states.push_back(theState);
+}
+
+//================================================================================
+/*!
+ * \brief Increment object state
+ */
+//================================================================================
+void ObjectStates::IncrementState()
+{
+ _dumpstate++;
+}
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <TDF_Label.hxx>
+#include <map>
+#include <vector>
+
+struct TVariable{
+ TCollection_AsciiString myVariable;
+ bool isVariable;
+
+ TVariable(const TCollection_AsciiString& theVariable, bool theFlag = true):
+ myVariable(theVariable),
+ isVariable(theFlag){}
+};
+
+typedef std::vector<TVariable> TState;
+typedef std::vector<TState> TAllStates;
+
+class ObjectStates
+{
+public:
+ ObjectStates();
+ ~ObjectStates();
+
+ TAllStates GetAllStates() const { return _states; }
+
+ TState GetCurrectState() const;
+ void AddState(const TState &theState);
+ void IncrementState();
+
+private:
+ TAllStates _states;
+ int _dumpstate;
+};
+
+typedef std::map<TCollection_AsciiString, ObjectStates* > TVariablesList;
+
class GEOM_Engine
{
public:
Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+ TVariablesList theVariables,
bool isPublished,
bool& aValidScript);
protected:
Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);
-
+
private:
Handle(GEOM_Application) _OCAFApp;
return aData;
}
+//=============================================================================
+/*!
+ * SetParameters
+ */
+//=============================================================================
+void GEOM_Object::SetParameters(const TCollection_AsciiString& theParameters)
+{
+ if( _parameters.IsEmpty() )
+ _parameters = theParameters;
+ else {
+ _parameters += "|";
+ _parameters += theParameters;
+ }
+}
+
+//=============================================================================
+/*!
+ * GetParameters
+ */
+//=============================================================================
+TCollection_AsciiString GEOM_Object::GetParameters() const
+{
+ return _parameters;
+}
+
//=============================================================================
/*!
//Returns an auxiliary data
Standard_EXPORT TCollection_AsciiString GetAuxData();
+ //Set a notebook variables used for object creation
+ Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters);
+
+ //Get a notebook variables used for object creation
+ Standard_EXPORT TCollection_AsciiString GetParameters() const;
+
//###########################################################
// Sub shape methods
//###########################################################
Handle(TDataStd_TreeNode) _root;
TDF_Label _label;
TCollection_AsciiString _ior;
+ TCollection_AsciiString _parameters;
};
#endif
#include <GeometryGUI.h>
#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_Study.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_Desktop.h>
myMainFrame->GroupBoxPublish->hide();
}
+//=================================================================================
+// function : initSpinBox()
+// purpose :
+//=================================================================================
void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox,
int min, int max, int step )
{
spinBox->setSingleStep( step );
}
-void GEOMBase_Skeleton::initSpinBox( QDoubleSpinBox* spinBox,
+//=================================================================================
+// function : initSpinBox()
+// purpose :
+//=================================================================================
+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 );
spinBox->setSingleStep( step );
}
+//=================================================================================
+// function : updateAttributes()
+// purpose : Workaround for Translation and Rotation operations with unchecked option "Create a copy".
+// In this case PublishInStudy isn't called, so we need to update object's attributes manually
+//=================================================================================
+void GEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj,
+ const QStringList& theParameters)
+{
+ SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS());
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry());
+ SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
+ SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr);
+
+ std::string aValue = aStringAttrib->Value();
+ if( aValue != "" )
+ aValue += "|";
+ for( int i = 0, n = theParameters.count(); i < n; i++ ) {
+ std::string aParameter = theParameters[i].toStdString();
+ if(aStudy->IsVariable(aParameter.c_str()))
+ aValue += aParameter;
+ if(i != n-1)
+ aValue += ":";
+ }
+ aStringAttrib->SetValue(aValue.c_str());
+}
+
//=================================================================================
// function : ClickOnCancel()
// purpose :
#include <QDialog>
+class SalomeApp_DoubleSpinBox;
class GeometryGUI;
class DlgRef_Skeleton;
class QSpinBox;
protected:
void initSpinBox( QSpinBox*, int, int, int = 1 );
- void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 3 );
+ void initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.1, int = 3 );
+ void updateAttributes( GEOM::GEOM_Object_ptr, const QStringList& );
+
void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* );
return aDSStudy._retn();
}
+//=======================================================================
+// function : JoinObjectParameters
+// purpose :
+//=======================================================================
+char* GeometryGUI::JoinObjectParameters(const QStringList& theParametersList)
+{
+ return theParametersList.join(":").toLatin1().data();
+}
//=======================================================================
// function : GeometryGUI::GeometryGUI()
// purpose : Constructor
static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject);
static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
+ static char* JoinObjectParameters(const QStringList& theParametersList);
+
GEOM_Client& GetShapeReader() { return myShapeReader; }
Standard_CString& GetFatherior() { return myFatherior; }
//void SetState( const int state ) { myState = state; }
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateDXDYDZ("
+ GEOM::TPythonDump(aFunction) << "geompy.TranslateDXDYDZ("
<< theObject << ", " << theX << ", " << theY << ", " << theZ << ")";
SetErrorCode(OK);
return aCopy;
}
- GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateVectorDistance("
+ GEOM::TPythonDump(aFunction) << "geompy.TranslateVectorDistance("
<< theObject << ", " << theVector << ", " << theDistance << ", " << theCopy << ")";
SetErrorCode(OK);
return theObject;
//Make a Python command
if (doCopy) {
- GEOM::TPythonDump(aFunction) << "geompy.MakeScaleAlongAxes("
+ GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeScaleAlongAxes("
<< theObject << ", " << thePoint << ", "
<< theFactorX << ", " << theFactorY << ", " << theFactorZ << ")";
return aCopy;
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.Rotate(" << theObject
+ GEOM::TPythonDump(aFunction) << "geompy.Rotate(" << theObject
<< ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
SetErrorCode(OK);
#include <Standard_Stream.hxx>
#include "GEOM_Gen_i.hh"
+
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
+#include <vector>
+#include <string>
+
//=======================================================================
//function : DumpPython
//purpose :
Resource_DataMapOfAsciiStringAsciiString aMap;
+ TVariablesList aVariableMap;
+
SALOMEDS::ChildIterator_var Itr = aStudy->NewChildIterator(aSO);
for(Itr->InitEx(true); Itr->More(); Itr->Next()) {
SALOMEDS::SObject_var aValue = Itr->Value();
CORBA::String_var aName = aValue->GetName();
CORBA::String_var anEntry = GO->GetEntry();
aMap.Bind( (char*)anEntry.in(), (char*)aName.in() );
+
+ //Find attribute with list of used notebook variables
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeString_var anAttrStr;
+ if(aValue->FindAttribute(anAttr,"AttributeString")){
+ anAttrStr = SALOMEDS::AttributeString::_narrow(anAttr);
+ SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(anAttrStr->Value());
+ ObjectStates* aStates = new ObjectStates();
+ for(int i = 0; i < aSections->length(); i++) {
+ TState aState;
+ SALOMEDS::ListOfStrings aListOfVars = aSections[i];
+ for(int j = 0; j < aListOfVars.length(); j++) {
+ bool isVar = aStudy->IsVariable(aListOfVars[j].in());
+ TVariable aVar = TVariable( (char*)aListOfVars[j].in(), isVar );
+ aState.push_back(aVar);
+ }
+ aStates->AddState(aState);
+ }
+ aVariableMap.insert(pair<TCollection_AsciiString,ObjectStates*>(TCollection_AsciiString(anEntry),aStates));
+ }
}
}
}
-
+
TCollection_AsciiString aScript =
"### This file is generated by SALOME automatically by dump python functionality\n"
"### of GEOM component\n\n";
- aScript += _impl->DumpPython(aStudy->StudyId(), aMap, isPublished, isValidScript);
+ aScript += _impl->DumpPython(aStudy->StudyId(), aMap, aVariableMap, isPublished, isValidScript);
if (isPublished)
{
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
aNameAttrib->SetValue(aShapeName.ToCString());
-
+
+ //Set NoteBook variables used in the object creation
+ TCollection_AsciiString aVars;
+ SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aShape->GetParameters());
+ for(int i = 0, n = aSections->length(); i < n; i++) {
+ SALOMEDS::ListOfStrings aListOfVars = aSections[i];
+ for(int j = 0, m = aListOfVars.length(); j < m; j++) {
+ if(theStudy->IsVariable(aListOfVars[j].in()))
+ aVars += TCollection_AsciiString(aListOfVars[j].in());
+ if(j != m-1)
+ aVars += ":";
+ }
+ if(i != n-1)
+ aVars += "|";
+ }
+ 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);
{
return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER;
}
+
+void GEOM_Object_i::SetParameters(const char* theParameters)
+{
+ _impl->SetParameters((char*)theParameters);
+}
+
+char* GEOM_Object_i::GetParameters()
+{
+ return CORBA::string_dup(_impl->GetParameters().ToCString());
+}
+
virtual bool IsShape();
+ virtual void SetParameters(const char* theParameters);
+
+ virtual char* GetParameters();
+
Handle(GEOM_Object) GetImpl() { return _impl; }
private:
salome.salome_init()
from salome import *
+from salome_notebook import *
+
import GEOM
import math
def RaiseIfFailed (Method_name, Operation):
if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
+
+## Return list of variables value from salome notebook
+## @ingroup l1_geompy_auxiliary
+def ParseParameters(*parameters):
+ Result = []
+ StringResult = ""
+ for parameter in parameters:
+ if isinstance(parameter,str):
+ if notebook.isVariable(parameter):
+ Result.append(notebook.get(parameter))
+ else:
+ raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
+ else:
+ Result.append(parameter)
+ pass
+
+ StringResult = StringResult + str(parameter)
+ StringResult = StringResult + ":"
+ pass
+ StringResult = StringResult[:len(StringResult)-1]
+ 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
+
+## Return list of variables value from salome notebook
+## @ingroup l1_geompy_auxiliary
+def ParseSketcherCommand(command):
+ Result = ""
+ StringResult = ""
+ sections = command.split(":")
+ for section in sections:
+ parameters = section.split(" ")
+ paramIndex = 1
+ for parameter in parameters:
+ if paramIndex > 1 and parameter.find("'") != -1:
+ parameter = parameter.replace("'","")
+ if notebook.isVariable(parameter):
+ Result = Result + str(notebook.get(parameter)) + " "
+ pass
+ else:
+ raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
+ pass
+ pass
+ else:
+ Result = Result + str(parameter) + " "
+ pass
+ if paramIndex > 1:
+ StringResult = StringResult + parameter
+ StringResult = StringResult + ":"
+ pass
+ paramIndex = paramIndex + 1
+ pass
+ Result = Result[:len(Result)-1] + ":"
+ pass
+ Result = Result[:len(Result)-1]
+ return Result, StringResult
## Kinds of shape enumeration
# @ingroup l1_geompy_auxiliary
# @ref tui_creation_point "Example"
def MakeVertex(self,theX, theY, theZ):
# Example: see GEOM_TestAll.py
+ theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
RaiseIfFailed("MakePointXYZ", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a point, distant from the referenced point
# @ref tui_creation_point "Example"
def MakeVertexWithRef(self,theReference, theX, theY, theZ):
# Example: see GEOM_TestAll.py
+ theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
RaiseIfFailed("MakePointWithReference", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a point, corresponding to the given parameter on the given curve.
# @ref tui_creation_point "Example"
def MakeVertexOnCurve(self,theRefCurve, theParameter):
# Example: see GEOM_TestAll.py
+ theParameter, Parameters = ParseParameters(theParameter)
anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
RaiseIfFailed("MakePointOnCurve", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a point, corresponding to the given parameters on the
#
# @ref swig_MakeVertexOnSurface "Example"
def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
+ theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
RaiseIfFailed("MakePointOnSurface", self.BasicOp)
+ anObj.SetParameters(Parameters);
return anObj
## Create a point on intersection of two lines.
# @ref tui_creation_vector "Example"
def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
# Example: see GEOM_TestAll.py
+ theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a vector between two points.
# @ref tui_creation_plane "Example"
def MakePlane(self,thePnt, theVec, theTrimSize):
# Example: see GEOM_TestAll.py
+ theTrimSize, Parameters = ParseParameters(theTrimSize);
anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
RaiseIfFailed("MakePlanePntVec", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a plane, passing through the three given points
# @ref tui_creation_plane "Example"
def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
# Example: see GEOM_TestAll.py
+ theTrimSize, Parameters = ParseParameters(theTrimSize);
anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a plane, similar to the existing one, but with another size of representing face.
# @ref tui_creation_plane "Example"
def MakePlaneFace(self,theFace, theTrimSize):
# Example: see GEOM_TestAll.py
+ theTrimSize, Parameters = ParseParameters(theTrimSize);
anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
RaiseIfFailed("MakePlaneFace", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a local coordinate system.
# @ref swig_MakeMarker "Example"
def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
# Example: see GEOM_TestAll.py
+ OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
RaiseIfFailed("MakeMarker", self.BasicOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a local coordinate system.
# @ref tui_creation_circle "Example"
def MakeCircle(self, thePnt, theVec, theR):
# Example: see GEOM_TestAll.py
+ theR, Parameters = ParseParameters(theR)
anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a circle with given radius.
# @ref tui_creation_ellipse "Example"
def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor):
# Example: see GEOM_TestAll.py
+ theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
RaiseIfFailed("MakeEllipse", self.CurvesOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create an ellipse with given radiuses.
# @ref tui_sketcher_page "Example"
def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
# Example: see GEOM_TestAll.py
+ theCommand,Parameters = ParseSketcherCommand(theCommand)
anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
RaiseIfFailed("MakeSketcher", self.CurvesOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a sketcher (wire or face), following the textual description,
# @ref tui_creation_box "Example"
def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
# Example: see GEOM_TestAll.py
+ theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a box with two specified opposite vertices,
# @ref tui_creation_face "Example"
def MakeFaceHW(self,theH, theW, theOrientation):
# Example: see GEOM_TestAll.py
+ theH,theW,Parameters = ParseParameters(theH, theW)
anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
RaiseIfFailed("MakeFaceHW", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a face from another plane and two sizes,
# @ref tui_creation_face "Example"
def MakeFaceObjHW(self, theObj, theH, theW):
# Example: see GEOM_TestAll.py
+ theH,theW,Parameters = ParseParameters(theH, theW)
anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a disk with given center, normal vector and radius.
# @ref tui_creation_disk "Example"
def MakeDiskPntVecR(self,thePnt, theVec, theR):
# Example: see GEOM_TestAll.py
+ theR,Parameters = ParseParameters(theR)
anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a disk, passing through three given points
# @ref tui_creation_face "Example"
def MakeDiskR(self,theR, theOrientation):
# Example: see GEOM_TestAll.py
+ theR,Parameters = ParseParameters(theR)
anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
RaiseIfFailed("MakeDiskR", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a cylinder with given base point, axis, radius and height.
# @ref tui_creation_cylinder "Example"
def MakeCylinder(self,thePnt, theAxis, theR, theH):
# Example: see GEOM_TestAll.py
+ theR,theH,Parameters = ParseParameters(theR, theH)
anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a cylinder with given radius and height at
# @ref tui_creation_cylinder "Example"
def MakeCylinderRH(self,theR, theH):
# Example: see GEOM_TestAll.py
+ theR,theH,Parameters = ParseParameters(theR, theH)
anObj = self.PrimOp.MakeCylinderRH(theR, theH)
RaiseIfFailed("MakeCylinderRH", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a sphere with given center and radius.
# @ref tui_creation_sphere "Example"
def MakeSpherePntR(self, thePnt, theR):
# Example: see GEOM_TestAll.py
+ theR,Parameters = ParseParameters(theR)
anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
RaiseIfFailed("MakeSpherePntR", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a sphere with given center and radius.
# @ref tui_creation_sphere "Example"
def MakeSphereR(self, theR):
# Example: see GEOM_TestAll.py
+ theR,Parameters = ParseParameters(theR)
anObj = self.PrimOp.MakeSphereR(theR)
RaiseIfFailed("MakeSphereR", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a cone with given base point, axis, height and radiuses.
# @ref tui_creation_cone "Example"
def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
# Example: see GEOM_TestAll.py
+ theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a cone with given height and radiuses at
# @ref tui_creation_cone "Example"
def MakeConeR1R2H(self,theR1, theR2, theH):
# Example: see GEOM_TestAll.py
+ theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a torus with given center, normal vector and radiuses.
# @ref tui_creation_torus "Example"
def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
# Example: see GEOM_TestAll.py
+ theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
## Create a torus with given radiuses at the origin of coordinate system.
# @ref tui_creation_torus "Example"
def MakeTorusRR(self, theRMajor, theRMinor):
# Example: see GEOM_TestAll.py
+ theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
RaiseIfFailed("MakeTorusRR", self.PrimOp)
+ anObj.SetParameters(Parameters)
return anObj
# end of l3_3d_primitives
# @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,
# @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
# @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
# @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
# @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.
# @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.
# @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).
# @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).
# @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.
# @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.
RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
return anObj
+ ## Translate the given object along the vector, specified by its components.
+ # @param theObject The object to be translated.
+ # @param theDX,theDY,theDZ Components of translation vector.
+ # @return Translated GEOM_Object.
+ #
+ # @ref tui_translation "Example"
+ def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
+ # Example: see GEOM_TestAll.py
+ theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
+ anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
+ anObj.SetParameters(Parameters)
+ RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
+ return anObj
+
## Translate the given object along the vector, specified
# by its components, creating its copy before the translation.
# @param theObject The object to be translated.
# @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
RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
return anObj
+ ## Translate the given object along the given vector on given distance.
+ # @param theObject The object to be translated.
+ # @param theVector The translation vector.
+ # @param theDistance The translation distance.
+ # @param theCopy Flag used to translate object itself or create a copy.
+ # @return Translated GEOM_Object.
+ #
+ # @ref tui_translation "Example"
+ def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
+ # Example: see GEOM_TestAll.py
+ theDistance,Parameters = ParseParameters(theDistance)
+ anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
+ RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
+ anObj.SetParameters(Parameters)
+ return anObj
+
## Translate the given object along the given vector on given distance,
# creating its copy before the translation.
# @param theObject The object to be translated.
# @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 on the given angle.
+ # @param theObject The object to be rotated.
+ # @param theAxis Rotation axis.
+ # @param theAngle Rotation angle in radians.
+ # @return Rotated GEOM_Object.
+ #
+ # @ref tui_rotation "Example"
+ def Rotate(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.Rotate(theObject, theAxis, theAngle)
+ RaiseIfFailed("RotateCopy", 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
# \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
# @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)
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)
else:
anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
+ anObj.SetParameters(Parameters)
return anObj
## Perform a fillet on the specified edges/faces of the given shape
# \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,
# @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,
# @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,
#
# @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()
# @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
# \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.
# @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.
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.
// 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;
}
//=================================================================================
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakeFilling(
myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter, myIsApprox );
-
if ( !anObj->_is_nil() )
+ {
+ if ( !IsPreview() )
+ {
+ 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;
}
// 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 myOkBase;
+ return myOkBase && ok;
return false;
}
//=================================================================================
bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
{
+ QStringList aParameters;
GEOM::GEOM_Object_var anObj;
switch (getConstructorId()) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakePrismVecH2Ways(myBase, myVec, getHeight());
}
+
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ aParameters << GroupPoints->SpinBox_DX->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
+
break;
case 1:
if (!myBothway2) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakePrismDXDYDZ2Ways(myBase, dx, dy, dz);
}
+
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ aParameters << GroupPoints3->SpinBox_DX->text();
+ aParameters << GroupPoints3->SpinBox_DY->text();
+ aParameters << GroupPoints3->SpinBox_DZ->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
+
break;
}
// 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;
}
//=================================================================================
}
if (!anObj->_is_nil())
+ {
+ if (!IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
objects.push_back(anObj._retn());
+ }
return true;
}
// 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;
}
//=================================================================================
getOperation() )->MakeArchimede( myShape, aWeight, aWaterDensity, aMeshDeflection );
if ( !anObj->_is_nil() )
+ {
+ if ( !IsPreview() )
+ {
+ 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;
}
int row = aLayout->rowCount();
aLayout->addWidget(new QLabel(tr("D"), myGrp1), row, 0);
- aLayout->addWidget((mySpinBox[ SpinBox1 ] = new QtxDoubleSpinBox(myGrp1)), row++, 2);
+ aLayout->addWidget((mySpinBox[ SpinBox1 ] = new SalomeApp_DoubleSpinBox(myGrp1)), row++, 2);
aLayout->setRowStretch(row, 10);
// Create second group
// Set range of spinboxes
double SpecificStep = 10.0;
- QMap< int, QtxDoubleSpinBox* >::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);
void OperationGUI_ChamferDlg::Init()
{
// Set Initial values of spinboxes
- QMap< int, QtxDoubleSpinBox* >::iterator anIter;
+ QMap< int, SalomeApp_DoubleSpinBox* >::iterator anIter;
for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter)
anIter.value()->setValue(5);
this, SLOT(LineEditReturnPressed()));
// spin boxes
- QMap< int, QtxDoubleSpinBox* >::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)));
//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;
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;
myRadioButton[ theRbId ] = new QRadioButton(theParent);
QLabel* lab1 = new QLabel(theLbl1, theParent);
QLabel* lab2 = new QLabel(theLbl2, theParent);
- mySpinBox[ theSpin1Id ] = new QtxDoubleSpinBox(theParent);
- mySpinBox[ theSpin2Id ] = new QtxDoubleSpinBox(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);
// 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;
}
}
//=================================================================================
bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
{
+ QStringList aParameters;
GEOM::GEOM_Object_var anObj;
bool flag = (myRadioButton[ RadioButton21 ]->isChecked() &&
myRadioButton[ RadioButton31 ]->isChecked() &&
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) {
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())->
mySpinBox[ SpinBox24 ]->value() * PI180,
myFace[ Face1 ],
myFace[ Face2 ]);
+ if (!anObj->_is_nil())
+ {
+ aParameters << mySpinBox[ SpinBox23 ]->text();
+ aParameters << mySpinBox[ SpinBox24 ]->text();
+ }
}
}
else if (anId == 2)
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;
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())->
mySpinBox[ SpinBox43 ]->value(),
mySpinBox[ SpinBox44 ]->value() * PI180,
anArray);
+ if (!anObj->_is_nil())
+ {
+ aParameters << mySpinBox[ SpinBox43 ]->text();
+ aParameters << mySpinBox[ SpinBox44 ]->text();
+ }
}
}
if (!anObj->_is_nil())
+ {
+ if (!IsPreview())
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back(anObj._retn());
+ }
return true;
}
#include <QMap>
+class SalomeApp_DoubleSpinBox;
class QGroupBox;
class QPushButton;
class QLineEdit;
-class QtxDoubleSpinBox;
class QGridLayout;
class QRadioButton;
QMap< int, QPushButton* > mySelBtn;
QMap< int, QLineEdit* > mySelName;
- QMap< int, QtxDoubleSpinBox* > mySpinBox;
+ QMap< int, SalomeApp_DoubleSpinBox* > mySpinBox;
QMap< int, QRadioButton* > myRadioButton;
};
TextLabelNear = new QLabel( tr( "Near" ), GroupArguments );
GroupArgumentsLayout->addWidget( TextLabelNear, 0, 0 );
- SpinBox_Near = new QtxDoubleSpinBox( COORD_MIN, COORD_MAX, 10.0, 3, 10, GroupArguments );
+ SpinBox_Near = new SalomeApp_DoubleSpinBox( COORD_MIN, COORD_MAX, 10.0, 3, 10, GroupArguments );
GroupArgumentsLayout->addWidget( SpinBox_Near, 0, 1 );
TextLabelFar = new QLabel( tr( "Far" ), GroupArguments );
GroupArgumentsLayout->addWidget( TextLabelFar, 0, 2 );
- SpinBox_Far = new QtxDoubleSpinBox( COORD_MIN, COORD_MAX, 10.0, 3, 10, GroupArguments );
+ SpinBox_Far = new SalomeApp_DoubleSpinBox( COORD_MIN, COORD_MAX, 10.0, 3, 10, GroupArguments );
GroupArgumentsLayout->addWidget( SpinBox_Far, 0, 3 );
resetButton = new QPushButton( tr( "Reset" ), GroupArguments );
class QLabel;
class QPushButton;
class QComboBox;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
enum ViewerTypes { VTK, OCC, OTHER };
QGroupBox* GroupArguments;
QLabel* TextLabelNear;
- QtxDoubleSpinBox* SpinBox_Near;
+ SalomeApp_DoubleSpinBox* SpinBox_Near;
QLabel* TextLabelFar;
- QtxDoubleSpinBox* SpinBox_Far;
+ SalomeApp_DoubleSpinBox* SpinBox_Far;
QPushButton* resetButton;
QComboBox* TypeCB;
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;
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;
// 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;
}
}
//=================================================================================
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());
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;
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())
+ {
+ if (!IsPreview())
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back(anObj._retn());
+ }
return true;
}
// function : isValid
// purpose :
//=================================================================================
-bool PrimitiveGUI_BoxDlg::isValid (QString&)
+bool PrimitiveGUI_BoxDlg::isValid (QString& msg)
{
- return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : true;
+ bool ok = true;
+ if( getConstructorId() == 1 )
+ {
+ 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;
}
//=================================================================================
double z = GroupDimensions->SpinBox_DZ->value();
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z);
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ 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;
// function : isValid
// purpose :
//=================================================================================
-bool PrimitiveGUI_ConeDlg::isValid (QString&)
+bool PrimitiveGUI_ConeDlg::isValid (QString& msg)
{
if (!getRadius1() && !getRadius2())
return false;
- return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) : true;
+
+ bool ok = true;
+ if( getConstructorId() == 0 )
+ {
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+ }
+ else if( getConstructorId() == 1 )
+ {
+ 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( getHeight() ) > Precision::Confusion() && ok;
+ return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok;
}
//=================================================================================
if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeConePntVecR1R2H(myPoint, myDir, getRadius1(), getRadius2(), getHeight());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ 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());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ 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;
}
// function : isValid
// purpose :
//=================================================================================
-bool PrimitiveGUI_CylinderDlg::isValid (QString&)
+bool PrimitiveGUI_CylinderDlg::isValid (QString& msg)
{
- return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) : true;
+ bool ok = true;
+ if( getConstructorId() == 0 )
+ {
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ }
+ else if( getConstructorId() == 1 )
+ {
+ 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;
}
//=================================================================================
if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ 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());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
}
// function : isValid
// purpose :
//=================================================================================
-bool PrimitiveGUI_DiskDlg::isValid (QString&)
+bool PrimitiveGUI_DiskDlg::isValid (QString& msg)
{
+ bool ok = true;
+ if( getConstructorId() == 0 )
+ ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ else if( getConstructorId() == 1 )
+ ok = GroupPntVecR->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+
const int id = getConstructorId();
if (id == 0)
- return true;
+ return ok;
else if (id == 1)
- return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0;
+ return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0 && ok;
else if (id == 2)
return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
!isEqual(myPoint1, myPoint2) && !isEqual(myPoint1, myPoint3) && !isEqual(myPoint2, myPoint3);
bool PrimitiveGUI_DiskDlg::execute (ObjectList& objects)
{
bool res = false;
+ QStringList aParameters;
GEOM::GEOM_Object_var anObj;
case 0:
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeDiskR(getRadius(), myOrientationType);
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ 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());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ aParameters << GroupPntVecR->SpinBox_DX->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
case 2:
//=================================================================================
bool PrimitiveGUI_FaceDlg::isValid( QString& msg )
{
+ bool ok = true;
+ if( getConstructorId() == 0 )
+ {
+ ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ }
+ else if( getConstructorId() == 1 )
+ {
+ ok = GroupPlane->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPlane->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ }
+
const int id = getConstructorId();
if ( id == 0 )
- return true;
+ return ok;
else if ( id == 1 ) {
if (GroupType->RadioButton1->isChecked())
- return !myEdge->_is_nil();
+ return !myEdge->_is_nil() && ok;
else if (GroupType->RadioButton2->isChecked())
- return !myFace->_is_nil();
+ return !myFace->_is_nil() && ok;
}
return false;
}
bool PrimitiveGUI_FaceDlg::execute (ObjectList& objects)
{
bool res = false;
+ QStringList aParameters;
GEOM::GEOM_Object_var anObj;
switch (getConstructorId()) {
case 0:
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeFaceHW(GroupDimensions->SpinBox_DX->value(),
GroupDimensions->SpinBox_DY->value(), myOrientationType);
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
case 1:
else if (GroupType->RadioButton2->isChecked())
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeFaceObjHW(myFace, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ aParameters << GroupPlane->SpinBox_DX->text();
+ aParameters << GroupPlane->SpinBox_DY->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
}
//=================================================================================
bool PrimitiveGUI_SphereDlg::isValid( QString& msg )
{
- return getConstructorId() == 0 ? !myPoint->_is_nil() : true;
+ bool ok = true;
+ if( getConstructorId() == 0 )
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ else if( getConstructorId() == 1 )
+ ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ return getConstructorId() == 0 ? !myPoint->_is_nil() && ok : ok;
}
//=================================================================================
{
if ( !CORBA::is_nil( myPoint ) ) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSpherePntR( myPoint, getRadius() );
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
}
break;
case 1 :
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSphereR( getRadius() );
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
}
// function : isValid
// purpose :
//=================================================================================
-bool PrimitiveGUI_TorusDlg::isValid (QString&)
+bool PrimitiveGUI_TorusDlg::isValid (QString& msg)
{
- return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) : true;
+ bool ok = true;
+ if( getConstructorId() == 0 )
+ {
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ }
+ else if( getConstructorId() == 1 )
+ {
+ ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ }
+ return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok;
}
//=================================================================================
if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ 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());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
res = true;
break;
}
myIsParameterGr->addButton( rb2, 1 );
rb1->setChecked( true );
- myValEdt = new QtxDoubleSpinBox( 0., 1., 0.1, 3, 32, GroupPoints->Box );
+ myValEdt = new SalomeApp_DoubleSpinBox( 0., 1., 0.1, 3, 32, GroupPoints->Box );
myValEdt->setValue( 0.5 );
QLabel* aLbl1 = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->Box );
// function : isValid
// purpose :
//=================================================================================
-bool RepairGUI_DivideEdgeDlg::isValid( QString& )
+bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
{
- return !myObject->_is_nil();
+ bool ok = myValEdt->isValid( msg, !IsPreview() );
+ return !myObject->_is_nil() && ok;
}
//=================================================================================
( myObject, -1, myValEdt->value(), getIsByParameter() );
bool aResult = !anObj->_is_nil();
if ( aResult )
+ {
+ if ( !IsPreview() )
+ {
+ QStringList aParameters;
+ aParameters << "";
+ aParameters << myValEdt->text();
+ aParameters << "";
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
objects.push_back( anObj._retn() );
+ }
return aResult;
}
#include <GEOMBase_Skeleton.h>
class DlgRef_1SelExt;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QButtonGroup;
//=================================================================================
DlgRef_1SelExt* GroupPoints;
QButtonGroup* myIsParameterGr;
- QtxDoubleSpinBox* myValEdt;
+ SalomeApp_DoubleSpinBox* myValEdt;
protected slots:
void ClickOnOk();
GroupPoints->LineEdit1->setReadOnly( true );
QLabel* aTolLab = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box );
- myTolEdt = new QtxDoubleSpinBox( 0.0, 100.0, DEFAULT_TOLERANCE_VALUE, 7, 7, GroupPoints->Box );
+ myTolEdt = new SalomeApp_DoubleSpinBox( 0.0, 100.0, DEFAULT_TOLERANCE_VALUE, 7, 7, GroupPoints->Box );
myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
QGridLayout* boxLayout = new QGridLayout( GroupPoints->Box );
GroupPoints2->LineEdit1->setReadOnly( true );
QLabel* aTolLab2 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints2->Box );
- myTolEdt2 = new QtxDoubleSpinBox( GroupPoints2->Box );
+ myTolEdt2 = new SalomeApp_DoubleSpinBox( GroupPoints2->Box );
initSpinBox( myTolEdt2, 0, 100, 1e-7, 7 );
myTolEdt2->setValue( DEFAULT_TOLERANCE_VALUE );
// 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;
}
//=================================================================================
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
( getOperation() )->MakeGlueFaces( myObject, myTolEdt->value(), true );
aResult = !anObj->_is_nil();
- if ( aResult )
+ if ( aResult && !IsPreview() )
+ {
+ QStringList aParameters;
+ aParameters << myTolEdt->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
objects.push_back( anObj._retn() );
+ }
break;
}
case 1:
aResult = !anObj->_is_nil();
if ( aResult )
+ {
+ if ( !IsPreview() )
+ {
+ QStringList aParameters;
+ aParameters << myTolEdt2->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
objects.push_back( anObj._retn() );
+ }
// Remove from engine useless objects
clearTemporary();
#include <GEOMBase_Skeleton.h>
class DlgRef_1SelExt;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QPushButton;
class QCheckBox;
DlgRef_1SelExt* GroupPoints;
DlgRef_1SelExt* GroupPoints2;
- QtxDoubleSpinBox* myTolEdt;
- QtxDoubleSpinBox* myTolEdt2;
+ SalomeApp_DoubleSpinBox* myTolEdt;
+ SalomeApp_DoubleSpinBox* myTolEdt2;
QPushButton* myDetectBtn;
QCheckBox* mySubShapesChk;
QGridLayout* aLay = new QGridLayout( GroupPoints->Box );
aLay->setMargin( 0 ); aLay->setSpacing( 6 );
- myTolEdt = new QtxDoubleSpinBox( 0.0, 100.0, DEFAULT_TOLERANCE_VALUE, 7, 10, GroupPoints->Box );
+ myTolEdt = new SalomeApp_DoubleSpinBox( 0.0, 100.0, DEFAULT_TOLERANCE_VALUE, 7, 10, GroupPoints->Box );
myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box );
myFreeBoundBtn = new QPushButton( tr( "GEOM_DETECT" ) + QString( " [%1]" ).arg( tr( "GEOM_FREE_BOUNDARIES" ) ),
// function : isValid
// purpose :
//=================================================================================
-bool RepairGUI_SewingDlg::isValid( QString& )
+bool RepairGUI_SewingDlg::isValid( QString& msg )
{
myClosed = -1;
- return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. );
+ bool ok = myTolEdt->isValid( msg, !IsPreview() );
+ return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && ok;
}
//=================================================================================
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->Sew( myObject, myTolEdt->value() );
aResult = !anObj->_is_nil();
if ( aResult )
+ {
+ if ( !IsPreview() )
+ {
+ QStringList aParameters;
+ aParameters << myTolEdt->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
objects.push_back( anObj._retn() );
+ }
}
return aResult;
#include <GEOMBase_Skeleton.h>
class DlgRef_1SelExt;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QPushButton;
//=================================================================================
GEOM::GEOM_Object_var myObject;
DlgRef_1SelExt* GroupPoints;
- QtxDoubleSpinBox* myTolEdt;
+ SalomeApp_DoubleSpinBox* myTolEdt;
QPushButton* myFreeBoundBtn;
int myClosed; // Number of free closed boundaries detected. Calculated in execute(), used in onDetect().
#include <QtxDoubleSpinBox.h>
#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
QGridLayout* aLay = new QGridLayout( w );
aLay->setMargin( 9 ); aLay->setSpacing( 6 );
- myFixShapeTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
- myFixShapeMaxTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myFixShapeTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myFixShapeMaxTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
aLay->addWidget( myFixShapeTol3D, 0, 1 );
QGridLayout* aLay = new QGridLayout( w );
aLay->setMargin( 9 ); aLay->setSpacing( 6 );
- myFixFaceSizeTol = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myFixFaceSizeTol = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
aLay->addWidget( new QLabel( tr( "GEOM_TOLERANCE" ), w ), 0, 0 );
aLay->addWidget( myFixFaceSizeTol, 0, 1 );
QGridLayout* aLay = new QGridLayout( w );
aLay->setMargin( 9 ); aLay->setSpacing( 6 );
- myDropSmallEdgesTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myDropSmallEdgesTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
aLay->addWidget( myDropSmallEdgesTol3D, 0, 1 );
QGridLayout* aLay = new QGridLayout( w );
aLay->setMargin( 9 ); aLay->setSpacing( 6 );
- mySplitAngleAngle = new QtxDoubleSpinBox( 0, 360, 1, 10, 10, w );
- mySplitAngleMaxTol = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ mySplitAngleAngle = new SalomeApp_DoubleSpinBox( 0, 360, 1, 10, 10, w );
+ mySplitAngleMaxTol = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
aLay->addWidget( new QLabel( tr( "GEOM_ANGLE_1" ), w ), 0, 0 );
aLay->addWidget( mySplitAngleAngle, 0, 1 );
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 );
QGridLayout* aLay = new QGridLayout( w );
aLay->setMargin( 9 ); aLay->setSpacing( 6 );
- mySplitContTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ mySplitContTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
mySplitContSurfCont = new QComboBox( w );
mySplitContSurfCont->addItems( aContinueties );
mySplitContCurvCont = new QComboBox( w );
myBSpline3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
- myBSplineTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myBSplineTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
- myBSplineTol2D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myBSplineTol2D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
- 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 );
myToBezier3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
myToBezier2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
- myToBezierMaxTol = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ myToBezierMaxTol = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
aLay->addWidget( myToBezierSurfModeChk, 0, 0 );
aLay->addWidget( myToBezier3DCurveChk, 1, 0 );
QGridLayout* aLay = new QGridLayout( w );
aLay->setMargin( 9 ); aLay->setSpacing( 6 );
- mySameParameterTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+ mySameParameterTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
aLay->addWidget( mySameParameterTol3D, 0, 1 );
void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& theValue )
{
if ( theControl && !theValue.isNull() ) {
- if ( qobject_cast<QtxDoubleSpinBox*>( theControl ) )
- qobject_cast<QtxDoubleSpinBox*>( 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 ) )
QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
{
if ( theControl ) {
- if ( qobject_cast<QtxDoubleSpinBox*>( theControl ) )
- return QString::number( qobject_cast<QtxDoubleSpinBox*>( 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 ) )
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 :
//=================================================================================
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() ) {
msg += tr( "ERROR_NO_OPERATORS" );
error = true;
}
- return !error;
+ return !error && ok;
}
//=================================================================================
if ( anObj->_is_nil() )
anErrorObjNames << GEOMBase::GetName( obj );
else
+ {
+ if ( !IsPreview() )
+ {
+ 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() )
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
#include <QMap>
class DlgRef_1Sel;
-class QSpinBox;
-class QtxDoubleSpinBox;
+class SalomeApp_IntSpinBox;
+class SalomeApp_DoubleSpinBox;
class QComboBox;
class QCheckBox;
class QListWidget;
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
DlgRef_1Sel* mySelectWdgt;
QListWidget* myOpList;
- QtxDoubleSpinBox* myFixShapeTol3D;
- QtxDoubleSpinBox* myFixShapeMaxTol3D;
+ SalomeApp_DoubleSpinBox* myFixShapeTol3D;
+ SalomeApp_DoubleSpinBox* myFixShapeMaxTol3D;
- QtxDoubleSpinBox* myFixFaceSizeTol;
+ SalomeApp_DoubleSpinBox* myFixFaceSizeTol;
- QtxDoubleSpinBox* myDropSmallEdgesTol3D;
+ SalomeApp_DoubleSpinBox* myDropSmallEdgesTol3D;
- QtxDoubleSpinBox* mySplitAngleAngle;
- QtxDoubleSpinBox* mySplitAngleMaxTol;
+ SalomeApp_DoubleSpinBox* mySplitAngleAngle;
+ SalomeApp_DoubleSpinBox* mySplitAngleMaxTol;
- QSpinBox* mySplitClosedFacesNum;
+ SalomeApp_IntSpinBox* mySplitClosedFacesNum;
- QtxDoubleSpinBox* mySplitContTol3D;
+ SalomeApp_DoubleSpinBox* mySplitContTol3D;
QComboBox* mySplitContSurfCont;
QComboBox* mySplitContCurvCont;
QCheckBox* myBSplineSurfModeChk;
QCheckBox* myBSpline3DCurveChk;
QCheckBox* myBSpline2DCurveChk;
- QtxDoubleSpinBox* myBSplineTol3D;
- QtxDoubleSpinBox* 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;
- QtxDoubleSpinBox* myToBezierMaxTol;
+ SalomeApp_DoubleSpinBox* myToBezierMaxTol;
- QtxDoubleSpinBox* mySameParameterTol3D;
+ SalomeApp_DoubleSpinBox* mySameParameterTol3D;
private slots:
void onOk();
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;
}
void SetEditCurrentArgument();
void ReverseAngle();
void ValueChangedInSpinBox( double );
+ void TextValueChangedInSpinBox( const QString& );
void ConstructorsClicked( int );
void SetDoubleSpinBoxStep( double );
};
connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged(const QString& )),
+ this, SLOT(TextValueChangedInSpinBox(const QString& )));
+ connect(GroupDimensions->SpinBox_DX1, SIGNAL(textChanged(const QString& )),
+ this, SLOT(TextValueChangedInSpinBox(const QString& )));
+ connect(GroupDimensions->SpinBox_DX2, SIGNAL(textChanged(const QString& )),
+ this, SLOT(TextValueChangedInSpinBox(const QString& )));
+
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
ActivateThisDialog();
}
+//=================================================================================
+// function : TextValueChangedInSpinBox
+// purpose :
+//=================================================================================
+void TransformationGUI_MultiTranslationDlg::TextValueChangedInSpinBox( const QString& s)
+{
+ QObject* send = (QObject*)sender();
+ bool isDigit = true;
+
+ switch (getConstructorId()) {
+ case 0:
+ GroupPoints->SpinBox_DX->text().toDouble(&isDigit);
+ if(!isDigit){
+ GroupPoints->CheckButton1->setChecked(false);
+ }
+ GroupPoints->CheckButton1->setEnabled(isDigit);
+ break;
+ case 1:
+ if (send == GroupDimensions->SpinBox_DX1) {
+ GroupDimensions->SpinBox_DX1->text().toDouble(&isDigit);
+ if(!isDigit)
+ GroupDimensions->CheckButton1->setChecked(false);
+ GroupDimensions->CheckButton1->setEnabled(isDigit);
+ }
+ else if(send == GroupDimensions->SpinBox_DX2){
+ GroupDimensions->SpinBox_DX2->text().toDouble(&isDigit);
+ if(!isDigit)
+ GroupDimensions->CheckButton2->setChecked(false);
+ GroupDimensions->CheckButton2->setEnabled(isDigit);
+ }
+ break;
+ }
+}
+
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox (double newValue)
{
QObject* send = (QObject*)sender();
-
switch (getConstructorId()) {
case 0:
if (send == GroupPoints->SpinBox_DX)
// function : isValid
// purpose :
//=================================================================================
-bool TransformationGUI_MultiTranslationDlg::isValid (QString& /*msg*/)
+bool TransformationGUI_MultiTranslationDlg::isValid (QString& msg)
{
int aConstructorId = getConstructorId();
-
- if (aConstructorId == 0)
- return !(myBase->_is_nil() || myVectorU->_is_nil());
- else if (aConstructorId == 1)
- return !(myBase->_is_nil() || myVectorU->_is_nil() || myVectorV->_is_nil());
+
+ if (aConstructorId == 0) {
+ bool ok = true;
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ return !(myBase->_is_nil() || myVectorU->_is_nil()) && ok;
+ }
+ else if (aConstructorId == 1) {
+ bool ok = true;
+ 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;
+ return !(myBase->_is_nil() || myVectorU->_is_nil() || myVectorV->_is_nil()) && ok;
+ }
return 0;
}
GEOM::GEOM_Object_var anObj;
+ QStringList aParameters;
+
switch (getConstructorId()) {
case 0:
if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU)) {
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
MultiTranslate1D(myBase, myVectorU, myStepU, myNbTimesU);
+ if(!IsPreview()) {
+ aParameters<<GroupPoints->SpinBox_DX->text();
+ aParameters<<GroupPoints->SpinBox_DY->text();
+ }
res = true;
}
break;
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
MultiTranslate2D(myBase, myVectorU, myStepU, myNbTimesU,
myVectorV, myStepV, myNbTimesV);
+ 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;
}
void ReverseStepU();
void ReverseStepV();
void ValueChangedInSpinBox( double );
+ void TextValueChangedInSpinBox( const QString& );
void ConstructorsClicked( int );
void SetDoubleSpinBoxStep( double );
};
return false;
}
}
- return true;
+ return GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() );
}
//=================================================================================
for ( int i = 0; i < myObjects.length(); i++ ) {
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() );
- if ( !anObj->_is_nil() )
+ if ( !anObj->_is_nil() ) {
+ if(!IsPreview()) {
+ anObj->SetParameters(GroupPoints->SpinBox_DX->text().toLatin1().constData());
+ }
objects.push_back( anObj._retn() );
+ }
}
}
else {
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged( const QString& )),
+ this, SLOT(TextValueChangedInSpinBox( const QString&)));
+
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
ActivateThisDialog();
}
+void TransformationGUI_RotationDlg::TextValueChangedInSpinBox( const QString& s)
+{
+ bool isDigit = true;
+ s.toDouble(&isDigit);
+ if(!isDigit) {
+ GroupPoints->CheckButton2->setChecked(false);
+ }
+ GroupPoints->CheckButton2->setEnabled(isDigit);
+}
+
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
// function : isValid
// purpose :
//=================================================================================
-bool TransformationGUI_RotationDlg::isValid (QString& /*msg*/)
+bool TransformationGUI_RotationDlg::isValid (QString& msg)
{
- if (myObjects.length() < 1) return false;
-
switch (getConstructorId()) {
- case 0:
- return !(myAxis->_is_nil());
+ case 0: {
+ bool ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() );
+ return myObjects.length() > 0 && !(myAxis->_is_nil()) && ok;
break;
+ }
case 1:
- return !(myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil());
+ return myObjects.length() > 0 && !(myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil());
break;
default:
break;
switch (getConstructorId()) {
case 0:
{
+ QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox_DX->text();
if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
RotateCopy(myObjects[i], myAxis, GetAngle() * PI180);
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil()) {
+ if(!IsPreview()) {
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
objects.push_back(anObj._retn());
+ }
}
}
else {
myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
Rotate(myObjects[i], myAxis, GetAngle() * PI180);
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil()) {
+ if(!IsPreview()) {
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ updateAttributes(anObj, aParameters);
+ }
objects.push_back(anObj._retn());
+ }
}
}
res = true;
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox();
+ void TextValueChangedInSpinBox( const QString& );
void CreateCopyModeChanged( bool );
void ConstructorsClicked( int );
void onReverse();
#include <GeometryGUI.h>
#include <GEOMBase.h>
-#include <QtxDoubleSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
LineEdit2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
TextLabel3 = new QLabel(tr("GEOM_SCALE_FACTOR"), GroupBox1);
- SpinBox_FX = new QtxDoubleSpinBox(GroupBox1);
+ SpinBox_FX = new SalomeApp_DoubleSpinBox(GroupBox1);
TextLabel4 = new QLabel(tr("GEOM_SCALE_FACTOR_Y"), GroupBox1);
- SpinBox_FY = new QtxDoubleSpinBox(GroupBox1);
+ SpinBox_FY = new SalomeApp_DoubleSpinBox(GroupBox1);
TextLabel5 = new QLabel(tr("GEOM_SCALE_FACTOR_Z"), GroupBox1);
- SpinBox_FZ = new QtxDoubleSpinBox(GroupBox1);
+ SpinBox_FZ = new SalomeApp_DoubleSpinBox(GroupBox1);
CheckBoxCopy = new QCheckBox(tr("GEOM_CREATE_COPY"), GroupBox1);
CheckBoxCopy->setChecked(true);
// function : isValid
// purpose :
//=================================================================================
-bool TransformationGUI_ScaleDlg::isValid (QString& /*msg*/)
+bool TransformationGUI_ScaleDlg::isValid (QString& msg)
{
- if (myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001)
- {
- // && !myPoint->_is_nil()
- if (getConstructorId() == 0)
- return true;
- if (fabs(SpinBox_FY->value()) > 0.00001 &&
- fabs(SpinBox_FZ->value()) > 0.00001)
- return true;
+ // && !myPoint->_is_nil()
+ if (getConstructorId() == 0) {
+ bool ok = SpinBox_FX->isValid( msg, !IsPreview() );
+ return myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001 && ok;
}
- return false;
+
+ bool ok = true;
+ ok = SpinBox_FX->isValid( msg, !IsPreview() ) && ok;
+ ok = SpinBox_FY->isValid( msg, !IsPreview() ) && ok;
+ ok = SpinBox_FZ->isValid( msg, !IsPreview() ) && ok;
+ return myObjects.length() > 0 &&
+ fabs(SpinBox_FX->value()) > 0.00001 &&
+ fabs(SpinBox_FY->value()) > 0.00001 &&
+ fabs(SpinBox_FZ->value()) > 0.00001 && ok;
}
//=================================================================================
{
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
ScaleShapeCopy(myObjects[i], myPoint, SpinBox_FX->value());
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil()) {
+ if(!IsPreview())
+ anObj->SetParameters(SpinBox_FX->text().toLatin1().constData());
objects.push_back(anObj._retn());
+ }
}
}
else
ScaleShapeAlongAxesCopy(myObjects[i], myPoint, SpinBox_FX->value(),
SpinBox_FY->value(), SpinBox_FZ->value());
if (!anObj->_is_nil())
+ if(!IsPreview()) {
+ QStringList aParameters;
+ aParameters<<SpinBox_FX->text();
+ aParameters<<SpinBox_FY->text();
+ aParameters<<SpinBox_FZ->text();
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ }
objects.push_back(anObj._retn());
}
}
class QLabel;
class QLineEdit;
class QPushButton;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
//=================================================================================
// class : TransformationGUI_ScaleDlg
QLabel* TextLabel3;
QLabel* TextLabel4;
QLabel* TextLabel5;
- QtxDoubleSpinBox* SpinBox_FX;
- QtxDoubleSpinBox* SpinBox_FY;
- QtxDoubleSpinBox* SpinBox_FZ;
+ SalomeApp_DoubleSpinBox* SpinBox_FX;
+ SalomeApp_DoubleSpinBox* SpinBox_FY;
+ SalomeApp_DoubleSpinBox* SpinBox_FZ;
QCheckBox* CheckBoxCopy;
private slots:
// function : isValid
// purpose :
//=================================================================================
-bool TransformationGUI_TranslationDlg::isValid (QString& /*msg*/)
+bool TransformationGUI_TranslationDlg::isValid (QString& msg)
{
int aConstructorId = getConstructorId();
- if (myObjects.length() < 1) return false;
-
switch (aConstructorId) {
- case 0:
- return true;
+ case 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;
+ return myObjects.length() > 0 && ok;
+ }
case 1:
- return !(myPoint1->_is_nil() || myPoint2->_is_nil());
+ return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil());
case 2:
- return !(myVector->_is_nil());
+ {
+ bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
+ return myObjects.length() > 0 && !(myVector->_is_nil()) && ok;
+ }
default:
break;
}
double dy = GroupPoints->SpinBox2->value();
double dz = GroupPoints->SpinBox3->value();
+ QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox1->text();
+ aParameters<<GroupPoints->SpinBox2->text();
+ aParameters<<GroupPoints->SpinBox3->text();
+
if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil()) {
+ if(!IsPreview())
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back(anObj._retn());
+ }
}
}
else {
myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
TranslateDXDYDZ(myObjects[i], dx, dy, dz);
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil()) {
+ if(!IsPreview()) {
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ updateAttributes(anObj, aParameters);
+ }
objects.push_back(anObj._retn());
+ }
}
}
res = true;
}
case 2:
{
+ QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox3->text();
bool byDistance = GroupPoints->CheckBox1->isChecked();
if (byDistance) {
double aDistance = GroupPoints->SpinBox3->value();
myCurrObject = myObjects[i];
anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())->
TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil()) {
+ if(!IsPreview()) {
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ updateAttributes(anObj, aParameters);
+ }
objects.push_back(anObj._retn());
+ }
}
}
else {