-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <SalomeApp_Application.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
+#include "utilities.h"
#include <DlgRef.h>
#include <SalomeApp_Study.h>
#include <SalomeApp_Tools.h>
+#include "utilities.h"
#include <gp_Pln.hxx>
Group4Spin->hide();
GroupRect->hide();
globalSelection(); // close local selection to clear it
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ localSelection( TopAbs_VERTEX );
}
{
InitClick();
- // Connect the selction manager (disconnected in InitClick())
+ // Connect the selection manager (disconnected in InitClick())
connect( myGeometryGUI->getApp()->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
GroupRect->show();
-
+
myX1=0;
- myX2=10;
- myY1=0;
- myY2=10;
-
GroupRect->SpinBox_DX1->setValue(myX1);
+ myY1=0;
GroupRect->SpinBox_DY1->setValue(myY1);
+ myX2=10;
GroupRect->SpinBox_DX2->setValue(myX2);
+ myY2=10;
GroupRect->SpinBox_DY2->setValue(myY2);
resize( minimumSizeHint() );
{
InitClick();
Group3Spin->SpinBox_DX->blockSignals(true); // Block signals in order not to modify
- Group3Spin->SpinBox_DY->blockSignals(true); // defaut values
+ Group3Spin->SpinBox_DY->blockSignals(true); // default values
Group3Spin->SpinBox_DZ->blockSignals(true);
Group2Spin->SpinBox_DX->blockSignals(true);
else if ( constructorId == 0 ) { // X
mySketchType = DIR_ANGLE_X;
initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, "angle_precision" );
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_X2" ) );
Group2Spin->SpinBox_DY->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
mySketchType = DIR_ANGLE_Y;
initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, "angle_precision" );
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_Y2" ) );
Group2Spin->SpinBox_DY->setValue( myY );
}
}
}
else if ( constructorId == 0 ) { // X
mySketchType = DIR_PER_X;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X2" ) );
Group1Spin->SpinBox_DX->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
mySketchType = DIR_PER_Y;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y2" ) );
Group1Spin->SpinBox_DX->setValue( myY );
}
}
}
else if ( constructorId == 0 ) { // X
mySketchType = DIR_TAN_X;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X2" ) );
Group1Spin->SpinBox_DX->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
mySketchType = DIR_TAN_Y;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y2" ) );
Group1Spin->SpinBox_DX->setValue( myY );
}
}
}
else if ( constructorId == 0 ) { // X
mySketchType = DIR_DXDY_X;
- Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_X2" ) );
Group3Spin->SpinBox_DZ->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
mySketchType = DIR_DXDY_Y;
- Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_Y2" ) );
Group3Spin->SpinBox_DZ->setValue( myY );
}
}
Group4Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_VY2" ) );
Group4Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
Group4Spin->TextLabel4->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
- initSpinBox( Group4Spin->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
- initSpinBox( Group4Spin->SpinBox_DX, COORD_MIN, COORD_MAX, 0.1, "length_precision" );
- initSpinBox( Group4Spin->SpinBox_DY, COORD_MIN, COORD_MAX, 0.1, "length_precision" );
- initSpinBox( Group4Spin->SpinBox_DS, COORD_MIN, COORD_MAX, 5., "length_precision" );
+ initSpinBox( Group4Spin->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
+ initSpinBox( Group4Spin->SpinBox_DX, COORD_MIN, COORD_MAX, 0.1, "length_precision" );
+ initSpinBox( Group4Spin->SpinBox_DY, COORD_MIN, COORD_MAX, 0.1, "length_precision" );
+ initSpinBox( Group4Spin->SpinBox_DS, COORD_MIN, COORD_MAX, 5., "length_precision" );
Group4Spin->SpinBox_DX->setValue( myDX );
Group4Spin->SpinBox_DY->setValue( myDY );
// myRadius = 100.0;
return;
}
- QString Parameters;
- QString Command = myCommand.join( "" ) + GetNewCommand( Parameters );
- Sketcher_Profile aProfile( Command.toAscii() );
-
- Command = myCommand.join( "" );
- aProfile = Sketcher_Profile( Command.toAscii() );
- TopoDS_Shape myShape;
- if ( aProfile.IsDone() )
- myShape = aProfile.GetShape();
-
- if ( myShape.ShapeType() != TopAbs_VERTEX )
- myCommand.append( ":WW" );
+ QString Command = myCommand.join( "" );
+ Sketcher_Profile aProfile = Sketcher_Profile( Command.toLatin1() );
+ bool isDone = false;
+ TopoDS_Shape myShape = aProfile.GetShape( &isDone );
+ if ( isDone ) {
+ if ( myShape.ShapeType() != TopAbs_VERTEX )
+ myCommand.append( ":WW" );
+ }
}
else {
/*// PAL16008 (Sketcher Validation should be equal to Apply&Close)
selButton->setDown(true);
}
globalSelection(); // close local selection to clear it
- localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+ localSelection( myNeedType );
}
myEditCurrentArgument = Group2Sel->LineEdit2;
/* User name of object input management */
- /* If successfull the selection is changed and signal emitted... */
+ /* If successful the selection is changed and signal emitted... */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text();
QWidget* thisWidget = (QWidget*)this;
void EntityGUI_SketcherDlg::OnPointSelected(Qt::KeyboardModifiers modifiers, const gp_Pnt& thePnt,
bool isStart )
{
- // NOTE Basing the autoapply functionnality on the background picture has no sense anymore
- // The import picture functionnality is now used for drawing on top of a picture
+ // NOTE Basing the autoapply functionality on the background picture has no sense anymore
+ // The import picture functionality is now used for drawing on top of a picture
// SUIT_ViewWindow* theViewWindow = getDesktop()->activeWindow();
// OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
+ ":TT " + QString::number( myX2, Format, DigNum) + " " + QString::number( myY1, Format, DigNum)
+ ":WW";
- theParameters = myX1Str + ":" + myY1Str + ":" + myX2Str + ":" + myY2Str ;
+ theParameters = myX1Str + ":" + myY1Str + ":" + myX1Str + ":" + myY2Str + ":" + myX2Str + ":" + myY2Str + ":" + myX2Str + ":" + myY1Str;
}
return myNewCommand;
}
else {
//Test if the current point is the same as the last one
TopoDS_Shape myShape1, myShape2;
+ bool isDone = false;
+ double error = 0.;
// Set "C" numeric locale
Kernel_Utils::Localizer loc;
//Last Shape
QString Command1 = myCommand.join( "" );
- Sketcher_Profile aProfile1( Command1.toAscii() );
- if ( aProfile1.IsDone() )
- myShape1 = aProfile1.GetShape();
+ Sketcher_Profile aProfile1( Command1.toLatin1() );
+ myShape1 = aProfile1.GetShape();
//Current Shape
QString Command2 = Command1 + GetNewCommand( aParameters );
- Sketcher_Profile aProfile2( Command2.toAscii() );
+ Sketcher_Profile aProfile2( Command2.toLatin1() );
+ myShape2 = aProfile2.GetShape( &isDone, &error );
//Error Message
if ( mySketchType == PT_ABS_CENTER || mySketchType == PT_REL_CENTER ){
- if (aProfile2.Error() > Precision::Confusion()){
+ if (error > Precision::Confusion()){
Group4Spin->label->show();
- Group4Spin->label->setText( tr("GEOM_SKETCHER_WARNING") + QString::number( aProfile2.Error(), Format, DigNum));
+ Group4Spin->label->setText( tr("GEOM_SKETCHER_WARNING") + QString::number( error, Format, DigNum));
}
else{
Group4Spin->label->hide();
else
Group4Spin->label->hide();
if ( mySketchType == PT_SEL_CENTER ){
- if (aProfile2.Error() > Precision::Confusion()){
+ if (error > Precision::Confusion()){
Group2Sel->label->show();
- Group2Sel->label->setText( tr("GEOM_SKETCHER_WARNING") + QString::number( aProfile2.Error(), Format, DigNum));
+ Group2Sel->label->setText( tr("GEOM_SKETCHER_WARNING") + QString::number( error, Format, DigNum));
}
else{
Group2Sel->label->hide();
else
Group2Sel->label->hide();
- if ( aProfile2.IsDone() )
- myShape2 = aProfile2.GetShape();
-
if ( myShape2.IsNull() ) {
//the current point is the same as the last one
myLastX2 = myLastX1;