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 && GroupPntVecR->SpinBox_DX->isValid(msg, !IsPreview());
+ 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 );
return false;
}
- if ( id == 0 )
- return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) &&
- GroupPntDir->SpinBox_DX->isValid( msg, !IsPreview() );
+ 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 ) &&
- Group3Pnts->SpinBox_DX->isValid( msg, !IsPreview() );;
+ !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;
}
- else if ( id == 2 )
- return !CORBA::is_nil( myFace ) && GroupFace->SpinBox_DX->isValid( msg, !IsPreview() );
return false;
}
return !myRefPoint->_is_nil() && ok;
}
else if ( id == 2 ) {
- return !myEdge->_is_nil() && GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
+ bool ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
+ return !myEdge->_is_nil() && ok;
}
else if ( id == 3 )
return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
//=================================================================================
bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
{
- return !myObject->_is_nil() && myValEdt->isValid( msg, !IsPreview() );
+ bool ok = myValEdt->isValid( msg, !IsPreview() );
+ return !myObject->_is_nil() && ok;
}
//=================================================================================
bool RepairGUI_SewingDlg::isValid( QString& msg )
{
myClosed = -1;
- return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && myTolEdt->isValid( msg, !IsPreview() );
+ bool ok = myTolEdt->isValid( msg, !IsPreview() );
+ return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && ok;
}
//=================================================================================
//=================================================================================
bool TransformationGUI_RotationDlg::isValid (QString& msg)
{
- if (myObjects.length() < 1) return false;
-
switch (getConstructorId()) {
- case 0:
- return !(myAxis->_is_nil()) && GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() );
+ case 0: {
+ bool ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() );
+ return myObjects.length() > 0 && !(myAxis->_is_nil()) && ok;
break;
+ }
case 1:
- return !(myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil());
+ return myObjects.length() > 0 && !(myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil());
break;
default:
break;
//=================================================================================
bool TransformationGUI_ScaleDlg::isValid (QString& msg)
{
- if (myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001)
- {
- // && !myPoint->_is_nil()
- if (getConstructorId() == 0) {
- return SpinBox_FX->isValid( msg, !IsPreview() );
- }
- if (fabs(SpinBox_FY->value()) > 0.00001 &&
- fabs(SpinBox_FZ->value()) > 0.00001 &&
- SpinBox_FX->isValid( msg, !IsPreview()) &&
- SpinBox_FY->isValid( msg, !IsPreview()) &&
- SpinBox_FZ->isValid( msg, !IsPreview()))
- return true;
+ // && !myPoint->_is_nil()
+ if (getConstructorId() == 0) {
+ bool ok = SpinBox_FX->isValid( msg, !IsPreview() );
+ return myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001 && ok;
}
- return false;
+
+ bool ok = true;
+ ok = SpinBox_FX->isValid( msg, !IsPreview() ) && ok;
+ ok = SpinBox_FY->isValid( msg, !IsPreview() ) && ok;
+ ok = SpinBox_FZ->isValid( msg, !IsPreview() ) && ok;
+ return myObjects.length() > 0 &&
+ fabs(SpinBox_FX->value()) > 0.00001 &&
+ fabs(SpinBox_FY->value()) > 0.00001 &&
+ fabs(SpinBox_FZ->value()) > 0.00001 && ok;
}
//=================================================================================
{
int aConstructorId = getConstructorId();
- if (myObjects.length() < 1) return false;
-
switch (aConstructorId) {
case 0:
{
ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok;
ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok;
ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok;
- return ok;
+ return myObjects.length() > 0 && ok;
}
case 1:
- return !(myPoint1->_is_nil() || myPoint2->_is_nil());
+ return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil());
case 2:
- return !(myVector->_is_nil()) && GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
+ {
+ bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() );
+ return myObjects.length() > 0 && !(myVector->_is_nil()) && ok;
+ }
default:
break;
}