double step = SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "SettingsGeomStep", 100.0 );
/* min, max, step and decimals for spin boxes */
- Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
+ Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
/* displays Dialog */
GroupConstructors->setEnabled(false);
if ( constructorId == 1 )
{ // XY
mySketchType = PT_ABS;
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
myX = 0.0;
else if ( constructorId == 0 )
{ // DXDY
mySketchType = PT_RELATIVE;
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
myDX = 0.0;
myLength = 100.0;
if ( myConstructorDirId == 2 )
{ // Angle
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
Group2Spin->SpinBox_DX->SetValue(myAngle);
Group2Spin->buttonApply->setFocus();
}
else if ( myConstructorDirId == 3 )
{ // DXDY
- Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
myDX = 0.0;
{ // Angle
if ( constructorId == 2 )
{ // Length
- mySketchType = DIR_ANGLE_LENGTH;
- Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
- Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
- Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
- Group3Spin->SpinBox_DX->SetValue(myAngle);
- myRadius = 100.0;
- Group3Spin->SpinBox_DY->SetValue(myRadius);
- myLength = 30.0;
- Group3Spin->SpinBox_DZ->SetValue(myLength);
- Group3Spin->show();
- Group3Spin->buttonApply->setFocus();
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->SpinBox_DX->SetValue(myAngle);
+ myRadius = 100.0;
+ Group3Spin->SpinBox_DY->SetValue(myRadius);
+ myLength = 30.0;
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ Group3Spin->show();
+ Group3Spin->buttonApply->setFocus();
}
}
else if ( myConstructorDirId == 0 )
{ // Perpendicular
if ( constructorId == 2 )
{ // Length
- mySketchType = DIR_PER_LENGTH;
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
- Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
- myRadius = 100.0;
- Group2Spin->SpinBox_DX->SetValue(myRadius);
- myLength = 30.0;
- Group2Spin->SpinBox_DY->SetValue(myLength);
- Group2Spin->show();
- Group2Spin->buttonApply->setFocus();
+ mySketchType = DIR_PER_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
}
}
else if ( myConstructorDirId == 1 )
{ // Tangent
if ( constructorId == 2 )
{ // Length
- mySketchType = DIR_TAN_LENGTH;
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
- Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
- myRadius = 100.0;
- Group2Spin->SpinBox_DX->SetValue(myRadius);
- myLength = 30.0;
- Group2Spin->SpinBox_DY->SetValue(myLength);
- Group2Spin->show();
- Group2Spin->buttonApply->setFocus();
+ mySketchType = DIR_TAN_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
}
}
else if ( myConstructorDirId == 3 )
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "MeasureGUI_CenterMassDlg.h"
#include "MeasureGUI_1Sel3LineEdit_QTD.h"
+#include "DlgRef_SpinBox.h"
+
#include "utilities.h"
#include "SUIT_Session.h"
#include "SalomeApp_Application.h"
getParameters( x, y, z );
myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
- myGrp->LineEdit2->setText( QString( "%1" ).arg( x ) );
- myGrp->LineEdit3->setText( QString( "%1" ).arg( y ) );
- myGrp->LineEdit4->setText( QString( "%1" ).arg( z ) );
+ myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( x ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( y ) );
+ myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( z ) );
displayPreview();
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "MeasureGUI_2Sel1LineEdit_QTD.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "DlgRef_SpinBox.h"
#include "SUIT_Session.h"
#include "SUIT_ViewWindow.h"
mySelEdit = myGrp->LineEdit1;
mySelBtn2 = myGrp->PushButton2;
mySelEdit2 = myGrp->LineEdit2;
-
+
myEditCurrentArgument = mySelEdit;
connect( mySelEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
MeasureGUI_Skeleton::Init();
-
}
double aDist = 0.;
if ( getParameters( aDist, aPnt1, aPnt2 ) )
{
- myGrp->LineEdit3->setText( QString( "%1" ).arg( aDist ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( aDist ) );
redisplayPreview();
}
else
myGrp->LineEdit3->setText( "" );
erasePreview();
}
-
}
//=================================================================================
{
double aDist = 0.;
gp_Pnt aPnt1( 0, 0, 0 ), aPnt2( 0, 0, 0 );
-
- if ( myObj->_is_nil() || myObj2->_is_nil() || !getParameters( aDist, aPnt1, aPnt2 ) ||
- SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
- != OCCViewer_Viewer::Type() )
+
+ SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+
+ if ( myObj->_is_nil() || myObj2->_is_nil() ||
+ !getParameters( aDist, aPnt1, aPnt2 ) ||
+ vw->getViewManager()->getType() != OCCViewer_Viewer::Type() )
return 0;
-
+
try
{
if( aDist <= 1.e-9 )
( aPnt1.Y() + aPnt2.Y() ) / 2,
( aPnt1.Z() + aPnt2.Z() ) / 2 + 100 );
-
gp_Vec va( aPnt3, aPnt1 );
gp_Vec vb( aPnt3, aPnt2 );
aPnt3.SetY( ( aPnt1.Y() + aPnt2.Y() ) / 2 + 100 );
aPnt3.SetZ( ( aPnt1.Z() + aPnt2.Z() ) / 2 );
}
-
+
gce_MakePln gce_MP( aPnt1, aPnt2, aPnt3 );
Handle( Geom_Plane ) P = new Geom_Plane( gce_MP.Value() );
- Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension(
- aVert1, aVert2, P, aDist, TCollection_ExtendedString( (Standard_CString)aLabel.latin1() ) );
+ Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension
+ (aVert1, aVert2, P, aDist, TCollection_ExtendedString((Standard_CString)aLabel.latin1()));
- SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
- SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
-
- //QAD_ViewFrame* vf = GEOM_Displayer::GetActiveView();
- //OCCViewer_Prs* aPrs = dynamic_cast<OCCViewer_Prs*>( vf->CreatePrs( 0 ) );
+ SOCC_Prs* aPrs =
+ dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
if ( aPrs )
aPrs->AddObject( anIO );
{
return MeasureGUI_Skeleton::isValid( msg ) && !myObj2->_is_nil();
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
return getOperation()->IsDone();
}
}
-
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
return getOperation()->IsDone();
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
//=================================================================================
// class : MeasureGUI_PointDlg()
// purpose : Constructs a MeasureGUI_PointDlg which is a child of 'parent'
-//
//=================================================================================
MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
: MeasureGUI_Skeleton( GUI, parent, "MeasureGUI_PointDlg" )
{
QPixmap iconPnt( SUIT_Session::session()->resourceMgr()->loadPixmap(
"GEOM",tr( "ICON_DLG_POINT" ) ) );
-
+
QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap(
"GEOM",tr( "ICON_SELECT" ) ) );
RadioButton1->setPixmap( iconPnt );
QGroupBox* aGrp = new QGroupBox( 2, Qt::Horizontal, tr( "COORDINATES" ), this );
-
+
new QLabel( tr( "POINT" ), aGrp );
QFrame* aFrame = new QFrame( aGrp );
mySelBtn = new QPushButton( aFrame );
//=================================================================================
// function : ~MeasureGUI_PointDlg()
// purpose : Destroys the object and frees any allocated resources
-//======================myX->setReadOnly( true );===========================================================
+//=================================================================================
MeasureGUI_PointDlg::~MeasureGUI_PointDlg()
{
}
TopTools_IndexedMapOfShape aShapes;
TopExp::MapShapes( aShape, aShapes );
-
+
if ( aShape != aShapes( i ) )
aName += QString( ":%1" ).arg( i );
myZ->setText( "" );
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#include "GEOM_Displayer.h"
#include "GEOMImpl_Types.hxx"
#include "GEOMBase.h"
+#include "DlgRef_SpinBox.h"
#include "SalomeApp_Tools.h"
#include "utilities.h"
}
else
{
- myGrp->LineEdit2->setText( QString( "%1" ).arg( aLength ) );
- myGrp->LineEdit3->setText( QString( "%1" ).arg( anArea ) );
- myGrp->LineEdit4->setText( QString( "%1" ).arg( aVolume ) );
+ myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( aLength ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( anArea ) );
+ myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( aVolume ) );
}
}
return getDisplayer()->BuildPrs( aResult );
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
double SpecificStep1 = 0.1;
double SpecificStep2 = 0.01;
/* min, max, myStep and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, myStep, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, 3);
- GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, myStep, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue( 100.0 );
GroupPoints->SpinBox_DY->SetValue( 1.0 );
double SpecificStep = 10.0;
QMap< int, DlgRef_SpinBox* >::iterator anIter;
for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter )
- anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, 3 );
+ anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY );
setHelpFileName("chamfer.htm");
// File : OperationGUI_ClippingDlg.cxx
// Author : Michael Zorin
// Module : GEOM
-// $Header:
+// $Header$
#include "OperationGUI_ClippingDlg.h"
#include "DlgRef_SpinBox.h"
#include <V3d_View.hxx>
#include <V3d.hxx>
-//#include <V3d_Plane.hxx>
-
// QT Includes
#include <qapplication.h>
#include <qgroupbox.h>
Layout1->addWidget( GroupArguments, 2, 0 );
/* Initialisations */
- SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
- SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
+ SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY );
+ SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY );
/* signals and slots connections */
connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
SUIT_ViewWindow* anActiveWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return;
-
+
if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
if( !aVTKFrame )
return;
-
+
TextLabelNear->setText( tr( "Near" ) );
TextLabelFar->setText( tr( "Far" ) );
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return;
-
+
vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
if( anActiveCamera == NULL ){
MESSAGE("Trying to reset clipping range of non-existant camera");
return;
}
-
+
// Find the plane equation for the camera view plane
double vn[3];
anActiveCamera->GetViewPlaneNormal(vn);
double position[3];
anActiveCamera->GetPosition(position);
-
+
vtkFloatingPointType bounds[6];
aRenderer->ComputeVisiblePropBounds(bounds);
-
+
double center[3];
center[0] = (bounds[0] + bounds[1])/2.0;
center[1] = (bounds[2] + bounds[3])/2.0;
center[2] = (bounds[4] + bounds[5])/2.0;
-
+
double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-
+
double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
-
+
vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
-
+
SpinBox_Near->SetValue(range[0]);
SpinBox_Far->SetValue(range[1]);
-
+
return;
}
else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
- double depth, thickness;
+ double depth, thickness;
int ztype= view3d->ZClipping(depth, thickness);
SpinBox_Near->SetValue(depth);
SpinBox_Far->SetValue(thickness);
SUIT_ViewWindow* anActiveWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return false;
-
+
if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
if( !aVTKFrame )
return false;
-
+
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return false;
-
+
vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
if( anActiveCamera == NULL ){
MESSAGE("Trying to reset clipping range of non-existant camera");
return false;
}
-
+
vtkFloatingPointType range[2] = { SpinBox_Near->GetValue(), SpinBox_Far->GetValue() };
if (range[0] < 0.0) range[0] = 0.0;
anActiveCamera->SetClippingRange( range );
-
+
return true;
}
else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
OCCViewer_ViewWindow* aOCCFrame = dynamic_cast<OCCViewer_ViewWindow*>( anActiveWindow );
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
-
+
double depth = SpinBox_Near->GetValue();
double thickness = SpinBox_Far->GetValue();
int aType = TypeCB->currentItem();
-
+
view3d->SetZClippingType(V3d_TypeOfZclipping(aType));
view3d->SetZClippingDepth(depth);
view3d->SetZClippingWidth(thickness);
SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return;
-
+
if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return;
-
+
vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
if( anActiveCamera == NULL ){
MESSAGE("Trying to reset clipping range of non-existant camera");
return;
}
-
+
// Find the plane equation for the camera view plane
double vn[3];
anActiveCamera->GetViewPlaneNormal(vn);
double position[3];
anActiveCamera->GetPosition(position);
-
+
vtkFloatingPointType bounds[6];
aRenderer->ComputeVisiblePropBounds(bounds);
-
+
double center[3];
center[0] = (bounds[0] + bounds[1])/2.0;
center[1] = (bounds[2] + bounds[3])/2.0;
center[2] = (bounds[4] + bounds[5])/2.0;
-
+
double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-
+
double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
-
+
vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
-
+
SpinBox_Near->SetValue(range[0]);
SpinBox_Far->SetValue(range[1]);
-
+
return;
}
else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
TextLabelNear->setText( tr( "Depth" ) );
TextLabelFar->setText( tr( "Thickness" ) );
-
+
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
-
+
view3d->SetZClippingType(V3d_TypeOfZclipping(0));
view3d->ZFitAll();
- double depth, thickness;
+ double depth, thickness;
int ztype= view3d->ZClipping(depth, thickness);
SpinBox_Near->SetValue(0);
SpinBox_Far->SetValue(1000);
/***************************************************************/
double SpecificStep = 10.0;
- Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3);
- Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3);
- Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3);
+ Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+ Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+ Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
setHelpFileName("fillet.htm");
//=================================================================================
// class : TransformationGUI_MultiRotationDlg()
-// purpose : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
double SpecificStep1 = 5;
double SpecificStep2 = 1;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
GroupPoints->SpinBox_DX->SetValue(myNbTimes1);
- GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, 3);
- GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3);
- GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3);
+ GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
+ GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
GroupDimensions->SpinBox_DX1->SetValue(myAng);
GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1);
GroupDimensions->SpinBox_DX2->SetValue(myStep);
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double)));
connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_MULTIROTATION" ) );
GroupDimensions->SpinBox_DY2->SetValue(myNbTimes2);
break;
- }
+ }
}
myEditCurrentArgument->setFocus();
{
if ( !onAccept() )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_ALLSHAPES );
void TransformationGUI_MultiRotationDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 ||
+ if(send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 ||
send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2)
{
- myEditCurrentArgument = send;
+ myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
}
void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+
ConstructorsClicked( getConstructorId() );
}
myStep = newValue;
else if(send == GroupDimensions->SpinBox_DY2)
myNbTimes2 = (int)newValue;
-
+
displayPreview();
}
bool TransformationGUI_MultiRotationDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
case 0 :
{
break;
}
}
-
+
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_MultiTranslationDlg()
-// purpose : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
-
+
double SpecificStep = 1;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
GroupPoints->SpinBox_DX->SetValue(myStepU);
GroupPoints->SpinBox_DY->SetValue(myNbTimesU);
- GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
- GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
+ GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
+ GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
GroupDimensions->SpinBox_DX1->SetValue(myStepU);
GroupDimensions->SpinBox_DY1->SetValue(myNbTimesU);
GroupDimensions->SpinBox_DX2->SetValue(myStepV);
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
connect(GroupDimensions->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(ReverseStepV()));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
initName( tr( "GEOM_MULTITRANSLATION" ) );
ConstructorsClicked( 0 );
}
void TransformationGUI_MultiTranslationDlg::ConstructorsClicked(int constructorId)
{
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-
+
myStepU = myStepV = 50.0;
myNbTimesU = myNbTimesV = 2;
break;
}
}
-
+
myEditCurrentArgument->setFocus();
myBase = myVectorU = GEOM::GEOM_Object::_nil();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
{
if ( !onAccept() )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText("");
-
- if(IObjectCount() != 1) {
- if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
+
+ if (IObjectCount() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit1)
myBase = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit2)
myVectorU = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupDimensions->LineEdit3)
+ else if (myEditCurrentArgument == GroupDimensions->LineEdit3)
myVectorV = GEOM::GEOM_Object::_nil();
return;
}
if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
return;
- if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
- myBase = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
+ if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit1)
+ myBase = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit2)
myVectorU = aSelectedObject;
- else if(myEditCurrentArgument == GroupDimensions->LineEdit3)
+ else if (myEditCurrentArgument == GroupDimensions->LineEdit3)
myVectorV = aSelectedObject;
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
-
+
displayPreview();
}
void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument = GroupDimensions->LineEdit3;
globalSelection( GEOM_LINE );
}
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2 ||
send == GroupDimensions->LineEdit3)
{
- myEditCurrentArgument = send;
+ myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
}
void TransformationGUI_MultiTranslationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
break;
}
}
-
+
displayPreview();
}
void TransformationGUI_MultiTranslationDlg::ReverseStepU()
{
myStepU = -myStepU;
-
+
int aConstructorId = getConstructorId();
if(aConstructorId == 0)
GroupPoints->SpinBox_DX->SetValue(myStepU);
else if(aConstructorId == 1)
GroupDimensions->SpinBox_DX1->SetValue(myStepU);
-
+
displayPreview();
}
void TransformationGUI_MultiTranslationDlg::ReverseStepV()
{
myStepV = -myStepV;
-
+
GroupDimensions->SpinBox_DX2->SetValue(myStepV);
-
+
displayPreview();
}
bool TransformationGUI_MultiTranslationDlg::isValid( QString& msg )
{
int aConstructorId = getConstructorId();
-
+
if(aConstructorId == 0)
return !(myBase->_is_nil() || myVectorU->_is_nil());
else if(aConstructorId == 1)
return !(myBase->_is_nil() || myVectorU->_is_nil() || myVectorV->_is_nil());
- return 0;
+ return 0;
}
//=================================================================================
bool TransformationGUI_MultiTranslationDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
case 0 :
{
break;
}
}
-
+
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_OffsetDlg()
-// purpose : Constructs a TransformationGUI_OffsetDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_OffsetDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
RadioButton1->setPixmap(image0);
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
-
+
GroupPoints = new DlgRef_1Sel1Spin1Check(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupPoints->CheckButton1->hide();
GroupPoints->PushButton1->setPixmap(image1);
-
+
Layout1->addWidget(GroupPoints, 2, 0);
-
+
/***************************************************************/
- setHelpFileName("offset_surface.htm");
-
+ setHelpFileName("offset_surface.htm");
+
Init();
}
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
TransformationGUI_OffsetDlg::~TransformationGUI_OffsetDlg()
-{
+{
/* no need to delete child widgets, Qt does it all for us */
}
// purpose :
//=================================================================================
void TransformationGUI_OffsetDlg::Init()
-{
+{
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setReadOnly( true );
-
+
/* Get setting of step value from file configuration */
double step = 1;
-
+
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DX->setPrecision(5);
- //@ GroupPoints->SpinBox_DX->setDblPrecision(1e-05);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(1e-05);
-
+
// Activate Create a Copy mode
GroupPoints->CheckButton1->setChecked(true);
CreateCopyModeChanged(true);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
+
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-
+
initName( tr( "GEOM_OFFSET" ) );
globalSelection( GEOM_ALLSHAPES );
-
}
{
if ( !onAccept( GroupPoints->CheckButton1->isChecked() ) )
return false;
-
+
initName();
return true;
}
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
if (!myObjects.length())
return;
-
+
myEditCurrentArgument->setText( aName );
-
+
displayPreview();
}
void TransformationGUI_OffsetDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1)
{
myEditCurrentArgument = GroupPoints->LineEdit1;
void TransformationGUI_OffsetDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
globalSelection( GEOM_ALLSHAPES );
myEditCurrentArgument = GroupPoints->LineEdit1;
bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
-
-
+
if (GroupPoints->CheckButton1->isChecked() || IsPreview())
for (int i = 0; i < myObjects.length(); i++)
- {
-
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() );
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
- }
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ OffsetShapeCopy( myObjects[i], GetOffset() );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
else
for (int i = 0; i < myObjects.length(); i++)
- {
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShape( myObjects[i], GetOffset() );
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
- }
-
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ OffsetShape( myObjects[i], GetOffset() );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+
res = true;
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_RotationDlg()
-// purpose : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
+
double anAngle = 0;
double SpecificStep = 5;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(anAngle);
// Activate Create a Copy mode
GroupPoints->CheckButton1->setChecked(true);
CreateCopyModeChanged(true);
-
+
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton5, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
+
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
-
+
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit2->clear();
-
+
myAxis = myCentPoint = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
-
+
initName( tr( "GEOM_ROTATION" ) );
ConstructorsClicked( 0 );
}
void TransformationGUI_RotationDlg::ConstructorsClicked(int constructorId)
{
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-
+
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
switch (constructorId)
{
case 0: /* rotation an object angle and axis */
- {
+ {
GroupPoints->ShowRows(2,3,false);
resize(0,0);
GroupPoints->TextLabel2->setText(tr("GEOM_AXIS"));
GroupPoints->LineEdit5->clear();
myCentPoint = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
break;
- }
+ }
}
-
+
myEditCurrentArgument->setFocus();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
{
if ( !onAccept( GroupPoints->CheckButton1->isChecked()) )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
{
myEditCurrentArgument->setText("");
QString aName;
-
+
if(myEditCurrentArgument == GroupPoints->LineEdit1)
{
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
if (!myObjects.length())
return;
}
- else
+ else
{
if(IObjectCount() != 1)
{
aName = GEOMBase::GetName( aSelectedObject );
}
myEditCurrentArgument->setText( aName );
-
+
displayPreview();
}
void TransformationGUI_RotationDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
// purpose :
//=================================================================================
void TransformationGUI_RotationDlg::LineEditReturnPressed()
-{
+{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
void TransformationGUI_RotationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
{
switch (getConstructorId())
{
- case 0:
+ case 0:
{
return !(myObjects.length() == 0 || myAxis->_is_nil());
break;
}
- case 1:
+ case 1:
{
return !(myObjects.length() == 0 || myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil() );
break;
bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
GEOM::GEOM_Object_var anObj;
-
- switch ( getConstructorId() )
+
+ switch ( getConstructorId() )
{
case 0 :
{
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
break;
}
}
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_ScaleDlg()
-// purpose : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
double aFactor = 2.0;
double SpecificStep = 0.5;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(aFactor);
-
+
// Activate Create a Copy mode
GroupPoints->CheckButton1->setChecked(true);
CreateCopyModeChanged(true);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
+
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
+
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
setHelpFileName("scale_transform.htm");
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
TransformationGUI_ScaleDlg::~TransformationGUI_ScaleDlg()
-{
+{
/* no need to delete child widgets, Qt does it all for us */
}
{
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit2->clear();
-
+
myPoint = GEOM::GEOM_Object::_nil();
-
+
initName( tr( "GEOM_SCALE" ) );
}
aName = GEOMBase::GetName( myPoint );
}
myEditCurrentArgument->setText( aName );
-
+
displayPreview();
}
void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_POINT );
}
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
void TransformationGUI_ScaleDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
globalSelection();
GroupPoints->LineEdit1->setFocus();
bool TransformationGUI_ScaleDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
if (GroupPoints->CheckButton1->isChecked() || IsPreview())
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->ScaleShapeCopy( myObjects[i], myPoint, GetFactor() );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ ScaleShapeCopy( myObjects[i], myPoint, GetFactor() );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->ScaleShape( myObjects[i], myPoint, GetFactor() );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ ScaleShape( myObjects[i], myPoint, GetFactor() );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
res = true;
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_TranslationDlg()
-// purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
-
+
setHelpFileName("translation.htm");
-
+
Init();
}
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox1->SetValue(0.0);
GroupPoints->SpinBox2->SetValue(0.0);
connect(GroupPoints->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
- connect(myGeomGUI->getApp()->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_TRANSLATION" ) );
ConstructorsClicked( 0 );
switch (constructorId)
{
case 0: /* translation an object by dx, dy, dz */
- {
+ {
GroupPoints->ShowRows(1,2,false);
resize(0,0);
GroupPoints->ShowRows(3,5,true);
GroupPoints->LineEdit3->clear();
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
break;
- }
+ }
case 2: /* translation an object by vector */
{
GroupPoints->ShowRows(2,5,false);
}
myEditCurrentArgument->setFocus();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
myPoint2 = GEOM::GEOM_Object::_nil();
return;
}
-
+
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult);
else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
myVector = aSelectedObject;
else if (myEditCurrentArgument == GroupPoints->LineEdit3)
- myPoint2 = aSelectedObject;
+ myPoint2 = aSelectedObject;
aName = GEOMBase::GetName( aSelectedObject );
}
// purpose :
//=================================================================================
void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
-{
+{
QPushButton* send = (QPushButton*)sender();
if (send == GroupPoints->PushButton1) {
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
case 0:
{