From d89a4ce0166c292faa4ca87222e6a5317c233483 Mon Sep 17 00:00:00 2001 From: dcq Date: Mon, 5 Apr 2004 09:15:16 +0000 Subject: [PATCH] DCQ : Merge PAL + Debug --- src/BasicGUI/BasicGUI_ArcDlg.cxx | 1 + src/BasicGUI/BasicGUI_CircleDlg.cxx | 1 + src/BasicGUI/BasicGUI_EllipseDlg.cxx | 1 + src/BasicGUI/BasicGUI_LineDlg.cxx | 1 + src/BasicGUI/BasicGUI_PlaneDlg.cxx | 1 + src/BasicGUI/BasicGUI_PointDlg.cxx | 1 + src/BasicGUI/BasicGUI_VectorDlg.cxx | 1 + src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx | 1 + src/BooleanGUI/BooleanGUI_CutDlg.cxx | 4 +- src/BuildGUI/BuildGUI_FaceDlg.cxx | 2 +- src/BuildGUI/BuildGUI_ShellDlg.cxx | 6 +- src/BuildGUI/BuildGUI_ShellDlg.h | 5 +- src/EntityGUI/EntityGUI.cxx | 8 +- src/GEOM/GEOM_Gen_i.cc | 17 +- src/GEOMBase/GEOMBase.cxx | 6 +- src/GEOMContext/GEOMContext.cxx | 6 + src/GEOMContext/GEOMContext.h | 3 +- src/GEOMContext/GEOM_msg_en.po | 15 ++ src/GEOMContext/GEOM_msg_fr.po | 77 ++++--- src/GEOMGUI/GeometryGUI.cxx | 1 + src/GEOMToolsGUI/GEOMToolsGUI.cxx | 57 ++++- src/GEOM_SWIG/batchmode_geompy.py | 6 + src/GEOM_SWIG/geompy.py | 6 + .../GenerationGUI_FillingDlg.cxx | 1 + src/GenerationGUI/GenerationGUI_PipeDlg.cxx | 2 +- src/GenerationGUI/GenerationGUI_PrismDlg.cxx | 1 + src/GenerationGUI/GenerationGUI_RevolDlg.cxx | 1 + src/MeasureGUI/MeasureGUI_WhatisDlg.cxx | 11 +- .../OperationGUI_ArchimedeDlg.cxx | 1 + src/OperationGUI/OperationGUI_ChamferDlg.cxx | 204 +++++------------- src/OperationGUI/OperationGUI_ChamferDlg.h | 3 - src/OperationGUI/OperationGUI_FilletDlg.cxx | 188 ++++++---------- src/OperationGUI/OperationGUI_FilletDlg.h | 3 - src/PrimitiveGUI/PrimitiveGUI.cxx | 7 +- src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 1 + src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx | 9 +- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx | 1 + src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx | 1 + src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx | 25 ++- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h | 2 - src/RepairGUI/RepairGUI.cxx | 4 +- src/RepairGUI/RepairGUI_OrientationDlg.cxx | 1 + src/RepairGUI/RepairGUI_SewingDlg.cxx | 1 + .../TransformationGUI_MirrorDlg.cxx | 1 + .../TransformationGUI_MultiRotationDlg.cxx | 5 +- .../TransformationGUI_MultiTranslationDlg.cxx | 7 +- .../TransformationGUI_RotationDlg.cxx | 1 + .../TransformationGUI_ScaleDlg.cxx | 1 + .../TransformationGUI_TranslationDlg.cxx | 1 + 49 files changed, 340 insertions(+), 370 deletions(-) diff --git a/src/BasicGUI/BasicGUI_ArcDlg.cxx b/src/BasicGUI/BasicGUI_ArcDlg.cxx index 33f929e3d..751a6e686 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.cxx +++ b/src/BasicGUI/BasicGUI_ArcDlg.cxx @@ -137,6 +137,7 @@ void BasicGUI_ArcDlg::ClickOnOk() //================================================================================= void BasicGUI_ArcDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index b29e778fe..14b866419 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -147,6 +147,7 @@ void BasicGUI_CircleDlg::ClickOnOk() //================================================================================= void BasicGUI_CircleDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 6093d492b..e7ea7199f 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -153,6 +153,7 @@ void BasicGUI_EllipseDlg::ClickOnOk() //================================================================================= void BasicGUI_EllipseDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_LineDlg.cxx b/src/BasicGUI/BasicGUI_LineDlg.cxx index b5b649821..fe9f75b50 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.cxx +++ b/src/BasicGUI/BasicGUI_LineDlg.cxx @@ -135,6 +135,7 @@ void BasicGUI_LineDlg::ClickOnOk() //================================================================================= void BasicGUI_LineDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index cd429b1bc..b280bfeae 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -273,6 +273,7 @@ void BasicGUI_PlaneDlg::ClickOnOk() //================================================================================= void BasicGUI_PlaneDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 51b287dd2..52128eeac 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -259,6 +259,7 @@ void BasicGUI_PointDlg::ClickOnOk() //================================================================================= void BasicGUI_PointDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if(mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 6d4eb0d24..03baf4300 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -237,6 +237,7 @@ void BasicGUI_VectorDlg::ClickOnOk() //================================================================================= void BasicGUI_VectorDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx index 1403f8f02..515269302 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx @@ -127,6 +127,7 @@ void BasicGUI_WorkingPlaneDlg::ClickOnOk() //================================================================================= void BasicGUI_WorkingPlaneDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if(myOkPlane) myBasicGUI->MakeWorkingPlane(myLoc, myDir); diff --git a/src/BooleanGUI/BooleanGUI_CutDlg.cxx b/src/BooleanGUI/BooleanGUI_CutDlg.cxx index 1cc08269d..4123fed72 100644 --- a/src/BooleanGUI/BooleanGUI_CutDlg.cxx +++ b/src/BooleanGUI/BooleanGUI_CutDlg.cxx @@ -52,8 +52,8 @@ BooleanGUI_CutDlg::BooleanGUI_CutDlg(QWidget* parent, const char* name, BooleanG GroupCut = new DlgRef_2Sel_QTD(this, "GroupCut"); GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); - GroupCut->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); - GroupCut->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); + GroupCut->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); + GroupCut->TextLabel2->setText(tr("GEOM_TOOL_OBJECT")); GroupCut->PushButton1->setPixmap(image1); GroupCut->PushButton2->setPixmap(image1); diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index 2edaf57b9..197231414 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -52,7 +52,7 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg(QWidget* parent, const char* name, BuildGUI* GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_FACE_FFW")); - GroupPoints->TextLabel1->setText(tr("GEOM_WIRE")); + GroupPoints->TextLabel1->setText(tr("GEOM_WIRES")); GroupPoints->CheckButton1->setText(tr("GEOM_FACE_OPT")); GroupPoints->PushButton1->setPixmap(image1); diff --git a/src/BuildGUI/BuildGUI_ShellDlg.cxx b/src/BuildGUI/BuildGUI_ShellDlg.cxx index 8a33f4cf6..1f4df38cf 100644 --- a/src/BuildGUI/BuildGUI_ShellDlg.cxx +++ b/src/BuildGUI/BuildGUI_ShellDlg.cxx @@ -87,7 +87,7 @@ void BuildGUI_ShellDlg::Init() myEditCurrentArgument = GroupShell->LineEdit1; myOkListShapes = false; - myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom); + myFaceFilter = new GEOM_ShapeTypeFilter(TopAbs_FACE, myGeom); /* Filter for the next selection */ mySelection->AddFilter(myFaceFilter) ; @@ -163,10 +163,8 @@ void BuildGUI_ShellDlg::SelectionIntoArgument() //================================================================================= void BuildGUI_ShellDlg::SetEditCurrentArgument() { - QPushButton* send = (QPushButton*)sender(); - mySelection->ClearFilters() ; + mySelection->ClearFilters(); GroupShell->LineEdit1->setFocus(); - myEditCurrentArgument = GroupShell->LineEdit1; mySelection->AddFilter(myFaceFilter); this->SelectionIntoArgument(); return; diff --git a/src/BuildGUI/BuildGUI_ShellDlg.h b/src/BuildGUI/BuildGUI_ShellDlg.h index 87f3d428e..3bb860857 100644 --- a/src/BuildGUI/BuildGUI_ShellDlg.h +++ b/src/BuildGUI/BuildGUI_ShellDlg.h @@ -34,7 +34,7 @@ #include "BuildGUI.h" -#include "GEOM_FaceFilter.hxx" +#include "GEOM_ShapeTypeFilter.hxx" //================================================================================= // class : BuildGUI_ShellDlg @@ -54,7 +54,7 @@ private: BuildGUI* myBuildGUI; - Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */ + Handle(GEOM_ShapeTypeFilter) myFaceFilter; /* Filters selection */ GEOM::GEOM_Gen::ListOfIOR myListShapes; bool myOkListShapes; /* to check when arguments is defined */ @@ -64,7 +64,6 @@ private slots: void ClickOnOk(); void ClickOnApply(); void SetEditCurrentArgument(); - void LineEditReturnPressed(); void SelectionIntoArgument(); void ActivateThisDialog(); diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index 4234a8477..f83cec33c 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -579,7 +579,7 @@ bool EntityGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shap } else { aResult->NameType(tr("GEOM_SHAPE")); - sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++); + sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); } SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name()); @@ -814,7 +814,7 @@ bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* } else { aResult->NameType(tr("GEOM_SHAPE")); - sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++); + sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); } result = new GEOM_AISShape(Exp.Current(), nameG); IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); @@ -823,10 +823,10 @@ bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* else { if ( myGeomBase->GetShapeTypeString(compound,Type)) { aResult->NameType(Type); - sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++); + sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++); } else { aResult->NameType(tr("GEOM_SHAPE")); - sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++); + sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); } result = new GEOM_AISShape(compound, nameG); IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); diff --git a/src/GEOM/GEOM_Gen_i.cc b/src/GEOM/GEOM_Gen_i.cc index 4bf747c5a..b94999df0 100644 --- a/src/GEOM/GEOM_Gen_i.cc +++ b/src/GEOM/GEOM_Gen_i.cc @@ -614,7 +614,7 @@ CORBA::Boolean GEOM_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) { //============================================================================ SALOMEDS::TMPFile* GEOM_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) { // Declare a sequence of the byte to store the copied object - SALOMEDS::TMPFile_var aStreamFile; + SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile; // Try to get GEOM_Shape object by given SObject SALOMEDS::GenericAttribute_var anAttr; @@ -911,7 +911,15 @@ void GEOM_Gen_i::InsertInLabelMoreArguments(TopoDS_Shape main_topo, //================================================================================= CORBA::Short GEOM_Gen_i::NbLabels() { - return TDF_Tool::NbLabels( myCurrentOCAFDoc->Main() ); + TDF_ChildIterator ChildIterator(myCurrentOCAFDoc->Main()); + unsigned int i = 1; + + while (ChildIterator.More()) { + i++; + ChildIterator.Next(); + } + return i; + // return TDF_Tool::NbLabels( myCurrentOCAFDoc->Main() ); } @@ -2334,7 +2342,6 @@ GEOM::GEOM_Gen::ListOfGeomShapes* GEOM_Gen_i::SubShapesAll(GEOM::GEOM_Shape_ptr return listOfGeomShapes._retn() ; } - //================================================================================= // function : MakeBoolean() // purpose : Boolean operation according to the type 'operation' @@ -2348,7 +2355,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeBoolean(GEOM::GEOM_Shape_ptr shape1, TopoDS_Shape shape ; TopoDS_Shape aShape1 ; TopoDS_Shape aShape2 ; - + try { aShape1 = GetTopoShape(shape1) ; aShape2 = GetTopoShape(shape2) ; @@ -3598,6 +3605,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeVertex(CORBA::Double x, if (tds.IsNull()) { THROW_SALOME_CORBA_EXCEPTION("Make Vertex/Point aborted", SALOME::BAD_PARAM); } + tds.Infinite(true); result = CreateObject(tds) ; const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ; result->ShapeId(entry); @@ -3814,6 +3822,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeLine(const GEOM::PointStruct& pstruct, THROW_SALOME_CORBA_EXCEPTION("Make Line aborted : null shape", SALOME::BAD_PARAM); } else { + tds.Infinite(true); result = CreateObject(tds) ; const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ; result->ShapeId(entry); diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index fd8b537af..c8ff0a0c2 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -506,11 +506,11 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name) Standard_CString type; GetShapeTypeString(shape,type); aShape->NameType(type); - nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0"); + nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0"); } else - nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0"); - } + nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0"); + } else nameG = TCollection_AsciiString(name); diff --git a/src/GEOMContext/GEOMContext.cxx b/src/GEOMContext/GEOMContext.cxx index 210807916..aed81c294 100644 --- a/src/GEOMContext/GEOMContext.cxx +++ b/src/GEOMContext/GEOMContext.cxx @@ -84,6 +84,12 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop) GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels(); } + /* GetCurrentStudy */ + int studyId = desktop->getActiveStudy()->getStudyId(); + GeomGUI->myComponentGeom->GetCurrentStudy(studyId); + + //GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels(); + return GeomGUI; } diff --git a/src/GEOMContext/GEOMContext.h b/src/GEOMContext/GEOMContext.h index d31f1b6dc..f5746fc2f 100644 --- a/src/GEOMContext/GEOMContext.h +++ b/src/GEOMContext/GEOMContext.h @@ -49,12 +49,13 @@ public : private : QDialog* myActiveDialogBox; /* Unique active dialog box */ - int myNbGeom; /* Unique name for a geom entity */ GEOM_Client myShapeReader; Standard_CString myFatherior; Sketch mySketcher; public : + int myNbGeom; /* Unique name for a geom entity */ + static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop); static GEOMContext* GetGeomGUI(); diff --git a/src/GEOMContext/GEOM_msg_en.po b/src/GEOMContext/GEOM_msg_en.po index 1b91d57f8..34834bc66 100644 --- a/src/GEOMContext/GEOM_msg_en.po +++ b/src/GEOMContext/GEOM_msg_en.po @@ -662,6 +662,10 @@ msgstr "Vertex" msgid "GEOM_WIRE" msgstr "Wire" +#Wire(s) +msgid "GEOM_WIRES" +msgstr "Wire(s)" + #Parameter msgid "GEOM_PARAMETER" msgstr "Parameter :" @@ -937,6 +941,10 @@ msgstr "Keep Object" msgid "GEOM_PARTITION_ORIENTATION" msgstr "Change Orientation" +#: GeometryGUI_PartitionDlg.cxx:45 +msgid "SUPPRESS_RESULT" +msgstr "Suppress Result" + #: GeometryGUI_PipeDlg.cxx:47 msgid "GEOM_PIPE_TITLE" msgstr "Pipe Construction" @@ -1299,3 +1307,10 @@ msgstr "Values" msgid "GEOM_SKETCHER_TYPE" msgstr "Type" + +msgid "GEOM_FILLET_ABORT" +msgstr "Fillet can't be computed with radius %1" + +msgid "GEOM_CHAMFER_ABORT" +msgstr "Chamfer can't be computed with %1 and %2" + diff --git a/src/GEOMContext/GEOM_msg_fr.po b/src/GEOMContext/GEOM_msg_fr.po index fdeb94661..f502017f4 100644 --- a/src/GEOMContext/GEOM_msg_fr.po +++ b/src/GEOMContext/GEOM_msg_fr.po @@ -49,7 +49,7 @@ msgstr "&Exploser" #: GeometryGUI.cxx:563 msgid "GEOM_INF_LOADED" -msgstr "Le fichier %1 est chargé." +msgstr "Le fichier %1 est chargé." # #============================================================================== @@ -57,15 +57,15 @@ msgstr "Le fichier %1 est charg #: GeometryGUI.cxx:3069 msgid "GEOM_PRP_COMMAND" -msgstr "Pas de commande associée à l'id = %1." +msgstr "Pas de commande associée à l'id = %1." #: GeometryGUI.cxx:4977 msgid "GEOM_PRP_ABORT" -msgstr "L'opération a echoué" +msgstr "L'opération a echoué" #: GeometryGUI.cxx:5058 msgid "GEOM_PRP_DONE" -msgstr "Opération effectuée" +msgstr "Opération effectuée" #: GeometryGUI.cxx:3717 msgid "GEOM_PRP_LOADING" @@ -73,11 +73,11 @@ msgstr "Chargement de %1 ..." #: GeometryGUI.cxx:1412 msgid "GEOM_PRP_NULLSHAPE" -msgstr "Erreur, objet inconsistant ou inapproprié !" +msgstr "Erreur, objet inconsistant ou inapproprié !" #: GeometryGUI.cxx:5072 msgid "GEOM_PRP_READY" -msgstr "Prêt..." +msgstr "Prêt..." #: GeometryGUI.cxx:1690 msgid "GEOM_PRP_SELECT_SUBSHAPES" @@ -127,11 +127,11 @@ msgstr "Angle :" #: GeometryGUI.cxx:3941 msgid "GEOM_MEN_COMPONENT" -msgstr "Géometrie" +msgstr "Géometrie" #: GeometryGUI.cxx:4389 msgid "GEOM_MEN_ENTER_ANGLE" -msgstr "Saisir un angle en degrés" +msgstr "Saisir un angle en degrés" #: GeometryGUI.cxx:3758 msgid "GEOM_MEN_EXPORT" @@ -250,7 +250,7 @@ msgstr "Objet %1" #Object and result msgid "GEOM_OBJECT_RESULT" -msgstr "Objet Et Résultat" +msgstr "Objet Et Résultat" #Point msgid "GEOM_POINT" @@ -310,7 +310,7 @@ msgstr "poids" #Coordinates msgid "GEOM_COORDINATES" -msgstr "Coordonnées" +msgstr "Coordonnées" #Coor. msgid "GEOM_COOR" @@ -362,11 +362,11 @@ msgstr "Base" #Water Density msgid "GEOM_WATER_DENSITY" -msgstr "Densité de l'eau :" +msgstr "Densité de l'eau :" #Meshing Deflection msgid "GEOM_MESHING_DEFLECTION" -msgstr "Déflection Du Maillage :" +msgstr "Déflection Du Maillage :" #Dimensions msgid "GEOM_DIMENSIONS" @@ -374,11 +374,11 @@ msgstr "Dimensions" #Precision msgid "GEOM_PRECISION" -msgstr "Précision :" +msgstr "Précision :" #Selection msgid "GEOM_SELECTION" -msgstr "Sélection" +msgstr "Sélection" #Nb. Times msgid "GEOM_NB_TIMES" @@ -414,7 +414,7 @@ msgstr "Partition" #Tolerance msgid "GEOM_TOLERANCE" -msgstr "Tolérance" +msgstr "Tolérance" #Orientation msgid "GEOM_ORIENTATION" @@ -426,7 +426,7 @@ msgstr "Pipe" #Revolution msgid "GEOM_REVOLUTION" -msgstr "Révolution" +msgstr "Révolution" #Rotation msgid "GEOM_ROTATION" @@ -434,7 +434,7 @@ msgstr "Rotation" #Archimede msgid "GEOM_ARCHIMEDE" -msgstr "Archimède" +msgstr "Archimède" #Common msgid "GEOM_COMMON" @@ -594,7 +594,7 @@ msgstr "Solide" #Sphere msgid "GEOM_SPHERE" -msgstr "Sphère" +msgstr "Sphère" #Conical Face msgid "GEOM_SURFCONE" @@ -606,7 +606,7 @@ msgstr "Face Cylindrique" #Spherical Face msgid "GEOM_SURFSPHERE" -msgstr "Face Sphèrique" +msgstr "Face Sphèrique" #Toroidal Face msgid "GEOM_SURFTORUS" @@ -638,7 +638,7 @@ msgstr "Wire" #Parameter msgid "GEOM_PARAMETER" -msgstr "Paramètre :" +msgstr "Paramètre :" # @@ -691,7 +691,7 @@ msgstr "D2 :" #: GeometryGUI.cxx msgid "GEOM_STEP_TITLE" -msgstr "Increment par défaut lors des constructions" +msgstr "Increment par défaut lors des constructions" #: GeometryGUI_ArcDlg.cxx:45 msgid "GEOM_ARC_TITLE" @@ -699,7 +699,7 @@ msgstr "Construction d'un Arc" #: GeometryGUI_ArchimedeDlg.cxx:55 msgid "GEOM_ARCHIMEDE_TITLE" -msgstr "Construction d'Archimède" +msgstr "Construction d'Archimède" #: GeometryGUI_BndBoxDlg.cxx:59 msgid "GEOM_BNDBOX_TITLE" @@ -739,7 +739,7 @@ msgstr "Construction d'un Cercle" #: GeometryGUI_CenterMassDlg.cxx:77 msgid "GEOM_CMASS_TITLE" -msgstr "Centre De Gravité" +msgstr "Centre De Gravité" msgid "GEOM_PLANE_SIZE" msgstr "Taille du plan :" @@ -750,7 +750,7 @@ msgstr "BOOLEEN : Jonction De Deux Objets" #: GeometryGUI_CompoundDlg.cxx:44 msgid "GEOM_COMPOUND_TITLE" -msgstr "Création d'un Compound" +msgstr "Création d'un Compound" #: GeometryGUI_ConeDlg.cxx:49 msgid "GEOM_CONE_TITLE" @@ -782,27 +782,27 @@ msgstr "Objets Et Resultats" #: GeometryGUI_EdgeDlg.cxx:47 msgid "GEOM_EDGE_TITLE" -msgstr "Création d'un Edge" +msgstr "Création d'un Edge" #: GeometryGUI_FilletDlg.cxx:58 msgid "GEOM_FILLET_TITLE" -msgstr "Construction d'un Congé" +msgstr "Construction d'un Congé" #: GeometryGUI_FilletDlg.cxx:58 msgid "GEOM_FILLET_ALL" -msgstr "Congé sur toute la Shape" +msgstr "Congé sur toute la Shape" #: GeometryGUI_FilletDlg.cxx:58 msgid "GEOM_FILLET_EDGES" -msgstr "Congé sur Edges de la Shape" +msgstr "Congé sur Edges de la Shape" #: GeometryGUI_FilletDlg.cxx:58 msgid "GEOM_FILLET_FACES" -msgstr "Congé sur Faces de la Shape" +msgstr "Congé sur Faces de la Shape" #: GeometryGUI_FaceDlg.cxx:49 msgid "GEOM_FACE_TITLE" -msgstr "Création d'une Face" +msgstr "Création d'une Face" #: GeometryGUI_FaceDlg.cxx:78 msgid "GEOM_FACE_FFW" @@ -810,7 +810,7 @@ msgstr "Face a partir d'un wire" #: GeometryGUI_FaceDlg.cxx:103 msgid "GEOM_FACE_OPT" -msgstr "Création d'une Face plane" +msgstr "Création d'une Face plane" #: GeometryGUI_FillingDlg.cxx:53 msgid "GEOM_FILLING_TITLE" @@ -912,6 +912,10 @@ msgstr "Objet garde" msgid "GEOM_PARTITION_ORIENTATION" msgstr "Change l'orientation" +#: GeometryGUI_PartitionDlg.cxx:45 +msgid "SUPPRESS_RESULT" +msgstr "Suppress Result" + #: GeometryGUI_PipeDlg.cxx:47 msgid "GEOM_PIPE_TITLE" msgstr "Construction d'une Pipe" @@ -1115,7 +1119,7 @@ msgid "GEOM_MULTIROTATION_DOUBLE" msgstr "Multi Rotation Double" msgid "GEOM_PARAM_POINT" -msgstr "Point paramétrique" +msgstr "Point paramétrique" # #============================================================================== @@ -1127,4 +1131,11 @@ msgstr "Filaire" #: GeometryGUI.cxx:4613 msgid "GEOM_MEN_SHADING" -msgstr "Ombré" +msgstr "Ombré" + +msgid "GEOM_FILLET_ABORT" +msgstr "Le congé ne peut-être realisé avec un rayon de %1 " + +msgid "GEOM_CHAMFER_ABORT" +msgstr "Le chanfrein ne peut-être realisé avec %1 et %2 " + diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 357507e17..8180cf578 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -507,6 +507,7 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent) if(GeomGUI != 0) { QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar(); + GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels(); if(GeomGUI->myState == 2) { Mb->setItemEnabled(405, false);//SKETCHER GeomGUI->GetSketcher().Clear(); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index a977323fc..08a0e7d8c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -163,7 +163,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) } else { Quantity_Color Default = Quantity_Color(); - color = QColor ((int)Default.Red() * 255.0, (int)Default.Green()* 255.0, (int)Default.Blue() * 255.0); + color = QColor ((int)( Default.Red() * 255.0 ), (int)( Default.Green() * 255.0 ), (int)( Default.Blue() * 255.0 ) ); } QColor c = QColorDialog::getColor(color, QAD_Application::getDesktop()); @@ -372,7 +372,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) Quantity_Color CSFColor; Shape->Color(CSFColor); - QColor c = QColorDialog::getColor(QColor(CSFColor.Red() * 255.0, CSFColor.Green()* 255.0, CSFColor.Blue() * 255.0), QAD_Application::getDesktop()); + QColor c = QColorDialog::getColor(QColor((int)(CSFColor.Red() * 255.0), (int)(CSFColor.Green() * 255.0), (int)(CSFColor.Blue() * 255.0)), QAD_Application::getDesktop()); if(c.isValid()) { CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB); @@ -478,13 +478,50 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) while(useSubItems?anIter->More():!anAttr->_is_nil()) { if(!obj->FindAttribute(anAttr, "AttributeIOR") && obj->FindAttribute(anAttr, "AttributePersistentRef")) { - // load - Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM"); - if (!CORBA::is_nil(comp)) { - SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp); - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - aStudyBuilder->LoadWith(aStudy->FindComponent("GEOM"),driver); - } + + SALOMEDS::SComponent_var FComp = obj->GetFatherComponent(); + if (!CORBA::is_nil(FComp)) { + if (FComp->FindAttribute(anAttr, "AttributeName")) { + SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); + QString compName = parent->getComponentName(aName->Value()); + // parent->loadComponentData(parent->getComponentName(aName->Value())); + Engines::Component_var comp ; + if ( compName.compare("SUPERV") == 0 ) { + comp = parent->getEngine( "SuperVisionContainer", compName) ; + } + else { + comp = parent->getEngine( "FactoryServer", compName); + if ( comp->_is_nil() ) + comp = parent->getEngine( "FactoryServerPy", compName); + } + + if (!CORBA::is_nil(comp)) { + SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp); + if (!CORBA::is_nil(driver)) { + SALOMEDS::StudyBuilder_var B = aStudy->NewBuilder(); + if (!CORBA::is_nil(B)) { + B->LoadWith(FComp,driver); + } else { + return false; + } + } else { + MESSAGE("loadComponentData(): Driver is null"); + return false; + } + } else { + MESSAGE("loadComponentData(): Engine is null"); + return false; + } + // // load + // Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM"); + // if (!CORBA::is_nil(comp)) { + // SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp); + // SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + // SALOMEDS::SComponent_var SC = aStudy->FindComponent("GEOM"); + // if (!CORBA::is_nil(SC)) + // aStudyBuilder->LoadWith(SC,driver); + } + } else { MESSAGE("Component is null"); } @@ -752,7 +789,7 @@ bool GEOMToolsGUI::Import(int aState) // if (aLocked) return false; father->ComponentIOR(myGeomGUI->GetFatherior()); - QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++); + QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->myNbGeom++); if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) { QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) ); diff --git a/src/GEOM_SWIG/batchmode_geompy.py b/src/GEOM_SWIG/batchmode_geompy.py index 4bb742a89..1f0a4e5fb 100644 --- a/src/GEOM_SWIG/batchmode_geompy.py +++ b/src/GEOM_SWIG/batchmode_geompy.py @@ -152,6 +152,12 @@ def MakeCircle(p1,d1,radius): anObj._set_Name(ior) return anObj +def MakeEllipse(p1,d1,radiusMaj,radiusMin): + anObj = geom.MakeEllipse(p1,d1,radiusMaj, radiusMin) + ior = orb.object_to_string(anObj) + anObj._set_Name(ior) + return anObj + def MakePlane(p1,d1,trimsize): anObj = geom.MakePlane(p1,d1,trimsize) ior = orb.object_to_string(anObj) diff --git a/src/GEOM_SWIG/geompy.py b/src/GEOM_SWIG/geompy.py index 4746e7d62..93ef60c3b 100644 --- a/src/GEOM_SWIG/geompy.py +++ b/src/GEOM_SWIG/geompy.py @@ -178,6 +178,12 @@ def MakeCircle(p1,d1,radius): anObj._set_Name(ior) return anObj +def MakeEllipse(p1,d1,radiusMaj,radiusMin): + anObj = geom.MakeEllipse(p1,d1,radiusMaj, radiusMin) + ior = orb.object_to_string(anObj) + anObj._set_Name(ior) + return anObj + def MakePlane(p1,d1,trimsize): anObj = geom.MakePlane(p1,d1,trimsize) ior = salome.orb.object_to_string(anObj) diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 968e4df57..fc32ef980 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -172,6 +172,7 @@ void GenerationGUI_FillingDlg::ClickOnOk() //================================================================================= void GenerationGUI_FillingDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx index dae7c23f6..d1bc9969e 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx @@ -187,7 +187,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument() } else if(myEditCurrentArgument == GroupPoints->LineEdit2) { myOkShape2 = false; - if(S.ShapeType() != TopAbs_COMPSOLID && S.ShapeType() != TopAbs_COMPOUND && S.ShapeType() != TopAbs_SOLID && S.ShapeType() != TopAbs_SHAPE && S.ShapeType() != TopAbs_VERTEX) { + if(S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) { myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult); if(!testResult) return; diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index f2b9ea58f..b9c8057ec 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -146,6 +146,7 @@ void GenerationGUI_PrismDlg::ClickOnOk() //================================================================================= void GenerationGUI_PrismDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index 79e7e1bac..69d69205c 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -145,6 +145,7 @@ void GenerationGUI_RevolDlg::ClickOnOk() //================================================================================= void GenerationGUI_RevolDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx index 23c2895c3..6c3f1a91c 100644 --- a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx @@ -37,6 +37,8 @@ using namespace std; #include +#include + //================================================================================= // class : MeasureGUI_WhatisDlg() // purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the @@ -211,8 +213,15 @@ void MeasureGUI_WhatisDlg::CalculateWhatis(const TopoDS_Shape& S) return; TCollection_AsciiString Astr; - Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n"; + if ( S.ShapeType() == TopAbs_EDGE ) { + if( BRep_Tool::Degenerated(TopoDS::Edge(S)) ) { + Astr = Astr + " " + strdup(SelectedName.latin1()) + " is a degenerated edge \n"; + } + } + + Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n"; + try { int iType, nbTypes [TopAbs_SHAPE]; for(iType = 0; iType < TopAbs_SHAPE; ++iType) diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 77468ea95..7e272e91d 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -152,6 +152,7 @@ void OperationGUI_ArchimedeDlg::ClickOnOk() //================================================================================= void OperationGUI_ArchimedeDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if(myOkIO) myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection); diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 92085d229..3698d3ffa 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -30,6 +30,7 @@ using namespace std; #include "OperationGUI_ChamferDlg.h" #include "DisplayGUI.h" +#include "QAD_MessageBox.h" #include #include @@ -38,6 +39,9 @@ using namespace std; #include #include +#include +#include + //================================================================================= // class : OperationGUI_ChamferDlg() // purpose : Constructs a OperationGUI_ChamferDlg which is a child of 'parent', with the @@ -68,23 +72,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg(QWidget* parent, const char* na Group1->TextLabel3->setText(tr("GEOM_D2")); Group1->PushButton1->setPixmap(image3); - Group2 = new DlgRef_1Sel2Spin(this, "Group2"); - Group2->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES")); - Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); - Group2->TextLabel2->setText(tr("GEOM_D1")); - Group2->TextLabel3->setText(tr("GEOM_D2")); - Group2->PushButton1->setPixmap(image3); - - Group3 = new DlgRef_1Sel2Spin(this, "Group3"); - Group3->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES")); - Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); - Group3->TextLabel2->setText(tr("GEOM_D1")); - Group3->TextLabel3->setText(tr("GEOM_D2")); - Group3->PushButton1->setPixmap(image3); - Layout1->addWidget(Group1, 1, 0); - Layout1->addWidget(Group2, 1, 0); - Layout1->addWidget(Group3, 1, 0); /***************************************************************/ /* Initialisations */ @@ -123,18 +111,10 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic) double SpecificStep = 10.0; /* min, max, step and decimals for spin boxes */ Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); Group1->SpinBox_DX->SetValue(myD1); - Group2->SpinBox_DX->SetValue(myD1); - Group3->SpinBox_DX->SetValue(myD1); Group1->SpinBox_DY->SetValue(myD2); - Group2->SpinBox_DY->SetValue(myD2); - Group3->SpinBox_DY->SetValue(myD2); /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); @@ -146,32 +126,16 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic) connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double))); connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DY, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* displays Dialog */ - Group2->hide(); - Group3->hide(); Group1->show(); this->show(); @@ -200,52 +164,33 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId) myUseLocalContext = false; } + if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) { + myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC + RadioButton1->setChecked(TRUE); + } + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + Group1->LineEdit1->setText(""); + Group1->SpinBox_DX->SetValue(myD1); + Group1->SpinBox_DY->SetValue(myD2); switch (constructorId) { case 0: /* Chamfer All */ { - Group2->hide(); - Group3->hide(); - resize(0, 0); - Group1->show(); - - myEditCurrentArgument = Group1->LineEdit1; - Group1->LineEdit1->setText(""); + Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_ALL")); myShapeType = -1; - - Group1->SpinBox_DX->SetValue(myD1); - Group1->SpinBox_DY->SetValue(myD2); break; } case 1: /* Chamfer edges */ { - Group1->hide(); - Group3->hide(); - resize(0, 0); - Group2->show(); - - myEditCurrentArgument = Group2->LineEdit1; - Group2->LineEdit1->setText(""); + Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES")); myShapeType = 6; - - Group2->SpinBox_DX->SetValue(myD1); - Group2->SpinBox_DY->SetValue(myD2); break; } case 2: /* Chamfer Faces */ { - Group1->hide(); - Group2->hide(); - resize(0, 0); - Group3->show(); - - myEditCurrentArgument = Group3->LineEdit1; - Group3->LineEdit1->setText(""); + Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES")); myShapeType = 4; - - Group3->SpinBox_DX->SetValue(myD1); - Group3->SpinBox_DY->SetValue(myD2); break; } } @@ -271,6 +216,7 @@ void OperationGUI_ChamferDlg::ClickOnOk() //================================================================================= void OperationGUI_ChamferDlg::ClickOnApply() { + buttonApply->setFocus(); QApplication::setOverrideCursor(Qt::waitCursor); QAD_Application::getDesktop()->putInfo(tr("")); myGeomBase->EraseSimulationShape(); @@ -372,7 +318,7 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() } } } - if(myConstructorId == 0) + if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0) this->MakePreview(); } @@ -388,27 +334,6 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() } -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void OperationGUI_ChamferDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == Group1->LineEdit1) - myEditCurrentArgument = Group1->LineEdit1; - else if (send == Group2->LineEdit1) - myEditCurrentArgument = Group2->LineEdit1; - else if (send == Group3->LineEdit1) - myEditCurrentArgument = Group3->LineEdit1; - else - return; - - GEOMBase_Skeleton::LineEditReturnPressed(); - return; -} - - //================================================================================= // function : SetEditCurrentArgument() // purpose : @@ -417,18 +342,9 @@ void OperationGUI_ChamferDlg::SetEditCurrentArgument() { QPushButton* send = (QPushButton*)sender(); - if(send == Group1->PushButton1) { + if(send == Group1->PushButton1) Group1->LineEdit1->setFocus(); - myEditCurrentArgument = Group1->LineEdit1; - } - else if(send == Group2->PushButton1) { - Group2->LineEdit1->setFocus(); - myEditCurrentArgument = Group2->LineEdit1; - } - else if(send == Group3->PushButton1) { - Group3->LineEdit1->setFocus(); - myEditCurrentArgument = Group3->LineEdit1; - } + this->SelectionIntoArgument(); return; } @@ -489,24 +405,20 @@ void OperationGUI_ChamferDlg::closeEvent(QCloseEvent* e) // function : ValueChangedInSpinBox() // purpose : //================================================================================= -void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue ) +void OperationGUI_ChamferDlg::ValueChangedInSpinBox(double newValue) { myGeomBase->EraseSimulationShape(); mySimulationTopoDs.Nullify(); QObject* send = (QObject*)sender(); - if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */ + if(send == Group1->SpinBox_DX) /* D1 */ myD1 = newValue; - if(myConstructorId == 0) - this->MakePreview(); - return ; - } - else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */ + else if(send == Group1->SpinBox_DY) /* D2 */ myD2 = newValue; - if(myConstructorId == 0) - this->MakePreview(); - return; - } + + if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0) + this->MakePreview(); + return; } @@ -539,48 +451,44 @@ void OperationGUI_ChamferDlg::ResetStateOfDialog() void OperationGUI_ChamferDlg::MakePreview() { QApplication::setOverrideCursor(Qt::waitCursor); - - if(!myOkShape) { - QApplication::restoreOverrideCursor(); - return; - } - - GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID; - ListOfID->length(0); - - SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR); - if(theObj->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")); - QApplication::restoreOverrideCursor(); - return; - } + TopoDS_Shape tds; try { - if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) { - QApplication::restoreOverrideCursor(); - return; - } + BRepFilletAPI_MakeChamfer MC(myShape); + switch(myConstructorId) + { + case 0: /* Chamfer All */ + { + TopTools_IndexedDataMapOfShapeListOfShape M; + TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, M); + for(int i = 1; i <= M.Extent(); i++) { + TopoDS_Edge E = TopoDS::Edge(M.FindKey(i)); + TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First()); + if(!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E)) + MC.Add(myD1, myD2, E, F); + } + tds = MC.Shape(); + break; + } + // case 1: /* Chamfer edges */ + // case 2: /* Chamfer Faces */ + } - GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR); - GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, myD1, myD2, myShapeType, ListOfID); - if(result->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - QApplication::restoreOverrideCursor(); - return; + if(!tds.IsNull()) { + mySimulationTopoDs = tds; + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); } - - TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result); - - mySimulationTopoDs = S; - myGeomBase->DisplaySimulationShape(mySimulationTopoDs); } catch(Standard_Failure) { - MESSAGE("Exception catched in MakePreview"); QApplication::restoreOverrideCursor(); - return; + QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK")); + QApplication::setOverrideCursor(Qt::waitCursor); + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + Group1->SpinBox_DX->SetValue(5.0); + Group1->SpinBox_DY->SetValue(5.0); } + QApplication::restoreOverrideCursor(); return; - } diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.h b/src/OperationGUI/OperationGUI_ChamferDlg.h index 46e114443..320bc37c9 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.h +++ b/src/OperationGUI/OperationGUI_ChamferDlg.h @@ -72,8 +72,6 @@ private : double myD2; DlgRef_1Sel2Spin* Group1; - DlgRef_1Sel2Spin* Group2; - DlgRef_1Sel2Spin* Group3; private slots: void ClickOnOk(); @@ -81,7 +79,6 @@ private slots: void ClickOnCancel(); void ActivateThisDialog(); void DeactivateActiveDialog(); - void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void ValueChangedInSpinBox(double newValue); diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 746c9eb08..75827e00e 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -30,12 +30,16 @@ using namespace std; #include "OperationGUI_FilletDlg.h" #include "DisplayGUI.h" +#include "QAD_MessageBox.h" #include #include #include #include +#include +#include + //================================================================================= // class : OperationGUI_FilletDlg() // purpose : Constructs a OperationGUI_FilletDlg which is a child of 'parent', with the @@ -65,21 +69,7 @@ OperationGUI_FilletDlg::OperationGUI_FilletDlg(QWidget* parent, const char* name Group1->TextLabel2->setText(tr("GEOM_RADIUS")); Group1->PushButton1->setPixmap(image3); - Group2 = new DlgRef_1Sel1Spin(this, "Group2"); - Group2->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES")); - Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); - Group2->TextLabel2->setText(tr("GEOM_RADIUS")); - Group2->PushButton1->setPixmap(image3); - - Group3 = new DlgRef_1Sel1Spin(this, "Group3"); - Group3->GroupBox1->setTitle(tr("GEOM_FILLET_FACES")); - Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); - Group3->TextLabel2->setText(tr("GEOM_RADIUS")); - Group3->PushButton1->setPixmap(image3); - Layout1->addWidget(Group1, 1, 0); - Layout1->addWidget(Group2, 1, 0); - Layout1->addWidget(Group3, 1, 0); /***************************************************************/ /* Initialisations */ @@ -117,12 +107,7 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic) double SpecificStep = 10.0; /* min, max, step and decimals for spin boxes */ Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group1->SpinBox_DX->SetValue(myRadius); - Group2->SpinBox_DX->SetValue(myRadius); - Group3->SpinBox_DX->SetValue(myRadius); /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); @@ -134,26 +119,14 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic) connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* displays Dialog */ - Group2->hide(); - Group3->hide(); Group1->show(); this->show(); @@ -181,49 +154,32 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId) myUseLocalContext = false; } + if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) { + myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC + RadioButton1->setChecked(TRUE); + } + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + Group1->LineEdit1->setText(""); + Group1->SpinBox_DX->SetValue(myRadius); switch (constructorId) { case 0: /* Fillet All */ { - Group2->hide(); - Group3->hide(); - resize(0, 0); - Group1->show(); - - myEditCurrentArgument = Group1->LineEdit1; - Group1->LineEdit1->setText(""); + Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL")); myShapeType = -1; - - Group1->SpinBox_DX->SetValue(myRadius); break; } case 1: /* Fillet edges */ { - Group1->hide(); - Group3->hide(); - resize(0, 0); - Group2->show(); - - myEditCurrentArgument = Group2->LineEdit1; - Group2->LineEdit1->setText(""); + Group1->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES")); myShapeType = 6; - - Group2->SpinBox_DX->SetValue(myRadius); break; } case 2: /* Fillet Faces */ { - Group1->hide(); - Group2->hide(); - resize(0, 0); - Group3->show(); - - myEditCurrentArgument = Group3->LineEdit1; - Group3->LineEdit1->setText(""); + Group1->GroupBox1->setTitle(tr("GEOM_FILLET_FACES")); myShapeType = 4; - - Group3->SpinBox_DX->SetValue(myRadius); break; } } @@ -249,6 +205,7 @@ void OperationGUI_FilletDlg::ClickOnOk() //================================================================================= void OperationGUI_FilletDlg::ClickOnApply() { + buttonApply->setFocus(); QApplication::setOverrideCursor(Qt::waitCursor); QAD_Application::getDesktop()->putInfo(tr("")); myGeomBase->EraseSimulationShape(); @@ -348,7 +305,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() } } } - if(myConstructorId == 0) + if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0) this->MakePreview(); } else @@ -363,27 +320,6 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() } -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void OperationGUI_FilletDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == Group1->LineEdit1) - myEditCurrentArgument = Group1->LineEdit1; - else if (send == Group2->LineEdit1) - myEditCurrentArgument = Group2->LineEdit1; - else if (send == Group3->LineEdit1) - myEditCurrentArgument = Group3->LineEdit1; - else - return; - - GEOMBase_Skeleton::LineEditReturnPressed(); - return; -} - - //================================================================================= // function : SetEditCurrentArgument() // purpose : @@ -392,18 +328,9 @@ void OperationGUI_FilletDlg::SetEditCurrentArgument() { QPushButton* send = (QPushButton*)sender(); - if(send == Group1->PushButton1) { + if(send == Group1->PushButton1) Group1->LineEdit1->setFocus(); - myEditCurrentArgument = Group1->LineEdit1; - } - else if(send == Group2->PushButton1) { - Group2->LineEdit1->setFocus(); - myEditCurrentArgument = Group2->LineEdit1; - } - else if(send == Group3->PushButton1) { - Group3->LineEdit1->setFocus(); - myEditCurrentArgument = Group3->LineEdit1; - } + this->SelectionIntoArgument(); return; } @@ -492,7 +419,7 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue) myRadius = newValue; - if(myConstructorId == 0) + if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0) this->MakePreview(); return; } @@ -505,46 +432,57 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue) void OperationGUI_FilletDlg::MakePreview() { QApplication::setOverrideCursor(Qt::waitCursor); + TopoDS_Shape tds; - if(!myOkShape) { - QApplication::restoreOverrideCursor(); - return; - } - - GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID; - ListOfID->length(0); - - SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR); - if(theObj->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")); - QApplication::restoreOverrideCursor(); - return; - } - try { - if(myRadius <= Precision::Confusion()) { - QApplication::restoreOverrideCursor(); - return; - } + BRepFilletAPI_MakeFillet fill(myShape); + switch(myConstructorId) + { + case 0: /* Fillet All */ + { + TopExp_Explorer Exp(myShape, TopAbs_EDGE); + for(Exp; Exp.More(); Exp.Next()) { + TopoDS_Edge E = TopoDS::Edge(Exp.Current()); + fill.Add(E); + } + + for(int i = 1; i <= fill.NbContours(); i++) { + try { + //fill.SetRadius(myRadius,i,i); + fill.SetRadius(myRadius,i); + } + catch(Standard_Failure) { + QApplication::restoreOverrideCursor(); + QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK")); + QApplication::setOverrideCursor(Qt::waitCursor); + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + Group1->SpinBox_DX->SetValue(5.0); + QApplication::restoreOverrideCursor(); + return; + } + } + tds = fill.Shape(); + break; + } + // case 1: /* Fillet edges */ + // case 2: /* Fillet Faces */ + } - GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR); - GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, myRadius, myShapeType, ListOfID); - if(result->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - QApplication::restoreOverrideCursor(); - return; + if(!tds.IsNull()) { + mySimulationTopoDs = tds; + myGeomBase->DisplaySimulationShape(mySimulationTopoDs); } - TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result); - - mySimulationTopoDs = S; - myGeomBase->DisplaySimulationShape(mySimulationTopoDs); - } + } catch(Standard_Failure) { - MESSAGE("Exception catched in MakePreview"); QApplication::restoreOverrideCursor(); - return; + QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK")); + QApplication::setOverrideCursor(Qt::waitCursor); + myGeomBase->EraseSimulationShape(); + mySimulationTopoDs.Nullify(); + Group1->SpinBox_DX->SetValue(5.0); } + QApplication::restoreOverrideCursor(); return; } diff --git a/src/OperationGUI/OperationGUI_FilletDlg.h b/src/OperationGUI/OperationGUI_FilletDlg.h index 76fbab6f5..3756f82b2 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.h +++ b/src/OperationGUI/OperationGUI_FilletDlg.h @@ -71,8 +71,6 @@ private : double myRadius; DlgRef_1Sel1Spin* Group1; - DlgRef_1Sel1Spin* Group2; - DlgRef_1Sel1Spin* Group3; private slots: void ClickOnOk(); @@ -80,7 +78,6 @@ private slots: void ClickOnCancel(); void ActivateThisDialog(); void DeactivateActiveDialog(); - void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void ValueChangedInSpinBox(double newValue); diff --git a/src/PrimitiveGUI/PrimitiveGUI.cxx b/src/PrimitiveGUI/PrimitiveGUI.cxx index 343759a6a..e28c3f6f6 100644 --- a/src/PrimitiveGUI/PrimitiveGUI.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI.cxx @@ -216,14 +216,17 @@ void PrimitiveGUI::MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir, const double Radius1, const double Radius2, const double aHeight) { try { - if((Radius1 <= Precision::Confusion() && Radius2 <= Precision::Confusion()) || aHeight <= Precision::Confusion()) + double myRadius2 = Radius2; + if(myRadius2 < Precision::Confusion()) + myRadius2 = Precision::Confusion(); + if(Radius1 <= Precision::Confusion() || aHeight <= Precision::Confusion()) return; GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z()); GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z()); GEOM::DirStruct dstruct = myGeom->MakeDirection(d); - GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight); + GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, myRadius2, aHeight); if(result->_is_nil()) { QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT")); return; diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 39e12f88c..24b638432 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -221,6 +221,7 @@ void PrimitiveGUI_BoxDlg::ClickOnOk() //================================================================================= void PrimitiveGUI_BoxDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 480eca52d..641feabfe 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -120,11 +120,11 @@ void PrimitiveGUI_ConeDlg::Init() step = St.toDouble(); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3); GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3); GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupPoints->SpinBox_DX->SetValue(myRadius1); @@ -247,6 +247,7 @@ void PrimitiveGUI_ConeDlg::ClickOnOk() //================================================================================= void PrimitiveGUI_ConeDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 0826eef58..4eaf7d976 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -234,6 +234,7 @@ void PrimitiveGUI_CylinderDlg::ClickOnOk() //================================================================================= void PrimitiveGUI_CylinderDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index a26177ca1..d13352dc2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -205,6 +205,7 @@ void PrimitiveGUI_SphereDlg::ClickOnOk() //================================================================================= void PrimitiveGUI_SphereDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if(mySimulationTopoDs.IsNull()) return; diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index e67d4ae54..3a2c44ff9 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -102,7 +102,6 @@ void PrimitiveGUI_TorusDlg::Init() myRadius1 = 300.0; myRadius2 = 100.0; - myOkRadius1 = myOkRadius2 = true; myOkPoint1 = myOkDir = false; myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom); @@ -167,7 +166,6 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId) mySelection->ClearFilters(); myGeomBase->EraseSimulationShape(); disconnect(mySelection, 0, this, 0); - myOkRadius1 = myOkRadius2 = true; myRadius1 = 300.0; myRadius2 = 100.0; @@ -230,13 +228,14 @@ void PrimitiveGUI_TorusDlg::ClickOnOk() //================================================================================= void PrimitiveGUI_TorusDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; myGeomBase->EraseSimulationShape(); mySimulationTopoDs.Nullify(); - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 ) + if(myOkPoint1 && myOkDir) myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2); return ; } @@ -278,7 +277,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument() myOkDir = true; } - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2) + if(myOkPoint1 && myOkDir) MakeTorusSimulationAndDisplay(); return; } @@ -374,15 +373,23 @@ void PrimitiveGUI_TorusDlg::ValueChangedInSpinBox(double newValue) QObject* send = (QObject*)sender(); if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) { - myRadius1 = newValue; - myOkRadius1 = true; + if(newValue > myRadius2) + myRadius1 = newValue; + else { + GroupPoints->SpinBox_DX->SetValue(myRadius1); + GroupDimensions->SpinBox_DX->SetValue(myRadius1); + } } else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) { - myRadius2 = newValue; - myOkRadius2 = true; + if(newValue < myRadius1) + myRadius2 = newValue; + else { + GroupPoints->SpinBox_DY->SetValue(myRadius2); + GroupDimensions->SpinBox_DY->SetValue(myRadius2); + } } - if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2) + if(myOkPoint1 && myOkDir) MakeTorusSimulationAndDisplay(); return; } diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h index 2eb3b32b5..84068f432 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h @@ -72,8 +72,6 @@ private: Standard_Real myRadius1; Standard_Real myRadius2; - bool myOkRadius1; - bool myOkRadius2; DlgRef_2Sel2Spin* GroupPoints; DlgRef_2Spin* GroupDimensions; diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index 0c456bdd7..b13756881 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -311,11 +311,11 @@ bool RepairGUI::OnSuppressFaces(const TopoDS_Shape& ShapeTopo, const char* Shape Standard_CString Type; if(myGeomBase->GetShapeTypeString(S, Type)) { aShellOrFace->NameType(Type); - sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++); + sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++); } else { aShellOrFace->NameType(tr("GEOM_SHAPE")); - sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++); + sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); } /* Display with name */ diff --git a/src/RepairGUI/RepairGUI_OrientationDlg.cxx b/src/RepairGUI/RepairGUI_OrientationDlg.cxx index 7b877f19e..6571d351c 100644 --- a/src/RepairGUI/RepairGUI_OrientationDlg.cxx +++ b/src/RepairGUI/RepairGUI_OrientationDlg.cxx @@ -140,6 +140,7 @@ void RepairGUI_OrientationDlg::ClickOnOk() //================================================================================= void RepairGUI_OrientationDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index 2cc0e2066..d36dedea0 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -134,6 +134,7 @@ void RepairGUI_SewingDlg::ClickOnOk() //================================================================================= void RepairGUI_SewingDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if(myOkListShapes) myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision); diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index 6a968659c..ef5b63648 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -131,6 +131,7 @@ void TransformationGUI_MirrorDlg::ClickOnOk() //================================================================================= void TransformationGUI_MirrorDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index c347d7256..479bd0116 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -258,6 +258,7 @@ void TransformationGUI_MultiRotationDlg::ClickOnOk() //================================================================================= void TransformationGUI_MultiRotationDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; @@ -429,13 +430,13 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox(double newValue) QObject* send = (QObject*)sender(); if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1) - myNbTimes1 = newValue; + myNbTimes1 = (int)newValue; else if(send == GroupDimensions->SpinBox_DX1) myAng = newValue; else if(send == GroupDimensions->SpinBox_DX2) myStep = newValue; else if(send == GroupDimensions->SpinBox_DY2) - myNbTimes2 = newValue; + myNbTimes2 = (int)newValue; if(myOkBase && myOkDir) this->MakeMultiRotationSimulationAndDisplay(); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index 5e89231e2..39646b6e3 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -269,6 +269,7 @@ void TransformationGUI_MultiTranslationDlg::ClickOnOk() //================================================================================= void TransformationGUI_MultiTranslationDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; @@ -488,7 +489,7 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu if(send == GroupPoints->SpinBox_DX) myStep1 = newValue; else if(send == GroupPoints->SpinBox_DY) - myNbTimes1 = newValue; + myNbTimes1 = (int)newValue; if(myOkBase && myOkDir1) this->MakeMultiTranslationSimulationAndDisplay(); break; @@ -498,11 +499,11 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu if(send == GroupDimensions->SpinBox_DX1) myStep1 = newValue; else if(send == GroupDimensions->SpinBox_DY1) - myNbTimes1 = newValue; + myNbTimes1 = (int)newValue; else if(send == GroupDimensions->SpinBox_DX2) myStep2 = newValue; else if(send == GroupDimensions->SpinBox_DY2) - myNbTimes2 = newValue; + myNbTimes2 = (int)newValue; if(myOkBase && myOkDir1 && myOkDir2) this->MakeMultiTranslationSimulationAndDisplay(); break; diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 4c410e4c4..6fefe1d78 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -142,6 +142,7 @@ void TransformationGUI_RotationDlg::ClickOnOk() //================================================================================= void TransformationGUI_RotationDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index 6f408cff1..3edcbf8b0 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -140,6 +140,7 @@ void TransformationGUI_ScaleDlg::ClickOnOk() //================================================================================= void TransformationGUI_ScaleDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 46778b0c7..2a38b49eb 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -148,6 +148,7 @@ void TransformationGUI_TranslationDlg::ClickOnOk() //================================================================================= void TransformationGUI_TranslationDlg::ClickOnApply() { + buttonApply->setFocus(); QAD_Application::getDesktop()->putInfo(tr("")); if (mySimulationTopoDs.IsNull()) return; -- 2.39.2