22359: EDF SMESH: Body Fitting algorithm: grid orientation

Make axes coordinates fully visible
This commit is contained in:
eap 2014-07-18 16:44:15 +04:00
parent 0086dda865
commit 16f2bac719

View File

@ -58,6 +58,7 @@
#include <QApplication> #include <QApplication>
#include <QButtonGroup> #include <QButtonGroup>
#include <QCheckBox> #include <QCheckBox>
#include <QFontMetrics>
#include <QGridLayout> #include <QGridLayout>
#include <QGroupBox> #include <QGroupBox>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -677,6 +678,22 @@ namespace
dirs[( iOk+2 ) % 3] = dirs[ iOk ] ^ dirs[ ( iOk+1 ) % 3 ]; dirs[( iOk+2 ) % 3] = dirs[ iOk ] ^ dirs[ ( iOk+1 ) % 3 ];
dirs[( iOk+1 ) % 3] = dirs[ ( iOk+2 ) % 3 ] ^ dirs[ iOk ]; dirs[( iOk+1 ) % 3] = dirs[ ( iOk+2 ) % 3 ] ^ dirs[ iOk ];
} }
//================================================================================
/*!
* \brief Returns a minimal width of a SpinBox depending on a precision type
*/
//================================================================================
int getMinWidth( const char* precisionType )
{
int nb = SMESHGUI::resourceMgr()->integerValue( "SMESH", precisionType, -3 );
QString s;
s.fill('0', qAbs(nb)+7 );
QLineEdit le;
QFontMetrics metrics( le.font() );
return metrics.width( s );
}
} }
//================================================================================ //================================================================================
@ -858,7 +875,9 @@ QFrame* StdMeshersGUI_CartesianParamCreator::buildFrame()
axisLbl[2] = new QLabel( tr( "AXIS_Z"), axesDirGrp ); axisLbl[2] = new QLabel( tr( "AXIS_Z"), axesDirGrp );
QLabel* dLbl[3]; QLabel* dLbl[3];
myAxisBtnGrp = new QButtonGroup( axesDirGrp ); myAxisBtnGrp = new QButtonGroup( axesDirGrp );
SMESHGUI_SpinBox** spins[3] = { &myXDirSpin[0], &myYDirSpin[0], &myZDirSpin[0] }; // get spin width
const char * const precisionType = "len_tol_precision";
int minWidth = getMinWidth( precisionType );
for ( int i = 0; i < 3; ++i ) for ( int i = 0; i < 3; ++i )
{ {
QPushButton* axisBtn = new QPushButton( QIcon(aPix), "", axesDirGrp ); QPushButton* axisBtn = new QPushButton( QIcon(aPix), "", axesDirGrp );
@ -867,9 +886,12 @@ QFrame* StdMeshersGUI_CartesianParamCreator::buildFrame()
myXDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp ); myXDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp );
myYDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp ); myYDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp );
myZDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp ); myZDirSpin[i] = new SMESHGUI_SpinBox( axesDirGrp );
myXDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, "len_tol_precision" ); myXDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, precisionType );
myYDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, "len_tol_precision" ); myYDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, precisionType );
myZDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, "len_tol_precision" ); myZDirSpin[i]->RangeStepAndValidator( -1, 1, 0.1, precisionType );
myXDirSpin[i]->setMinimumWidth( minWidth );
myYDirSpin[i]->setMinimumWidth( minWidth );
myZDirSpin[i]->setMinimumWidth( minWidth );
dLbl[0] = new QLabel( tr("SMESH_DX"), axesDirGrp ); dLbl[0] = new QLabel( tr("SMESH_DX"), axesDirGrp );
dLbl[1] = new QLabel( tr("SMESH_DY"), axesDirGrp ); dLbl[1] = new QLabel( tr("SMESH_DY"), axesDirGrp );
dLbl[2] = new QLabel( tr("SMESH_DZ"), axesDirGrp ); dLbl[2] = new QLabel( tr("SMESH_DZ"), axesDirGrp );