mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-24 06:40:33 +05:00
Addition of a specific error message for the 0 and 360 values.
This commit is contained in:
parent
b9cd395cc3
commit
7ac599fe97
@ -535,6 +535,10 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_CYLINDER_TITLE</source>
|
<source>GEOM_CYLINDER_TITLE</source>
|
||||||
<translation>Cylinder Construction</translation>
|
<translation>Cylinder Construction</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_CYLINDER_ANGLE_ERR</source>
|
||||||
|
<translation>Angle values 0 and 360 are unsafe to build proper volumes. Please uncheck the "Angle" box to use the regular cylinder constructor.</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_D1</source>
|
<source>GEOM_D1</source>
|
||||||
<translation>D1 :</translation>
|
<translation>D1 :</translation>
|
||||||
|
@ -547,6 +547,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_CYLINDER_TITLE</source>
|
<source>GEOM_CYLINDER_TITLE</source>
|
||||||
<translation>Construction d'un cylindre </translation>
|
<translation>Construction d'un cylindre </translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_CYLINDER_ANGLE_ERR</source>
|
||||||
|
<translation>Les valeurs de l'angle 0 et 360 sont à éviter pour construire des volumes sains. Veuillez décocher la case "Angle" pour utiliser le constructeur de cylindre complet.</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_D1</source>
|
<source>GEOM_D1</source>
|
||||||
<translation>D1 :</translation>
|
<translation>D1 :</translation>
|
||||||
|
@ -124,11 +124,11 @@ void PrimitiveGUI_CylinderDlg::Init()
|
|||||||
double SpecificStep = 5;
|
double SpecificStep = 5;
|
||||||
initSpinBox(GroupPoints->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
|
initSpinBox(GroupPoints->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
|
||||||
initSpinBox(GroupPoints->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
|
initSpinBox(GroupPoints->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
|
||||||
initSpinBox(GroupPoints->SpinBox_DZ, 0.00001, 359.99999, SpecificStep, "angle_precision" );
|
initSpinBox(GroupPoints->SpinBox_DZ, 0., 360., SpecificStep, "angle_precision" );
|
||||||
|
|
||||||
initSpinBox(GroupDimensions->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
|
initSpinBox(GroupDimensions->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
|
||||||
initSpinBox(GroupDimensions->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
|
initSpinBox(GroupDimensions->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
|
||||||
initSpinBox(GroupDimensions->SpinBox_DZ, 0.00001, 359.99999, SpecificStep, "angle_precision" );
|
initSpinBox(GroupDimensions->SpinBox_DZ, 0., 360., SpecificStep, "angle_precision" );
|
||||||
|
|
||||||
// init variables
|
// init variables
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
@ -218,7 +218,7 @@ void PrimitiveGUI_CylinderDlg::ConstructorsClicked (int constructorId)
|
|||||||
updateGeometry();
|
updateGeometry();
|
||||||
resize(minimumSizeHint());
|
resize(minimumSizeHint());
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
|
|
||||||
displayPreview(true);
|
displayPreview(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +298,6 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
|
|||||||
this, SLOT(SelectionIntoArgument()));
|
this, SLOT(SelectionIntoArgument()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPreview(true);
|
displayPreview(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,6 +371,11 @@ void PrimitiveGUI_CylinderDlg::enterEvent (QEvent*)
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_CylinderDlg::ValueChangedInSpinBox()
|
void PrimitiveGUI_CylinderDlg::ValueChangedInSpinBox()
|
||||||
{
|
{
|
||||||
|
QString msg;
|
||||||
|
if (!isValid(msg)) {
|
||||||
|
erasePreview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
displayPreview(true);
|
displayPreview(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,12 +401,20 @@ bool PrimitiveGUI_CylinderDlg::isValid (QString& msg)
|
|||||||
GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) &&
|
GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) &&
|
||||||
GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) &&
|
GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) &&
|
||||||
myPoint && myDir;
|
myPoint && myDir;
|
||||||
|
if(GroupPoints->SpinBox_DZ->value()<=0. || GroupPoints->SpinBox_DZ->value()>=360.) {
|
||||||
|
msg += tr("GEOM_CYLINDER_ANGLE_ERR") + "\n";
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( getConstructorId() == 1 )
|
else if( getConstructorId() == 1 )
|
||||||
{
|
{
|
||||||
ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) &&
|
ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) &&
|
||||||
GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) &&
|
GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) &&
|
||||||
GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() );
|
GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() );
|
||||||
|
if(GroupDimensions->SpinBox_DZ->value()<=0. || GroupDimensions->SpinBox_DZ->value()>=360.) {
|
||||||
|
msg += tr("GEOM_CYLINDER_ANGLE_ERR") + "\n";
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ok = qAbs( getHeight() ) > Precision::Confusion() && ok;
|
ok = qAbs( getHeight() ) > Precision::Confusion() && ok;
|
||||||
ok = qAbs( getRadius() ) > Precision::Confusion() && ok;
|
ok = qAbs( getRadius() ) > Precision::Confusion() && ok;
|
||||||
|
Loading…
Reference in New Issue
Block a user