//return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0;
//nil point means origin of global CS
//nil vector means Z axis
- return getRadius() > 0;
+ return getRadius() > 0 && GroupPntVecR->SpinBox_DX->isValid(msg, !IsPreview());
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() )
+ 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 );
+ for(int i = 0;i< aParameters.size();i++)
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ if ( !anObj->_is_nil() ) {
objects.push_back( anObj._retn() );
-
+ }
return true;
}
QVBoxLayout* anOriGrpLayout = new QVBoxLayout( anOriGrp );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), anOriGrp ) );
- myData[ X ] = new QDoubleSpinBox( anOriGrp );
+ myData[ X ] = new SalomeApp_DoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ X ] );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), anOriGrp ) );
- myData[ Y ] = new QDoubleSpinBox( anOriGrp );
+ myData[ Y ] = new SalomeApp_DoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ Y ] );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), anOriGrp ) );
- myData[ Z ] = new QDoubleSpinBox( 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 QDoubleSpinBox( aXAxisGrp );
+ myData[ DX1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DX1 ] );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), aXAxisGrp ) );
- myData[ DY1 ] = new QDoubleSpinBox( aXAxisGrp );
+ myData[ DY1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DY1 ] );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), aXAxisGrp ) );
- myData[ DZ1 ] = new QDoubleSpinBox( 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 QDoubleSpinBox( anYAxisGrp );
+ myData[ DX2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DX2 ] );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), anYAxisGrp ) );
- myData[ DY2 ] = new QDoubleSpinBox( anYAxisGrp );
+ myData[ DY2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DY2 ] );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), anYAxisGrp ) );
- myData[ DZ2 ] = new QDoubleSpinBox( 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() ) {
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( anObj._retn() );
+ }
return true;
}
class DlgRef_1Sel;
class DlgRef_3Sel;
-class QDoubleSpinBox;
+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, QDoubleSpinBox* > 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 )
+ return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) &&
+ GroupPntDir->SpinBox_DX->isValid( msg, !IsPreview() );
+ else if ( id == 1 ) {
return !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) &&
- !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
+ !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 ) &&
+ Group3Pnts->SpinBox_DX->isValid( msg, !IsPreview() );;
+ }
else if ( id == 2 )
- return !CORBA::is_nil( myFace );
+ return !CORBA::is_nil( myFace ) && GroupFace->SpinBox_DX->isValid( msg, !IsPreview() );
return false;
}
res = true;
break;
}
-
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
+ if ( !anObj->_is_nil() ) {
+ 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;
//=================================================================================
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;
+ }
}
//=================================================================================
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() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+
res = true;
break;
}
<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>
<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="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="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>
//=======================================================================
char* GeometryGUI::JoinObjectParameters(const QStringList& theParametersList)
{
- return (char*)theParametersList.join(":").toLatin1().constData();
+ return theParametersList.join(":").toLatin1().data();
}
//=======================================================================
// function : GeometryGUI::GeometryGUI()
#
# @ref swig_MakeVertexOnSurface "Example"
def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
- theUParameter, theVParameter, Parameters = ParseParameters(theParameter)
+ theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
RaiseIfFailed("MakePointOnSurface", self.BasicOp)
# @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.