Dump Python extension

This commit is contained in:
ouv 2008-11-18 15:42:06 +00:00
parent a272957cb4
commit a83d11fd0f
13 changed files with 195 additions and 29 deletions

View File

@ -72,7 +72,7 @@
</widget>
</item>
<item row="0" column="1" >
<widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
</layout>
</widget>
@ -83,9 +83,9 @@
<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/>

View File

@ -168,13 +168,13 @@
</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>
@ -185,9 +185,9 @@
<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>

View File

@ -72,7 +72,7 @@
</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" >
@ -91,7 +91,7 @@
</widget>
</item>
<item row="1" column="1" >
<widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
</layout>
</widget>
@ -102,9 +102,9 @@
<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/>

View File

@ -30,6 +30,7 @@
#include <GeometryGUI.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_DoubleSpinBox.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_Desktop.h>
@ -136,7 +137,7 @@ void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox,
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
}
// TODO: to replace these method:
void GEOMBase_Skeleton::initSpinBox( QDoubleSpinBox* spinBox,
double min, double max,
double step, int decimals )
@ -146,6 +147,16 @@ void GEOMBase_Skeleton::initSpinBox( QDoubleSpinBox* spinBox,
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
}
// TODO: by the following:
void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
double min, double max,
double step, int 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 : ClickOnCancel()

View File

@ -31,6 +31,7 @@
#include <QDialog>
class SalomeApp_DoubleSpinBox;
class GeometryGUI;
class DlgRef_Skeleton;
class QSpinBox;
@ -59,7 +60,10 @@ private:
protected:
void initSpinBox( QSpinBox*, int, int, int = 1 );
// TODO: to replace these method:
void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 3 );
// TODO: by the following:
void initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.1, int = 3 );
void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* );

View File

@ -732,9 +732,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
# Example: see GEOM_TestAll.py
theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
self.PrimOp.SetParameters(Parameters)
anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj
## Create a box with two specified opposite vertices,
@ -760,8 +760,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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,
@ -775,8 +777,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -788,8 +792,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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
@ -811,8 +817,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -825,8 +833,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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
@ -839,8 +849,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -851,8 +863,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -874,8 +888,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -891,8 +907,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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
@ -908,8 +926,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -922,8 +942,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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.
@ -934,8 +956,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @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

View File

@ -462,13 +462,14 @@ bool PrimitiveGUI_BoxDlg::execute (ObjectList& objects)
double y = GroupDimensions->SpinBox_DY->value();
double z = GroupDimensions->SpinBox_DZ->value();
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z);
QStringList aParameters;
aParameters << GroupDimensions->SpinBox_DX->text();
aParameters << GroupDimensions->SpinBox_DY->text();
aParameters << GroupDimensions->SpinBox_DZ->text();
getOperation()->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z);
res = true;
}
break;

View File

@ -436,9 +436,22 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_ConeDlg::createOperation()
// function : isValid
// purpose :
//=================================================================================
bool PrimitiveGUI_ConeDlg::isValid (QString&)
bool PrimitiveGUI_ConeDlg::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;
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;
}
return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok;
}
//=================================================================================
@ -456,12 +469,26 @@ bool PrimitiveGUI_ConeDlg::execute (ObjectList& objects)
if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeConePntVecR1R2H(myPoint, myDir, getRadius1(), getRadius2(), getHeight());
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());
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;
}

View File

@ -432,9 +432,20 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_CylinderDlg::createOperation()
// 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;
}
return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok;
}
//=================================================================================
@ -452,12 +463,24 @@ bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects)
if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
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());
QStringList aParameters;
aParameters << GroupDimensions->SpinBox_DX->text();
aParameters << GroupDimensions->SpinBox_DY->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
break;
}

View File

@ -541,13 +541,19 @@ static bool isEqual (const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje
// 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);
@ -561,6 +567,7 @@ bool PrimitiveGUI_DiskDlg::isValid (QString&)
bool PrimitiveGUI_DiskDlg::execute (ObjectList& objects)
{
bool res = false;
QStringList aParameters;
GEOM::GEOM_Object_var anObj;
@ -568,11 +575,19 @@ bool PrimitiveGUI_DiskDlg::execute (ObjectList& objects)
case 0:
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeDiskR(getRadius(), myOrientationType);
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());
aParameters << GroupPntVecR->SpinBox_DX->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
break;
case 2:

View File

@ -459,14 +459,26 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_FaceDlg::createOperation()
//=================================================================================
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;
}
@ -478,12 +490,18 @@ bool PrimitiveGUI_FaceDlg::isValid( QString& msg )
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);
aParameters << GroupDimensions->SpinBox_DX->text();
aParameters << GroupDimensions->SpinBox_DY->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
break;
case 1:
@ -493,6 +511,11 @@ bool PrimitiveGUI_FaceDlg::execute (ObjectList& objects)
else if (GroupType->RadioButton2->isChecked())
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeFaceObjHW(myFace, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value());
aParameters << GroupPlane->SpinBox_DX->text();
aParameters << GroupPlane->SpinBox_DY->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
break;
}

View File

@ -378,7 +378,12 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_SphereDlg::createOperation()
//=================================================================================
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;
}
//=================================================================================
@ -396,6 +401,11 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
{
if ( !CORBA::is_nil( myPoint ) ) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSpherePntR( myPoint, getRadius() );
QStringList aParameters;
aParameters << GroupPoints->SpinBox_DX->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
}
break;
@ -403,6 +413,11 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
case 1 :
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSphereR( getRadius() );
QStringList aParameters;
aParameters << GroupDimensions->SpinBox_DX->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
break;
}

View File

@ -429,9 +429,20 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_TorusDlg::createOperation()
// 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;
}
//=================================================================================
@ -449,12 +460,24 @@ bool PrimitiveGUI_TorusDlg::execute (ObjectList& objects)
if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
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());
QStringList aParameters;
aParameters << GroupDimensions->SpinBox_DX->text();
aParameters << GroupDimensions->SpinBox_DY->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
res = true;
break;
}