-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// GEOM GEOMGUI : GUI for Geometry component
// File : BasicGUI_PointDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
-
+//
#include "BasicGUI_PointDlg.h"
#include <SUIT_ResourceMgr.h>
#include <QLabel>
#include <QRadioButton>
#include <QMenu>
+#include <QTimer>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
/* min, max, step and decimals for spin boxes */
- initSpinBox( GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ initSpinBox( GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
+ initSpinBox( GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision" );
+ initSpinBox( GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupXYZ->SpinBox_DX->setValue( 0.0 );
GroupXYZ->SpinBox_DY->setValue( 0.0 );
GroupXYZ->SpinBox_DZ->setValue( 0.0 );
- initSpinBox( GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ initSpinBox( GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
+ initSpinBox( GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision" );
+ initSpinBox( GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
GroupRefPoint->SpinBox_DX->setValue( 0.0 );
GroupRefPoint->SpinBox_DY->setValue( 0.0 );
GroupRefPoint->SpinBox_DZ->setValue( 0.0 );
step = 0.1;
- initSpinBox( GroupOnCurve->SpinBox_DX, 0., 1., step, 6 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+ initSpinBox( GroupOnCurve->SpinBox_DX, 0., 1., step, "parametric_precision" );
GroupOnCurve->SpinBox_DX->setValue( 0.5 );
- initSpinBox( GroupOnSurface->SpinBox_DX, 0., 1., step, 6 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+ initSpinBox( GroupOnSurface->SpinBox_DX, 0., 1., step, "parametric_precision" );
GroupOnSurface->SpinBox_DX->setValue( 0.5 );
- initSpinBox( GroupOnSurface->SpinBox_DY, 0., 1., step, 6 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+ initSpinBox( GroupOnSurface->SpinBox_DY, 0., 1., step, "parametric_precision" );
GroupOnSurface->SpinBox_DY->setValue( 0.5 );
/* signals and slots connections */
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
- connect( myParamCoord->button( PARAM_VALUE ), SIGNAL( clicked() ), this, SLOT( ClickParamCoord() ) );
- connect( myParamCoord->button( COORD_VALUE ), SIGNAL( clicked() ), this, SLOT( ClickParamCoord() ) );
+ connect( myParamCoord, SIGNAL( buttonClicked( int ) ), this, SLOT( ClickParamCoord( int ) ) );
connect( GroupOnCurve->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( GroupOnCurve->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
GroupRefPoint->SpinBox_DX->setSingleStep(step);
GroupRefPoint->SpinBox_DY->setSingleStep(step);
GroupRefPoint->SpinBox_DZ->setSingleStep(step);
- GroupOnSurface->SpinBox_DX->setSingleStep(step);
- GroupOnSurface->SpinBox_DY->setSingleStep(step);
}
myY->setText( "" );
myZ->setText( "" );
- qApp->processEvents();
- updateGeometry();
- resize( 100, 100 );
+ QTimer::singleShot(50, this, SLOT(updateSize()));
SelectionIntoArgument();
}
// function : ClickParamCoord()
// purpose :
//=================================================================================
-void BasicGUI_PointDlg::ClickParamCoord()
+void BasicGUI_PointDlg::ClickParamCoord( int id )
{
updateParamCoord( true );
displayPreview();
void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
{
bool isParam = myParamCoord->checkedId() == PARAM_VALUE;
- GroupXYZ->setShown( !isParam );
const int id = getConstructorId();
if ( id == GEOM_POINT_EDGE ) {
GroupOnSurface->SpinBox_DX->setShown( isParam );
GroupOnSurface->SpinBox_DY->setShown( isParam );
}
- if ( theIsUpdate ) {
- qApp->processEvents();
- updateGeometry();
- resize( minimumSizeHint() );
- }
+
+ GroupXYZ->setShown( !isParam );
+
+ if ( theIsUpdate )
+ QTimer::singleShot(50, this, SLOT(updateSize()));
}
//=================================================================================
localSelection( GEOM::GEOM_Object::_nil(), myNeedType );
}
+
+//=================================================================================
+// function : updateSize
+// purpose : adjust dialog size to minimum
+//=================================================================================
+void BasicGUI_PointDlg::updateSize()
+{
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSizeHint() );
+}