diff --git a/doc/salome/gui/GEOM/images/box3.png b/doc/salome/gui/GEOM/images/box3.png
new file mode 100755
index 000000000..b64fdf983
Binary files /dev/null and b/doc/salome/gui/GEOM/images/box3.png differ
diff --git a/doc/salome/gui/GEOM/input/creating_box.doc b/doc/salome/gui/GEOM/input/creating_box.doc
index 0991b6029..817088463 100644
--- a/doc/salome/gui/GEOM/input/creating_box.doc
+++ b/doc/salome/gui/GEOM/input/creating_box.doc
@@ -30,6 +30,10 @@ accessible only via \b TUI commands.
this way you don't need to create them in advance).
\n TUI Command: geompy.MakeBox(x1,y1,z1,x2,y2,z2)
\n Arguments: 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
Example:
diff --git a/doc/salome/gui/GEOM/input/index.doc b/doc/salome/gui/GEOM/input/index.doc
index 6ae767547..c5121cabb 100644
--- a/doc/salome/gui/GEOM/input/index.doc
+++ b/doc/salome/gui/GEOM/input/index.doc
@@ -14,6 +14,7 @@ using a wide range of functions;
various algorithms;
\subpage repairing_operations_page "optimization of geometrical objects";
\subpage using_measurement_tools_page "provision of information about geometrical objects".
+\subpage using_notebook_geom_page.
Almost all geometry module functionalities are accessible via
diff --git a/doc/salome/gui/GEOM/input/using_notebook_geom_page.doc b/doc/salome/gui/GEOM/input/using_notebook_geom_page.doc
new file mode 100644
index 000000000..d793d55a5
--- /dev/null
+++ b/doc/salome/gui/GEOM/input/using_notebook_geom_page.doc
@@ -0,0 +1,18 @@
+/*!
+
+\page using_notebook_geom_page Using SALOME NoteBook
+
+It is possible to use variables defined through SALOME NoteBook for
+creation and modification of objects in the Geometry module with the following
+limitations:
+
+
+- \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.
+
- \ref color_page "Select color" dialog box.
+
- \ref isolines_page "Select Number of Isos" dialog box.
+
+*/
+
diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl
index 25e732748..7a64111e2 100644
--- a/idl/GEOM_Gen.idl
+++ b/idl/GEOM_Gen.idl
@@ -233,6 +233,18 @@ module GEOM
* 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();
};
diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx
index a5bc2a3f8..9cb015a9c 100644
--- a/src/BasicGUI/BasicGUI_CircleDlg.cxx
+++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx
@@ -617,11 +617,13 @@ static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje
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 );
@@ -643,9 +645,15 @@ bool BasicGUI_CircleDlg::execute( ObjectList& objects )
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;
diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx
index a7485a675..9b9eb6c07 100644
--- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx
+++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx
@@ -410,7 +410,10 @@ bool BasicGUI_EllipseDlg::isValid( QString& msg )
//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;
}
//=================================================================================
@@ -421,11 +424,17 @@ bool BasicGUI_EllipseDlg::execute( ObjectList& objects )
{
double aMajorR = GroupPoints->SpinBox_DX->value();
double aMinorR = GroupPoints->SpinBox_DY->value();
+
+ QStringList aParameters;
+ aParameters<SpinBox_DX->text();
+ aParameters<SpinBox_DY->text();
+
GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse( myPoint, myDir, aMajorR, aMinorR );
-
- if ( !anObj->_is_nil() )
+ if ( !anObj->_is_nil() ) {
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( anObj._retn() );
-
+ }
return true;
}
diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx
index 6ccb05689..9e9d46b64 100644
--- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx
+++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx
@@ -99,13 +99,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
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 );
@@ -114,13 +114,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
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 );
@@ -129,13 +129,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
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 );
@@ -698,8 +698,12 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg )
}
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:
@@ -720,9 +724,22 @@ bool BasicGUI_MarkerDlg::execute( ObjectList& objects )
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<text();
+ aParameters<text();
+ aParameters<text();
+ aParameters<text();
+ aParameters<text();
+ aParameters<text();
+ aParameters<text();
+ aParameters<text();
+ aParameters<text();
+
+ if ( !anObj->_is_nil() ) {
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( anObj._retn() );
+ }
return true;
}
diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.h b/src/BasicGUI/BasicGUI_MarkerDlg.h
index d9d1c9320..364b0d737 100644
--- a/src/BasicGUI/BasicGUI_MarkerDlg.h
+++ b/src/BasicGUI/BasicGUI_MarkerDlg.h
@@ -32,7 +32,7 @@
class DlgRef_1Sel;
class DlgRef_3Sel;
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QFrame;
class BasicGUI_MarkerDlg : public GEOMBase_Skeleton
@@ -41,7 +41,7 @@ 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* );
diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx
index 6387a6558..6e9aaa1f5 100644
--- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx
+++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx
@@ -600,6 +600,20 @@ double BasicGUI_PlaneDlg::getSize() const
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 :
@@ -629,13 +643,20 @@ bool BasicGUI_PlaneDlg::isValid( QString& msg )
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;
}
@@ -663,10 +684,12 @@ bool BasicGUI_PlaneDlg::execute( ObjectList& objects )
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;
}
//=================================================================================
diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.h b/src/BasicGUI/BasicGUI_PlaneDlg.h
index 58bc24bd2..5d83df4e3 100644
--- a/src/BasicGUI/BasicGUI_PlaneDlg.h
+++ b/src/BasicGUI/BasicGUI_PlaneDlg.h
@@ -56,6 +56,7 @@ private:
void Init();
void enterEvent( QEvent* );
double getSize() const;
+ QString getSizeAsString() const;
private:
GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3, myFace;
diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx
index 41cb5a756..b2475da60 100644
--- a/src/BasicGUI/BasicGUI_PointDlg.cxx
+++ b/src/BasicGUI/BasicGUI_PointDlg.cxx
@@ -689,19 +689,37 @@ GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
// 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;
}
@@ -714,6 +732,7 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
bool res = false;
GEOM::GEOM_Object_var anObj;
+ QStringList aParameters;
switch ( getConstructorId() ) {
case 0 :
@@ -721,6 +740,10 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
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;
@@ -731,6 +754,10 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
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 );
@@ -740,6 +767,7 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
case 2 :
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointOnCurve( myEdge, getParameter() );
+ aParameters<SpinBox_DX->text();
res = true;
break;
case 3 :
@@ -750,10 +778,20 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
case 4 :
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointOnSurface( myFace, getUParameter(), getVParameter() );
+ aParameters<SpinBox_DX->text();
+ aParameters<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;
diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx
index 132b7822d..d441ce891 100644
--- a/src/BasicGUI/BasicGUI_VectorDlg.cxx
+++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx
@@ -453,7 +453,17 @@ GEOM::GEOM_IOperations_ptr BasicGUI_VectorDlg::createOperation()
//=================================================================================
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;
}
//=================================================================================
@@ -478,7 +488,16 @@ bool BasicGUI_VectorDlg::execute( ObjectList& objects )
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;
}
diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx
index 960bd9288..8dcbdbbeb 100644
--- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx
+++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx
@@ -366,8 +366,12 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation()
// function : isValid()
// purpose : Verify validity of input data
//=================================================================================
-bool BlocksGUI_ExplodeDlg::isValid (QString&)
+bool BlocksGUI_ExplodeDlg::isValid (QString& msg)
{
+ bool okSP = true;
+ okSP = myGrp1->SpinBox1->isValid( msg, !IsPreview() ) && okSP;
+ okSP = myGrp1->SpinBox2->isValid( msg, !IsPreview() ) && okSP;
+
bool ok = false;
switch ( getConstructorId() ) {
case 0:
@@ -386,7 +390,7 @@ bool BlocksGUI_ExplodeDlg::isValid (QString&)
break;
}
- return ok;
+ return ok && okSP;
}
//=================================================================================
@@ -421,6 +425,10 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
return objects.size() > 0;
}
+ QStringList aParameters;
+ aParameters << myGrp1->SpinBox1->text();
+ aParameters << myGrp1->SpinBox2->text();
+
// Throw away sub-shapes not selected by user if not in preview mode
// and manual selection is active
if ( !isAllSubShapes() ) {
@@ -442,7 +450,11 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
if ( selected.contains( QString( objStr.in() ) ) )
+ {
+ if ( !IsPreview() )
+ (*anIter)->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( *anIter );
+ }
else
toRemoveFromEngine.push_back( *anIter );
}
@@ -457,7 +469,12 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
}
else {
for ( int i = 0, n = aList->length(); i < n; i++ )
- objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
+ {
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aList[i] );
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ objects.push_back( anObj._retn() );
+ }
}
return objects.size();
diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
index 2796b5233..fc7a5f720 100644
--- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
+++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
@@ -112,7 +112,7 @@ void BlocksGUI_TrsfDlg::Init()
{
// Set range of spinboxes
double SpecificStep = 1.0;
- QMap::iterator anIter;
+ QMap::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);
@@ -128,9 +128,9 @@ void BlocksGUI_TrsfDlg::Init()
for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn)
connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- QMap::iterator anIterSpin;
+ QMap::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"));
@@ -410,7 +410,7 @@ void BlocksGUI_TrsfDlg::enterEvent (QEvent*)
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
-void BlocksGUI_TrsfDlg::ValueChangedInSpinBox(double)
+void BlocksGUI_TrsfDlg::ValueChangedInSpinBox(int)
{
displayPreview();
}
@@ -453,7 +453,7 @@ void BlocksGUI_TrsfDlg::createSpinWg (const QString& theLbl,
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);
@@ -550,20 +550,23 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation()
// function : isValid
// purpose : Verify validity of input data
//=================================================================================
-bool BlocksGUI_TrsfDlg::isValid (QString&)
+bool BlocksGUI_TrsfDlg::isValid (QString& msg)
{
- bool ok = false;
+ bool ok = false, okSP = true;
switch (getConstructorId()) {
case 0:
ok = !myShape->_is_nil() && myFaces[Face1] > 0;
+ okSP = mySpinBox[SpinBox1]->isValid( msg, !IsPreview() );
break;
case 1:
ok = !myShape->_is_nil() && myFaces[Face1U] > 0 && myFaces[Face1V] > 0;
+ okSP = mySpinBox[SpinBox2U]->isValid( msg, !IsPreview() ) && okSP;
+ okSP = mySpinBox[SpinBox2V]->isValid( msg, !IsPreview() ) && okSP;
break;
default:
break;
}
- return ok;
+ return ok && okSP;
}
//=================================================================================
@@ -581,16 +584,32 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
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:
diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.h b/src/BlocksGUI/BlocksGUI_TrsfDlg.h
index 8d4e68f4b..a0f823f14 100644
--- a/src/BlocksGUI/BlocksGUI_TrsfDlg.h
+++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.h
@@ -30,7 +30,7 @@
#include
-class QtxDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class QGroupBox;
class QPushButton;
class QLineEdit;
@@ -79,7 +79,7 @@ private:
QMap mySelBtn;
QMap mySelName;
- QMap mySpinBox;
+ QMap mySpinBox;
private slots:
void ClickOnOk();
@@ -90,7 +90,7 @@ private slots:
void SelectionIntoArgument();
void SetEditCurrentArgument();
- void ValueChangedInSpinBox (double);
+ void ValueChangedInSpinBox (int);
};
#endif // BLOCKSGUI_TRSFDLG_H
diff --git a/src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.ui b/src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.ui
index 9001ffd15..ab8c89f83 100644
--- a/src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.ui
@@ -79,7 +79,7 @@
-
-
+
-
@@ -122,9 +122,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_1Sel1Spin_QTD.ui b/src/DlgRef/DlgRef_1Sel1Spin_QTD.ui
index 4df5a4e6d..06d9d7c13 100644
--- a/src/DlgRef/DlgRef_1Sel1Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel1Spin_QTD.ui
@@ -104,7 +104,7 @@
-
-
+
@@ -115,9 +115,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_1Sel2Spin1View1Check_QTD.ui b/src/DlgRef/DlgRef_1Sel2Spin1View1Check_QTD.ui
index 522369808..675626f54 100644
--- a/src/DlgRef/DlgRef_1Sel2Spin1View1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel2Spin1View1Check_QTD.ui
@@ -35,10 +35,10 @@
-
-
+
-
-
+
-
@@ -126,6 +126,13 @@
qPixmapFromMimeSource
+
+
+ SalomeApp_IntSpinBox
+ QSpinBox
+
+
+
PushButton1
LineEdit1
diff --git a/src/DlgRef/DlgRef_1Sel2Spin_QTD.ui b/src/DlgRef/DlgRef_1Sel2Spin_QTD.ui
index 25d1a9baf..432160bea 100644
--- a/src/DlgRef/DlgRef_1Sel2Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel2Spin_QTD.ui
@@ -56,10 +56,10 @@
6
-
-
+
-
-
+
-
@@ -134,9 +134,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui b/src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui
index f8501134c..37a9f4a66 100644
--- a/src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui
@@ -56,13 +56,13 @@
6
-
-
+
-
-
+
-
-
+
-
@@ -160,9 +160,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_1Sel3Spin_QTD.ui b/src/DlgRef/DlgRef_1Sel3Spin_QTD.ui
index 9cabaf01d..6ec567c6e 100644
--- a/src/DlgRef/DlgRef_1Sel3Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel3Spin_QTD.ui
@@ -56,13 +56,13 @@
6
-
-
+
-
-
+
-
-
+
-
@@ -153,9 +153,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_1Sel5Spin1Check_QTD.ui b/src/DlgRef/DlgRef_1Sel5Spin1Check_QTD.ui
index 1a248292f..3c50b200c 100644
--- a/src/DlgRef/DlgRef_1Sel5Spin1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_1Sel5Spin1Check_QTD.ui
@@ -82,7 +82,7 @@
-
-
+
-
@@ -101,7 +101,7 @@
-
-
+
-
@@ -120,7 +120,7 @@
-
-
+
-
@@ -139,7 +139,7 @@
-
-
+
-
@@ -158,7 +158,7 @@
-
-
+
-
@@ -176,9 +176,9 @@
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_1Spin_QTD.ui b/src/DlgRef/DlgRef_1Spin_QTD.ui
index 1246d58e5..1ede440a5 100644
--- a/src/DlgRef/DlgRef_1Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_1Spin_QTD.ui
@@ -72,7 +72,7 @@
-
-
+
@@ -83,9 +83,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel1Spin2Check_QTD.ui b/src/DlgRef/DlgRef_2Sel1Spin2Check_QTD.ui
index 7998e3abd..5bb1b8e38 100644
--- a/src/DlgRef/DlgRef_2Sel1Spin2Check_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel1Spin2Check_QTD.ui
@@ -56,7 +56,7 @@
6
-
-
+
0
@@ -174,9 +174,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel1Spin_QTD.ui b/src/DlgRef/DlgRef_2Sel1Spin_QTD.ui
index b932c276e..76fc2d494 100644
--- a/src/DlgRef/DlgRef_2Sel1Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel1Spin_QTD.ui
@@ -56,7 +56,7 @@
6
-
-
+
-
@@ -153,9 +153,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui b/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui
index 40f733590..07800a567 100644
--- a/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui
@@ -63,10 +63,10 @@
-
-
+
-
-
+
-
@@ -173,9 +173,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel2Spin_QTD.ui b/src/DlgRef/DlgRef_2Sel2Spin_QTD.ui
index 5a9f36adb..f9df9178f 100644
--- a/src/DlgRef/DlgRef_2Sel2Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel2Spin_QTD.ui
@@ -56,10 +56,10 @@
6
-
-
+
-
-
+
-
@@ -166,9 +166,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel3Spin2Rb_QTD.ui b/src/DlgRef/DlgRef_2Sel3Spin2Rb_QTD.ui
index 69722216e..050f8baae 100644
--- a/src/DlgRef/DlgRef_2Sel3Spin2Rb_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel3Spin2Rb_QTD.ui
@@ -128,7 +128,7 @@
-
-
+
-
@@ -154,7 +154,7 @@
-
-
+
false
@@ -177,7 +177,7 @@
-
-
+
false
@@ -190,9 +190,9 @@
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel3Spin_QTD.ui b/src/DlgRef/DlgRef_2Sel3Spin_QTD.ui
index 7de27946e..b3f27fb8e 100644
--- a/src/DlgRef/DlgRef_2Sel3Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel3Spin_QTD.ui
@@ -168,13 +168,13 @@
-
-
+
-
-
+
-
-
+
@@ -185,9 +185,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui b/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui
index a25d1159e..27e0b7e56 100644
--- a/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui
@@ -63,16 +63,16 @@
-
-
+
-
-
+
-
-
+
-
-
+
-
@@ -211,9 +211,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_2Spin_QTD.ui b/src/DlgRef/DlgRef_2Spin_QTD.ui
index 87d7c040e..466bf527d 100644
--- a/src/DlgRef/DlgRef_2Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_2Spin_QTD.ui
@@ -72,7 +72,7 @@
-
-
+
-
@@ -91,7 +91,7 @@
-
-
+
@@ -102,9 +102,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui b/src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui
index a1c14757d..74e1d6bcc 100644
--- a/src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui
@@ -111,7 +111,7 @@
-
-
+
-
@@ -135,9 +135,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_3Sel1Spin_QTD.ui b/src/DlgRef/DlgRef_3Sel1Spin_QTD.ui
index b533a05c0..d1f2f04f4 100644
--- a/src/DlgRef/DlgRef_3Sel1Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_3Sel1Spin_QTD.ui
@@ -180,7 +180,7 @@
-
-
+
@@ -191,10 +191,10 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
-
+ SalomeApp_DoubleSpinBox.h
+
PushButton1
diff --git a/src/DlgRef/DlgRef_3Sel3Spin2Check_QTD.ui b/src/DlgRef/DlgRef_3Sel3Spin2Check_QTD.ui
index e2c68c662..10ee30bc3 100644
--- a/src/DlgRef/DlgRef_3Sel3Spin2Check_QTD.ui
+++ b/src/DlgRef/DlgRef_3Sel3Spin2Check_QTD.ui
@@ -144,7 +144,7 @@
-
-
+
-
@@ -163,7 +163,7 @@
-
-
+
-
@@ -182,7 +182,7 @@
-
-
+
-
@@ -207,9 +207,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui b/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui
index 9329141a8..41fcdd0d0 100644
--- a/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui
+++ b/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui
@@ -56,16 +56,16 @@
6
-
-
+
-
-
+
-
-
+
-
-
+
-
@@ -250,9 +250,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_3Spin1Check_QTD.ui b/src/DlgRef/DlgRef_3Spin1Check_QTD.ui
index 6a4c001b2..7408ae941 100644
--- a/src/DlgRef/DlgRef_3Spin1Check_QTD.ui
+++ b/src/DlgRef/DlgRef_3Spin1Check_QTD.ui
@@ -111,13 +111,13 @@
-
-
+
-
-
+
-
-
+
@@ -128,9 +128,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_3Spin_QTD.ui b/src/DlgRef/DlgRef_3Spin_QTD.ui
index 10959ed5d..4ac7e5d12 100644
--- a/src/DlgRef/DlgRef_3Spin_QTD.ui
+++ b/src/DlgRef/DlgRef_3Spin_QTD.ui
@@ -56,13 +56,13 @@
6
-
-
+
-
-
+
-
-
+
-
@@ -121,9 +121,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.ui b/src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.ui
index 131736af7..83501ec05 100644
--- a/src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.ui
+++ b/src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.ui
@@ -32,7 +32,7 @@
6
-
-
+
0
@@ -230,9 +230,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/DlgRef/DlgRef_4Sel1Spin3Check_QTD.ui b/src/DlgRef/DlgRef_4Sel1Spin3Check_QTD.ui
index 4e6e09c64..7dc96d006 100755
--- a/src/DlgRef/DlgRef_4Sel1Spin3Check_QTD.ui
+++ b/src/DlgRef/DlgRef_4Sel1Spin3Check_QTD.ui
@@ -32,7 +32,7 @@
6
-
-
+
0
@@ -243,9 +243,9 @@
qPixmapFromMimeSource
- QtxDoubleSpinBox
+ SalomeApp_DoubleSpinBox
QDoubleSpinBox
-
+ SalomeApp_DoubleSpinBox.h
diff --git a/src/EntityGUI/EntityGUI_1Spin_QTD.ui b/src/EntityGUI/EntityGUI_1Spin_QTD.ui
index e9260a30b..687f962dc 100644
--- a/src/EntityGUI/EntityGUI_1Spin_QTD.ui
+++ b/src/EntityGUI/EntityGUI_1Spin_QTD.ui
@@ -32,7 +32,7 @@
6
-
-
+
-
@@ -90,6 +90,13 @@
qPixmapFromMimeSource
+
+
+ SalomeApp_DoubleSpinBox
+ QDoubleSpinBox
+ SalomeApp_DoubleSpinBox.h
+
+
SpinBox_DX
buttonApply
diff --git a/src/EntityGUI/EntityGUI_2Spin_QTD.ui b/src/EntityGUI/EntityGUI_2Spin_QTD.ui
index 61378e2d7..f28257dd4 100644
--- a/src/EntityGUI/EntityGUI_2Spin_QTD.ui
+++ b/src/EntityGUI/EntityGUI_2Spin_QTD.ui
@@ -32,10 +32,10 @@
6
-
-
+
-
-
+
-
@@ -111,6 +111,13 @@
qPixmapFromMimeSource
+
+
+ SalomeApp_DoubleSpinBox
+ QDoubleSpinBox
+ SalomeApp_DoubleSpinBox.h
+
+
SpinBox_DX
SpinBox_DY
diff --git a/src/EntityGUI/EntityGUI_3Spin_QTD.ui b/src/EntityGUI/EntityGUI_3Spin_QTD.ui
index 907eebc6e..51dd64cfd 100644
--- a/src/EntityGUI/EntityGUI_3Spin_QTD.ui
+++ b/src/EntityGUI/EntityGUI_3Spin_QTD.ui
@@ -32,7 +32,7 @@
6
-
-
+
-
@@ -66,10 +66,10 @@
-
-
+
-
-
+
-
@@ -132,6 +132,13 @@
qPixmapFromMimeSource
+
+
+ SalomeApp_DoubleSpinBox
+ QDoubleSpinBox
+ SalomeApp_DoubleSpinBox.h
+
+
SpinBox_DX
SpinBox_DY
diff --git a/src/EntityGUI/EntityGUI_4Spin_QTD.ui b/src/EntityGUI/EntityGUI_4Spin_QTD.ui
index 279969008..661beab41 100644
--- a/src/EntityGUI/EntityGUI_4Spin_QTD.ui
+++ b/src/EntityGUI/EntityGUI_4Spin_QTD.ui
@@ -32,16 +32,16 @@
6
-
-
+
-
-
+
-
-
+
-
-
+
-
@@ -153,6 +153,13 @@
qPixmapFromMimeSource
+
+
+ SalomeApp_DoubleSpinBox
+ QDoubleSpinBox
+ SalomeApp_DoubleSpinBox.h
+
+
SpinBox_DX
SpinBox_DY
diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx
index c86520311..7f07b966f 100644
--- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx
+++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx
@@ -62,6 +62,7 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg( GeometryGUI* GUI, QWidget* parent,
const double lineWidth )
: QDialog( parent, fl ),
myIsAllAdded( false ),
+ myIsApply( false ),
GEOMBase_Helper( dynamic_cast( parent ) ),
myGeometryGUI( GUI ),
myLineWidth( lineWidth )
@@ -275,14 +276,8 @@ bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event)
}
}
- 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);
}
@@ -679,7 +674,8 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
return;
}
- QString Command = myCommand.join( "" ) + GetNewCommand();
+ QString Parameters;
+ QString Command = myCommand.join( "" ) + GetNewCommand( Parameters );
Sketcher_Profile aProfile( Command.toAscii() );
Command = myCommand.join( "" );
@@ -719,18 +715,24 @@ bool EntityGUI_SketcherDlg::ClickOnApply()
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 ) {
@@ -786,6 +788,9 @@ void EntityGUI_SketcherDlg::ClickOnUndo()
myUndoCommand.append( myCommand.last() );
myCommand.pop_back();
+ myUndoParameters.append( myParameters.last() );
+ myParameters.pop_back();
+
if ( myCommand.count() == 1 ) {
mySketchState = FIRST_POINT;
@@ -811,6 +816,9 @@ void EntityGUI_SketcherDlg::ClickOnRedo()
myCommand.append( myUndoCommand.last() );
myUndoCommand.pop_back();
+ myParameters.append( myUndoParameters.last() );
+ myUndoParameters.pop_back();
+
mySketchState = NEXT_POINT;
MainWidget->GroupConstructors->setEnabled( true );
@@ -1002,162 +1010,142 @@ void EntityGUI_SketcherDlg::ValueChangedInSpinBox( double newValue )
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
@@ -1165,20 +1153,31 @@ void EntityGUI_SketcherDlg::ValueChangedInSpinBox( double newValue )
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;
}
}
@@ -1190,80 +1189,108 @@ void EntityGUI_SketcherDlg::ValueChangedInSpinBox( double newValue )
// 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;
@@ -1284,7 +1311,32 @@ GEOM::GEOM_IOperations_ptr EntityGUI_SketcherDlg::createOperation()
//=================================================================================
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;
}
//=================================================================================
@@ -1293,6 +1345,8 @@ bool EntityGUI_SketcherDlg::isValid( QString& msg )
//=================================================================================
bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
{
+ QString aParameters;
+
if ( mySketchState == FIRST_POINT ) {
myLastX2 = myX;
myLastY2 = myY;
@@ -1308,7 +1362,7 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
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();
@@ -1367,7 +1421,7 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
}
}
else {
- cmd = myCommand.join( "" ) + GetNewCommand();
+ cmd = myCommand.join( "" ) + GetNewCommand( aParameters );
if ( Group1Sel->isVisible() ) {
Group1Sel->buttonApply->setEnabled( true );
@@ -1410,7 +1464,15 @@ bool EntityGUI_SketcherDlg::execute( ObjectList& objects )
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;
}
@@ -1519,7 +1581,7 @@ void EntityGUI_SketcherDlg::keyPressEvent( QKeyEvent* e )
}
}
-void EntityGUI_SketcherDlg::initSpinBox( QDoubleSpinBox* spinBox,
+void EntityGUI_SketcherDlg::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
double min, double max,
double step, int decimals )
{
diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.h b/src/EntityGUI/EntityGUI_SketcherDlg.h
index 4ca3841db..3a304abf1 100644
--- a/src/EntityGUI/EntityGUI_SketcherDlg.h
+++ b/src/EntityGUI/EntityGUI_SketcherDlg.h
@@ -31,7 +31,7 @@
#include
class QLineEdit;
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
class EntityGUI_1Sel;
class EntityGUI_1Spin;
class EntityGUI_2Spin;
@@ -66,7 +66,7 @@ public:
bool eventFilter (QObject* object, QEvent* event);
protected:
- void initSpinBox( QDoubleSpinBox*,
+ void initSpinBox( SalomeApp_DoubleSpinBox*,
double, double, double = 0.1,
int = 3 );
@@ -85,7 +85,7 @@ private:
void setEnabledUndo( bool );
void setEnabledRedo( bool );
- QString GetNewCommand();
+ QString GetNewCommand( QString& );
virtual void displayPreview( GEOM::GEOM_Object_ptr,
const bool = false,
@@ -106,17 +106,26 @@ private:
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;
diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx
index 8d785045d..033c2a310 100644
--- a/src/GEOM/GEOM_Engine.cxx
+++ b/src/GEOM/GEOM_Engine.cxx
@@ -58,12 +58,28 @@
#include
#include