DCQ : Merge PAL + Debug

This commit is contained in:
dcq 2004-04-05 09:15:16 +00:00
parent 10f156c322
commit d89a4ce016
49 changed files with 341 additions and 371 deletions

View File

@ -137,6 +137,7 @@ void BasicGUI_ArcDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_ArcDlg::ClickOnApply() void BasicGUI_ArcDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -147,6 +147,7 @@ void BasicGUI_CircleDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_CircleDlg::ClickOnApply() void BasicGUI_CircleDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -153,6 +153,7 @@ void BasicGUI_EllipseDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_EllipseDlg::ClickOnApply() void BasicGUI_EllipseDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -135,6 +135,7 @@ void BasicGUI_LineDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_LineDlg::ClickOnApply() void BasicGUI_LineDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -273,6 +273,7 @@ void BasicGUI_PlaneDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_PlaneDlg::ClickOnApply() void BasicGUI_PlaneDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -259,6 +259,7 @@ void BasicGUI_PointDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_PointDlg::ClickOnApply() void BasicGUI_PointDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull()) if(mySimulationTopoDs.IsNull())
return; return;

View File

@ -237,6 +237,7 @@ void BasicGUI_VectorDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_VectorDlg::ClickOnApply() void BasicGUI_VectorDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -127,6 +127,7 @@ void BasicGUI_WorkingPlaneDlg::ClickOnOk()
//================================================================================= //=================================================================================
void BasicGUI_WorkingPlaneDlg::ClickOnApply() void BasicGUI_WorkingPlaneDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkPlane) if(myOkPlane)
myBasicGUI->MakeWorkingPlane(myLoc, myDir); myBasicGUI->MakeWorkingPlane(myLoc, myDir);

View File

@ -52,8 +52,8 @@ BooleanGUI_CutDlg::BooleanGUI_CutDlg(QWidget* parent, const char* name, BooleanG
GroupCut = new DlgRef_2Sel_QTD(this, "GroupCut"); GroupCut = new DlgRef_2Sel_QTD(this, "GroupCut");
GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupCut->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1")); GroupCut->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
GroupCut->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2")); GroupCut->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupCut->PushButton1->setPixmap(image1); GroupCut->PushButton1->setPixmap(image1);
GroupCut->PushButton2->setPixmap(image1); GroupCut->PushButton2->setPixmap(image1);

View File

@ -52,7 +52,7 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg(QWidget* parent, const char* name, BuildGUI*
GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints"); GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_FACE_FFW")); 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->CheckButton1->setText(tr("GEOM_FACE_OPT"));
GroupPoints->PushButton1->setPixmap(image1); GroupPoints->PushButton1->setPixmap(image1);

View File

@ -87,7 +87,7 @@ void BuildGUI_ShellDlg::Init()
myEditCurrentArgument = GroupShell->LineEdit1; myEditCurrentArgument = GroupShell->LineEdit1;
myOkListShapes = false; myOkListShapes = false;
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom); myFaceFilter = new GEOM_ShapeTypeFilter(TopAbs_FACE, myGeom);
/* Filter for the next selection */ /* Filter for the next selection */
mySelection->AddFilter(myFaceFilter) ; mySelection->AddFilter(myFaceFilter) ;
@ -163,10 +163,8 @@ void BuildGUI_ShellDlg::SelectionIntoArgument()
//================================================================================= //=================================================================================
void BuildGUI_ShellDlg::SetEditCurrentArgument() void BuildGUI_ShellDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); mySelection->ClearFilters();
mySelection->ClearFilters() ;
GroupShell->LineEdit1->setFocus(); GroupShell->LineEdit1->setFocus();
myEditCurrentArgument = GroupShell->LineEdit1;
mySelection->AddFilter(myFaceFilter); mySelection->AddFilter(myFaceFilter);
this->SelectionIntoArgument(); this->SelectionIntoArgument();
return; return;

View File

@ -34,7 +34,7 @@
#include "BuildGUI.h" #include "BuildGUI.h"
#include "GEOM_FaceFilter.hxx" #include "GEOM_ShapeTypeFilter.hxx"
//================================================================================= //=================================================================================
// class : BuildGUI_ShellDlg // class : BuildGUI_ShellDlg
@ -54,7 +54,7 @@ private:
BuildGUI* myBuildGUI; BuildGUI* myBuildGUI;
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */ Handle(GEOM_ShapeTypeFilter) myFaceFilter; /* Filters selection */
GEOM::GEOM_Gen::ListOfIOR myListShapes; GEOM::GEOM_Gen::ListOfIOR myListShapes;
bool myOkListShapes; /* to check when arguments is defined */ bool myOkListShapes; /* to check when arguments is defined */
@ -64,7 +64,6 @@ private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnApply(); void ClickOnApply();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void LineEditReturnPressed();
void SelectionIntoArgument(); void SelectionIntoArgument();
void ActivateThisDialog(); void ActivateThisDialog();

View File

@ -579,7 +579,7 @@ bool EntityGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shap
} }
else { else {
aResult->NameType(tr("GEOM_SHAPE")); 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()); SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
@ -814,7 +814,7 @@ bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char*
} }
else { else {
aResult->NameType(tr("GEOM_SHAPE")); 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); result = new GEOM_AISShape(Exp.Current(), nameG);
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
@ -823,10 +823,10 @@ bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char*
else { else {
if ( myGeomBase->GetShapeTypeString(compound,Type)) { if ( myGeomBase->GetShapeTypeString(compound,Type)) {
aResult->NameType(Type); aResult->NameType(Type);
sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++); sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++);
} else { } else {
aResult->NameType(tr("GEOM_SHAPE")); 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); result = new GEOM_AISShape(compound, nameG);
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");

View File

@ -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) { SALOMEDS::TMPFile* GEOM_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
// Declare a sequence of the byte to store the copied object // 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 // Try to get GEOM_Shape object by given SObject
SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::GenericAttribute_var anAttr;
@ -911,7 +911,15 @@ void GEOM_Gen_i::InsertInLabelMoreArguments(TopoDS_Shape main_topo,
//================================================================================= //=================================================================================
CORBA::Short GEOM_Gen_i::NbLabels() 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() ; return listOfGeomShapes._retn() ;
} }
//================================================================================= //=================================================================================
// function : MakeBoolean() // function : MakeBoolean()
// purpose : Boolean operation according to the type 'operation' // 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 shape ;
TopoDS_Shape aShape1 ; TopoDS_Shape aShape1 ;
TopoDS_Shape aShape2 ; TopoDS_Shape aShape2 ;
try { try {
aShape1 = GetTopoShape(shape1) ; aShape1 = GetTopoShape(shape1) ;
aShape2 = GetTopoShape(shape2) ; aShape2 = GetTopoShape(shape2) ;
@ -3598,6 +3605,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeVertex(CORBA::Double x,
if (tds.IsNull()) { if (tds.IsNull()) {
THROW_SALOME_CORBA_EXCEPTION("Make Vertex/Point aborted", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Make Vertex/Point aborted", SALOME::BAD_PARAM);
} }
tds.Infinite(true);
result = CreateObject(tds) ; result = CreateObject(tds) ;
const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ; const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
result->ShapeId(entry); 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); THROW_SALOME_CORBA_EXCEPTION("Make Line aborted : null shape", SALOME::BAD_PARAM);
} }
else { else {
tds.Infinite(true);
result = CreateObject(tds) ; result = CreateObject(tds) ;
const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ; const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
result->ShapeId(entry); result->ShapeId(entry);

View File

@ -506,11 +506,11 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
Standard_CString type; Standard_CString type;
GetShapeTypeString(shape,type); GetShapeTypeString(shape,type);
aShape->NameType(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 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 else
nameG = TCollection_AsciiString(name); nameG = TCollection_AsciiString(name);

View File

@ -84,6 +84,12 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels(); GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
} }
/* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
//GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
return GeomGUI; return GeomGUI;
} }

View File

@ -49,12 +49,13 @@ public :
private : private :
QDialog* myActiveDialogBox; /* Unique active dialog box */ QDialog* myActiveDialogBox; /* Unique active dialog box */
int myNbGeom; /* Unique name for a geom entity */
GEOM_Client myShapeReader; GEOM_Client myShapeReader;
Standard_CString myFatherior; Standard_CString myFatherior;
Sketch mySketcher; Sketch mySketcher;
public : public :
int myNbGeom; /* Unique name for a geom entity */
static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop); static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop);
static GEOMContext* GetGeomGUI(); static GEOMContext* GetGeomGUI();

View File

@ -662,6 +662,10 @@ msgstr "Vertex"
msgid "GEOM_WIRE" msgid "GEOM_WIRE"
msgstr "Wire" msgstr "Wire"
#Wire(s)
msgid "GEOM_WIRES"
msgstr "Wire(s)"
#Parameter #Parameter
msgid "GEOM_PARAMETER" msgid "GEOM_PARAMETER"
msgstr "Parameter :" msgstr "Parameter :"
@ -937,6 +941,10 @@ msgstr "Keep Object"
msgid "GEOM_PARTITION_ORIENTATION" msgid "GEOM_PARTITION_ORIENTATION"
msgstr "Change Orientation" msgstr "Change Orientation"
#: GeometryGUI_PartitionDlg.cxx:45
msgid "SUPPRESS_RESULT"
msgstr "Suppress Result"
#: GeometryGUI_PipeDlg.cxx:47 #: GeometryGUI_PipeDlg.cxx:47
msgid "GEOM_PIPE_TITLE" msgid "GEOM_PIPE_TITLE"
msgstr "Pipe Construction" msgstr "Pipe Construction"
@ -1299,3 +1307,10 @@ msgstr "Values"
msgid "GEOM_SKETCHER_TYPE" msgid "GEOM_SKETCHER_TYPE"
msgstr "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"

View File

@ -49,7 +49,7 @@ msgstr "&Exploser"
#: GeometryGUI.cxx:563 #: GeometryGUI.cxx:563
msgid "GEOM_INF_LOADED" 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 #: GeometryGUI.cxx:3069
msgid "GEOM_PRP_COMMAND" 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 #: GeometryGUI.cxx:4977
msgid "GEOM_PRP_ABORT" msgid "GEOM_PRP_ABORT"
msgstr "L'opération a echoué" msgstr "L'opération a echoué"
#: GeometryGUI.cxx:5058 #: GeometryGUI.cxx:5058
msgid "GEOM_PRP_DONE" msgid "GEOM_PRP_DONE"
msgstr "Opération effectuée" msgstr "Opération effectuée"
#: GeometryGUI.cxx:3717 #: GeometryGUI.cxx:3717
msgid "GEOM_PRP_LOADING" msgid "GEOM_PRP_LOADING"
@ -73,11 +73,11 @@ msgstr "Chargement de %1 ..."
#: GeometryGUI.cxx:1412 #: GeometryGUI.cxx:1412
msgid "GEOM_PRP_NULLSHAPE" msgid "GEOM_PRP_NULLSHAPE"
msgstr "Erreur, objet inconsistant ou inapproprié !" msgstr "Erreur, objet inconsistant ou inapproprié !"
#: GeometryGUI.cxx:5072 #: GeometryGUI.cxx:5072
msgid "GEOM_PRP_READY" msgid "GEOM_PRP_READY"
msgstr "Prêt..." msgstr "Prêt..."
#: GeometryGUI.cxx:1690 #: GeometryGUI.cxx:1690
msgid "GEOM_PRP_SELECT_SUBSHAPES" msgid "GEOM_PRP_SELECT_SUBSHAPES"
@ -127,11 +127,11 @@ msgstr "Angle :"
#: GeometryGUI.cxx:3941 #: GeometryGUI.cxx:3941
msgid "GEOM_MEN_COMPONENT" msgid "GEOM_MEN_COMPONENT"
msgstr "Géometrie" msgstr "Géometrie"
#: GeometryGUI.cxx:4389 #: GeometryGUI.cxx:4389
msgid "GEOM_MEN_ENTER_ANGLE" msgid "GEOM_MEN_ENTER_ANGLE"
msgstr "Saisir un angle en degrés" msgstr "Saisir un angle en degrés"
#: GeometryGUI.cxx:3758 #: GeometryGUI.cxx:3758
msgid "GEOM_MEN_EXPORT" msgid "GEOM_MEN_EXPORT"
@ -250,7 +250,7 @@ msgstr "Objet %1"
#Object and result #Object and result
msgid "GEOM_OBJECT_RESULT" msgid "GEOM_OBJECT_RESULT"
msgstr "Objet Et Résultat" msgstr "Objet Et Résultat"
#Point #Point
msgid "GEOM_POINT" msgid "GEOM_POINT"
@ -310,7 +310,7 @@ msgstr "poids"
#Coordinates #Coordinates
msgid "GEOM_COORDINATES" msgid "GEOM_COORDINATES"
msgstr "Coordonnées" msgstr "Coordonnées"
#Coor. #Coor.
msgid "GEOM_COOR" msgid "GEOM_COOR"
@ -362,11 +362,11 @@ msgstr "Base"
#Water Density #Water Density
msgid "GEOM_WATER_DENSITY" msgid "GEOM_WATER_DENSITY"
msgstr "Densité de l'eau :" msgstr "Densité de l'eau :"
#Meshing Deflection #Meshing Deflection
msgid "GEOM_MESHING_DEFLECTION" msgid "GEOM_MESHING_DEFLECTION"
msgstr "Déflection Du Maillage :" msgstr "Déflection Du Maillage :"
#Dimensions #Dimensions
msgid "GEOM_DIMENSIONS" msgid "GEOM_DIMENSIONS"
@ -374,11 +374,11 @@ msgstr "Dimensions"
#Precision #Precision
msgid "GEOM_PRECISION" msgid "GEOM_PRECISION"
msgstr "Précision :" msgstr "Précision :"
#Selection #Selection
msgid "GEOM_SELECTION" msgid "GEOM_SELECTION"
msgstr "Sélection" msgstr "Sélection"
#Nb. Times #Nb. Times
msgid "GEOM_NB_TIMES" msgid "GEOM_NB_TIMES"
@ -414,7 +414,7 @@ msgstr "Partition"
#Tolerance #Tolerance
msgid "GEOM_TOLERANCE" msgid "GEOM_TOLERANCE"
msgstr "Tolérance" msgstr "Tolérance"
#Orientation #Orientation
msgid "GEOM_ORIENTATION" msgid "GEOM_ORIENTATION"
@ -426,7 +426,7 @@ msgstr "Pipe"
#Revolution #Revolution
msgid "GEOM_REVOLUTION" msgid "GEOM_REVOLUTION"
msgstr "Révolution" msgstr "Révolution"
#Rotation #Rotation
msgid "GEOM_ROTATION" msgid "GEOM_ROTATION"
@ -434,7 +434,7 @@ msgstr "Rotation"
#Archimede #Archimede
msgid "GEOM_ARCHIMEDE" msgid "GEOM_ARCHIMEDE"
msgstr "Archimède" msgstr "Archimède"
#Common #Common
msgid "GEOM_COMMON" msgid "GEOM_COMMON"
@ -594,7 +594,7 @@ msgstr "Solide"
#Sphere #Sphere
msgid "GEOM_SPHERE" msgid "GEOM_SPHERE"
msgstr "Sphère" msgstr "Sphère"
#Conical Face #Conical Face
msgid "GEOM_SURFCONE" msgid "GEOM_SURFCONE"
@ -606,7 +606,7 @@ msgstr "Face Cylindrique"
#Spherical Face #Spherical Face
msgid "GEOM_SURFSPHERE" msgid "GEOM_SURFSPHERE"
msgstr "Face Sphèrique" msgstr "Face Sphèrique"
#Toroidal Face #Toroidal Face
msgid "GEOM_SURFTORUS" msgid "GEOM_SURFTORUS"
@ -638,7 +638,7 @@ msgstr "Wire"
#Parameter #Parameter
msgid "GEOM_PARAMETER" msgid "GEOM_PARAMETER"
msgstr "Paramètre :" msgstr "Paramètre :"
# #
@ -691,7 +691,7 @@ msgstr "D2 :"
#: GeometryGUI.cxx #: GeometryGUI.cxx
msgid "GEOM_STEP_TITLE" msgid "GEOM_STEP_TITLE"
msgstr "Increment par défaut lors des constructions" msgstr "Increment par défaut lors des constructions"
#: GeometryGUI_ArcDlg.cxx:45 #: GeometryGUI_ArcDlg.cxx:45
msgid "GEOM_ARC_TITLE" msgid "GEOM_ARC_TITLE"
@ -699,7 +699,7 @@ msgstr "Construction d'un Arc"
#: GeometryGUI_ArchimedeDlg.cxx:55 #: GeometryGUI_ArchimedeDlg.cxx:55
msgid "GEOM_ARCHIMEDE_TITLE" msgid "GEOM_ARCHIMEDE_TITLE"
msgstr "Construction d'Archimède" msgstr "Construction d'Archimède"
#: GeometryGUI_BndBoxDlg.cxx:59 #: GeometryGUI_BndBoxDlg.cxx:59
msgid "GEOM_BNDBOX_TITLE" msgid "GEOM_BNDBOX_TITLE"
@ -739,7 +739,7 @@ msgstr "Construction d'un Cercle"
#: GeometryGUI_CenterMassDlg.cxx:77 #: GeometryGUI_CenterMassDlg.cxx:77
msgid "GEOM_CMASS_TITLE" msgid "GEOM_CMASS_TITLE"
msgstr "Centre De Gravité" msgstr "Centre De Gravité"
msgid "GEOM_PLANE_SIZE" msgid "GEOM_PLANE_SIZE"
msgstr "Taille du plan :" msgstr "Taille du plan :"
@ -750,7 +750,7 @@ msgstr "BOOLEEN : Jonction De Deux Objets"
#: GeometryGUI_CompoundDlg.cxx:44 #: GeometryGUI_CompoundDlg.cxx:44
msgid "GEOM_COMPOUND_TITLE" msgid "GEOM_COMPOUND_TITLE"
msgstr "Création d'un Compound" msgstr "Création d'un Compound"
#: GeometryGUI_ConeDlg.cxx:49 #: GeometryGUI_ConeDlg.cxx:49
msgid "GEOM_CONE_TITLE" msgid "GEOM_CONE_TITLE"
@ -782,27 +782,27 @@ msgstr "Objets Et Resultats"
#: GeometryGUI_EdgeDlg.cxx:47 #: GeometryGUI_EdgeDlg.cxx:47
msgid "GEOM_EDGE_TITLE" msgid "GEOM_EDGE_TITLE"
msgstr "Création d'un Edge" msgstr "Création d'un Edge"
#: GeometryGUI_FilletDlg.cxx:58 #: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_TITLE" msgid "GEOM_FILLET_TITLE"
msgstr "Construction d'un Congé" msgstr "Construction d'un Congé"
#: GeometryGUI_FilletDlg.cxx:58 #: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_ALL" msgid "GEOM_FILLET_ALL"
msgstr "Congé sur toute la Shape" msgstr "Congé sur toute la Shape"
#: GeometryGUI_FilletDlg.cxx:58 #: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_EDGES" msgid "GEOM_FILLET_EDGES"
msgstr "Congé sur Edges de la Shape" msgstr "Congé sur Edges de la Shape"
#: GeometryGUI_FilletDlg.cxx:58 #: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_FACES" msgid "GEOM_FILLET_FACES"
msgstr "Congé sur Faces de la Shape" msgstr "Congé sur Faces de la Shape"
#: GeometryGUI_FaceDlg.cxx:49 #: GeometryGUI_FaceDlg.cxx:49
msgid "GEOM_FACE_TITLE" msgid "GEOM_FACE_TITLE"
msgstr "Création d'une Face" msgstr "Création d'une Face"
#: GeometryGUI_FaceDlg.cxx:78 #: GeometryGUI_FaceDlg.cxx:78
msgid "GEOM_FACE_FFW" msgid "GEOM_FACE_FFW"
@ -810,7 +810,7 @@ msgstr "Face a partir d'un wire"
#: GeometryGUI_FaceDlg.cxx:103 #: GeometryGUI_FaceDlg.cxx:103
msgid "GEOM_FACE_OPT" msgid "GEOM_FACE_OPT"
msgstr "Création d'une Face plane" msgstr "Création d'une Face plane"
#: GeometryGUI_FillingDlg.cxx:53 #: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE" msgid "GEOM_FILLING_TITLE"
@ -912,6 +912,10 @@ msgstr "Objet garde"
msgid "GEOM_PARTITION_ORIENTATION" msgid "GEOM_PARTITION_ORIENTATION"
msgstr "Change l'orientation" msgstr "Change l'orientation"
#: GeometryGUI_PartitionDlg.cxx:45
msgid "SUPPRESS_RESULT"
msgstr "Suppress Result"
#: GeometryGUI_PipeDlg.cxx:47 #: GeometryGUI_PipeDlg.cxx:47
msgid "GEOM_PIPE_TITLE" msgid "GEOM_PIPE_TITLE"
msgstr "Construction d'une Pipe" msgstr "Construction d'une Pipe"
@ -1115,7 +1119,7 @@ msgid "GEOM_MULTIROTATION_DOUBLE"
msgstr "Multi Rotation Double" msgstr "Multi Rotation Double"
msgid "GEOM_PARAM_POINT" msgid "GEOM_PARAM_POINT"
msgstr "Point paramétrique" msgstr "Point paramétrique"
# #
#============================================================================== #==============================================================================
@ -1127,4 +1131,11 @@ msgstr "Filaire"
#: GeometryGUI.cxx:4613 #: GeometryGUI.cxx:4613
msgid "GEOM_MEN_SHADING" 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 "

View File

@ -507,6 +507,7 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
if(GeomGUI != 0) { if(GeomGUI != 0) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar(); QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
if(GeomGUI->myState == 2) { if(GeomGUI->myState == 2) {
Mb->setItemEnabled(405, false);//SKETCHER Mb->setItemEnabled(405, false);//SKETCHER
GeomGUI->GetSketcher().Clear(); GeomGUI->GetSketcher().Clear();

View File

@ -163,7 +163,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
} }
else { else {
Quantity_Color Default = Quantity_Color(); 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()); QColor c = QColorDialog::getColor(color, QAD_Application::getDesktop());
@ -372,7 +372,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
Quantity_Color CSFColor; Quantity_Color CSFColor;
Shape->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()) { if(c.isValid()) {
CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB); 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()) { while(useSubItems?anIter->More():!anAttr->_is_nil()) {
if(!obj->FindAttribute(anAttr, "AttributeIOR") && if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
obj->FindAttribute(anAttr, "AttributePersistentRef")) { obj->FindAttribute(anAttr, "AttributePersistentRef")) {
// load
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM"); SALOMEDS::SComponent_var FComp = obj->GetFatherComponent();
if (!CORBA::is_nil(comp)) { if (!CORBA::is_nil(FComp)) {
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp); if (FComp->FindAttribute(anAttr, "AttributeName")) {
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aStudyBuilder->LoadWith(aStudy->FindComponent("GEOM"),driver); 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 { else {
MESSAGE("Component is null"); MESSAGE("Component is null");
} }
@ -752,7 +789,7 @@ bool GEOMToolsGUI::Import(int aState)
// if (aLocked) return false; // if (aLocked) return false;
father->ComponentIOR(myGeomGUI->GetFatherior()); 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()))) { if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) ); QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );

View File

@ -152,6 +152,12 @@ def MakeCircle(p1,d1,radius):
anObj._set_Name(ior) anObj._set_Name(ior)
return anObj 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): def MakePlane(p1,d1,trimsize):
anObj = geom.MakePlane(p1,d1,trimsize) anObj = geom.MakePlane(p1,d1,trimsize)
ior = orb.object_to_string(anObj) ior = orb.object_to_string(anObj)

View File

@ -178,6 +178,12 @@ def MakeCircle(p1,d1,radius):
anObj._set_Name(ior) anObj._set_Name(ior)
return anObj 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): def MakePlane(p1,d1,trimsize):
anObj = geom.MakePlane(p1,d1,trimsize) anObj = geom.MakePlane(p1,d1,trimsize)
ior = salome.orb.object_to_string(anObj) ior = salome.orb.object_to_string(anObj)

View File

@ -172,6 +172,7 @@ void GenerationGUI_FillingDlg::ClickOnOk()
//================================================================================= //=================================================================================
void GenerationGUI_FillingDlg::ClickOnApply() void GenerationGUI_FillingDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -187,7 +187,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
} }
else if(myEditCurrentArgument == GroupPoints->LineEdit2) { else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
myOkShape2 = false; 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); myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; return;

View File

@ -146,6 +146,7 @@ void GenerationGUI_PrismDlg::ClickOnOk()
//================================================================================= //=================================================================================
void GenerationGUI_PrismDlg::ClickOnApply() void GenerationGUI_PrismDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -145,6 +145,7 @@ void GenerationGUI_RevolDlg::ClickOnOk()
//================================================================================= //=================================================================================
void GenerationGUI_RevolDlg::ClickOnApply() void GenerationGUI_RevolDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -37,6 +37,8 @@ using namespace std;
#include <qtextedit.h> #include <qtextedit.h>
#include <BRep_Tool.hxx>
//================================================================================= //=================================================================================
// class : MeasureGUI_WhatisDlg() // class : MeasureGUI_WhatisDlg()
// purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the // 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; return;
TCollection_AsciiString Astr; 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 { try {
int iType, nbTypes [TopAbs_SHAPE]; int iType, nbTypes [TopAbs_SHAPE];
for(iType = 0; iType < TopAbs_SHAPE; ++iType) for(iType = 0; iType < TopAbs_SHAPE; ++iType)

View File

@ -152,6 +152,7 @@ void OperationGUI_ArchimedeDlg::ClickOnOk()
//================================================================================= //=================================================================================
void OperationGUI_ArchimedeDlg::ClickOnApply() void OperationGUI_ArchimedeDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkIO) if(myOkIO)
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection); myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);

View File

@ -30,6 +30,7 @@ using namespace std;
#include "OperationGUI_ChamferDlg.h" #include "OperationGUI_ChamferDlg.h"
#include "DisplayGUI.h" #include "DisplayGUI.h"
#include "QAD_MessageBox.h"
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx> #include <BRepFilletAPI_MakeChamfer.hxx>
@ -38,6 +39,9 @@ using namespace std;
#include <TopExp.hxx> #include <TopExp.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
//================================================================================= //=================================================================================
// class : OperationGUI_ChamferDlg() // class : OperationGUI_ChamferDlg()
// purpose : Constructs a OperationGUI_ChamferDlg which is a child of 'parent', with the // 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->TextLabel3->setText(tr("GEOM_D2"));
Group1->PushButton1->setPixmap(image3); 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(Group1, 1, 0);
Layout1->addWidget(Group2, 1, 0);
Layout1->addWidget(Group3, 1, 0);
/***************************************************************/ /***************************************************************/
/* Initialisations */ /* Initialisations */
@ -123,18 +111,10 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
double SpecificStep = 10.0; double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); 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); 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); Group1->SpinBox_DX->SetValue(myD1);
Group2->SpinBox_DX->SetValue(myD1);
Group3->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2); Group1->SpinBox_DY->SetValue(myD2);
Group2->SpinBox_DY->SetValue(myD2);
Group3->SpinBox_DY->SetValue(myD2);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); 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(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); 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(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(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(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)), 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)), 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())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */ /* displays Dialog */
Group2->hide();
Group3->hide();
Group1->show(); Group1->show();
this->show(); this->show();
@ -200,52 +164,33 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
myUseLocalContext = false; 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())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group1->LineEdit1->setText("");
Group1->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
switch (constructorId) switch (constructorId)
{ {
case 0: /* Chamfer All */ case 0: /* Chamfer All */
{ {
Group2->hide(); Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_ALL"));
Group3->hide();
resize(0, 0);
Group1->show();
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText("");
myShapeType = -1; myShapeType = -1;
Group1->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
break; break;
} }
case 1: /* Chamfer edges */ case 1: /* Chamfer edges */
{ {
Group1->hide(); Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
Group3->hide();
resize(0, 0);
Group2->show();
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText("");
myShapeType = 6; myShapeType = 6;
Group2->SpinBox_DX->SetValue(myD1);
Group2->SpinBox_DY->SetValue(myD2);
break; break;
} }
case 2: /* Chamfer Faces */ case 2: /* Chamfer Faces */
{ {
Group1->hide(); Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
Group2->hide();
resize(0, 0);
Group3->show();
myEditCurrentArgument = Group3->LineEdit1;
Group3->LineEdit1->setText("");
myShapeType = 4; myShapeType = 4;
Group3->SpinBox_DX->SetValue(myD1);
Group3->SpinBox_DY->SetValue(myD2);
break; break;
} }
} }
@ -271,6 +216,7 @@ void OperationGUI_ChamferDlg::ClickOnOk()
//================================================================================= //=================================================================================
void OperationGUI_ChamferDlg::ClickOnApply() void OperationGUI_ChamferDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape(); 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(); 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() // function : SetEditCurrentArgument()
// purpose : // purpose :
@ -417,18 +342,9 @@ void OperationGUI_ChamferDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if(send == Group1->PushButton1) { if(send == Group1->PushButton1)
Group1->LineEdit1->setFocus(); 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(); this->SelectionIntoArgument();
return; return;
} }
@ -489,24 +405,20 @@ void OperationGUI_ChamferDlg::closeEvent(QCloseEvent* e)
// function : ValueChangedInSpinBox() // function : ValueChangedInSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue ) void OperationGUI_ChamferDlg::ValueChangedInSpinBox(double newValue)
{ {
myGeomBase->EraseSimulationShape(); myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
QObject* send = (QObject*)sender(); 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; myD1 = newValue;
if(myConstructorId == 0) else if(send == Group1->SpinBox_DY) /* D2 */
this->MakePreview();
return ;
}
else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
myD2 = newValue; myD2 = newValue;
if(myConstructorId == 0)
this->MakePreview(); if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
return; this->MakePreview();
}
return; return;
} }
@ -539,48 +451,44 @@ void OperationGUI_ChamferDlg::ResetStateOfDialog()
void OperationGUI_ChamferDlg::MakePreview() void OperationGUI_ChamferDlg::MakePreview()
{ {
QApplication::setOverrideCursor(Qt::waitCursor); 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 { try {
if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) { BRepFilletAPI_MakeChamfer MC(myShape);
QApplication::restoreOverrideCursor(); switch(myConstructorId)
return; {
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 */
}
if(!tds.IsNull()) {
mySimulationTopoDs = tds;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
} }
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;
}
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
mySimulationTopoDs = S;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
} }
catch(Standard_Failure) { catch(Standard_Failure) {
MESSAGE("Exception catched in MakePreview");
QApplication::restoreOverrideCursor(); 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(); QApplication::restoreOverrideCursor();
return; return;
} }

View File

@ -72,8 +72,6 @@ private :
double myD2; double myD2;
DlgRef_1Sel2Spin* Group1; DlgRef_1Sel2Spin* Group1;
DlgRef_1Sel2Spin* Group2;
DlgRef_1Sel2Spin* Group3;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
@ -81,7 +79,6 @@ private slots:
void ClickOnCancel(); void ClickOnCancel();
void ActivateThisDialog(); void ActivateThisDialog();
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void LineEditReturnPressed();
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue); void ValueChangedInSpinBox(double newValue);

View File

@ -30,12 +30,16 @@ using namespace std;
#include "OperationGUI_FilletDlg.h" #include "OperationGUI_FilletDlg.h"
#include "DisplayGUI.h" #include "DisplayGUI.h"
#include "QAD_MessageBox.h"
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx> #include <BRepFilletAPI_MakeFillet.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
//================================================================================= //=================================================================================
// class : OperationGUI_FilletDlg() // class : OperationGUI_FilletDlg()
// purpose : Constructs a OperationGUI_FilletDlg which is a child of 'parent', with the // 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->TextLabel2->setText(tr("GEOM_RADIUS"));
Group1->PushButton1->setPixmap(image3); 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(Group1, 1, 0);
Layout1->addWidget(Group2, 1, 0);
Layout1->addWidget(Group3, 1, 0);
/***************************************************************/ /***************************************************************/
/* Initialisations */ /* Initialisations */
@ -117,12 +107,7 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic)
double SpecificStep = 10.0; double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); 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); Group1->SpinBox_DX->SetValue(myRadius);
Group2->SpinBox_DX->SetValue(myRadius);
Group3->SpinBox_DX->SetValue(myRadius);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); 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(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); 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(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(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)), 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())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */ /* displays Dialog */
Group2->hide();
Group3->hide();
Group1->show(); Group1->show();
this->show(); this->show();
@ -181,49 +154,32 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
myUseLocalContext = false; 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())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group1->LineEdit1->setText("");
Group1->SpinBox_DX->SetValue(myRadius);
switch (constructorId) switch (constructorId)
{ {
case 0: /* Fillet All */ case 0: /* Fillet All */
{ {
Group2->hide(); Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL"));
Group3->hide();
resize(0, 0);
Group1->show();
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText("");
myShapeType = -1; myShapeType = -1;
Group1->SpinBox_DX->SetValue(myRadius);
break; break;
} }
case 1: /* Fillet edges */ case 1: /* Fillet edges */
{ {
Group1->hide(); Group1->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
Group3->hide();
resize(0, 0);
Group2->show();
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText("");
myShapeType = 6; myShapeType = 6;
Group2->SpinBox_DX->SetValue(myRadius);
break; break;
} }
case 2: /* Fillet Faces */ case 2: /* Fillet Faces */
{ {
Group1->hide(); Group1->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
Group2->hide();
resize(0, 0);
Group3->show();
myEditCurrentArgument = Group3->LineEdit1;
Group3->LineEdit1->setText("");
myShapeType = 4; myShapeType = 4;
Group3->SpinBox_DX->SetValue(myRadius);
break; break;
} }
} }
@ -249,6 +205,7 @@ void OperationGUI_FilletDlg::ClickOnOk()
//================================================================================= //=================================================================================
void OperationGUI_FilletDlg::ClickOnApply() void OperationGUI_FilletDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape(); 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(); this->MakePreview();
} }
else 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() // function : SetEditCurrentArgument()
// purpose : // purpose :
@ -392,18 +328,9 @@ void OperationGUI_FilletDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if(send == Group1->PushButton1) { if(send == Group1->PushButton1)
Group1->LineEdit1->setFocus(); 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(); this->SelectionIntoArgument();
return; return;
} }
@ -492,7 +419,7 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
myRadius = newValue; myRadius = newValue;
if(myConstructorId == 0) if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview(); this->MakePreview();
return; return;
} }
@ -505,46 +432,57 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
void OperationGUI_FilletDlg::MakePreview() void OperationGUI_FilletDlg::MakePreview()
{ {
QApplication::setOverrideCursor(Qt::waitCursor); 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 { try {
if(myRadius <= Precision::Confusion()) { BRepFilletAPI_MakeFillet fill(myShape);
QApplication::restoreOverrideCursor(); switch(myConstructorId)
return; {
} 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); if(!tds.IsNull()) {
GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, myRadius, myShapeType, ListOfID); mySimulationTopoDs = tds;
if(result->_is_nil()) { myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
QApplication::restoreOverrideCursor();
return;
} }
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result); }
mySimulationTopoDs = S;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
catch(Standard_Failure) { catch(Standard_Failure) {
MESSAGE("Exception catched in MakePreview");
QApplication::restoreOverrideCursor(); 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(); QApplication::restoreOverrideCursor();
return; return;
} }

View File

@ -71,8 +71,6 @@ private :
double myRadius; double myRadius;
DlgRef_1Sel1Spin* Group1; DlgRef_1Sel1Spin* Group1;
DlgRef_1Sel1Spin* Group2;
DlgRef_1Sel1Spin* Group3;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
@ -80,7 +78,6 @@ private slots:
void ClickOnCancel(); void ClickOnCancel();
void ActivateThisDialog(); void ActivateThisDialog();
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void LineEditReturnPressed();
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue); void ValueChangedInSpinBox(double newValue);

View File

@ -216,14 +216,17 @@ void PrimitiveGUI::MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir,
const double Radius1, const double Radius2, const double aHeight) const double Radius1, const double Radius2, const double aHeight)
{ {
try { 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; return;
GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z()); GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z());
GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z()); GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z());
GEOM::DirStruct dstruct = myGeom->MakeDirection(d); 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()) { if(result->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT")); QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return; return;

View File

@ -221,6 +221,7 @@ void PrimitiveGUI_BoxDlg::ClickOnOk()
//================================================================================= //=================================================================================
void PrimitiveGUI_BoxDlg::ClickOnApply() void PrimitiveGUI_BoxDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -120,11 +120,11 @@ void PrimitiveGUI_ConeDlg::Init()
step = St.toDouble(); step = St.toDouble();
/* min, max, step and decimals for spin boxes & initial values */ /* min, max, step and decimals for spin boxes & initial values */
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 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_DX->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupPoints->SpinBox_DX->SetValue(myRadius1); GroupPoints->SpinBox_DX->SetValue(myRadius1);
@ -247,6 +247,7 @@ void PrimitiveGUI_ConeDlg::ClickOnOk()
//================================================================================= //=================================================================================
void PrimitiveGUI_ConeDlg::ClickOnApply() void PrimitiveGUI_ConeDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -234,6 +234,7 @@ void PrimitiveGUI_CylinderDlg::ClickOnOk()
//================================================================================= //=================================================================================
void PrimitiveGUI_CylinderDlg::ClickOnApply() void PrimitiveGUI_CylinderDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -205,6 +205,7 @@ void PrimitiveGUI_SphereDlg::ClickOnOk()
//================================================================================= //=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnApply() void PrimitiveGUI_SphereDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull()) if(mySimulationTopoDs.IsNull())
return; return;

View File

@ -102,7 +102,6 @@ void PrimitiveGUI_TorusDlg::Init()
myRadius1 = 300.0; myRadius1 = 300.0;
myRadius2 = 100.0; myRadius2 = 100.0;
myOkRadius1 = myOkRadius2 = true;
myOkPoint1 = myOkDir = false; myOkPoint1 = myOkDir = false;
myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom); myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
@ -167,7 +166,6 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
mySelection->ClearFilters(); mySelection->ClearFilters();
myGeomBase->EraseSimulationShape(); myGeomBase->EraseSimulationShape();
disconnect(mySelection, 0, this, 0); disconnect(mySelection, 0, this, 0);
myOkRadius1 = myOkRadius2 = true;
myRadius1 = 300.0; myRadius1 = 300.0;
myRadius2 = 100.0; myRadius2 = 100.0;
@ -230,13 +228,14 @@ void PrimitiveGUI_TorusDlg::ClickOnOk()
//================================================================================= //=================================================================================
void PrimitiveGUI_TorusDlg::ClickOnApply() void PrimitiveGUI_TorusDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;
myGeomBase->EraseSimulationShape(); myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 ) if(myOkPoint1 && myOkDir)
myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2); myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2);
return ; return ;
} }
@ -278,7 +277,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
myOkDir = true; myOkDir = true;
} }
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2) if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay(); MakeTorusSimulationAndDisplay();
return; return;
} }
@ -374,15 +373,23 @@ void PrimitiveGUI_TorusDlg::ValueChangedInSpinBox(double newValue)
QObject* send = (QObject*)sender(); QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) { if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) {
myRadius1 = newValue; if(newValue > myRadius2)
myOkRadius1 = true; myRadius1 = newValue;
else {
GroupPoints->SpinBox_DX->SetValue(myRadius1);
GroupDimensions->SpinBox_DX->SetValue(myRadius1);
}
} }
else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) { else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) {
myRadius2 = newValue; if(newValue < myRadius1)
myOkRadius2 = true; myRadius2 = newValue;
else {
GroupPoints->SpinBox_DY->SetValue(myRadius2);
GroupDimensions->SpinBox_DY->SetValue(myRadius2);
}
} }
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2) if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay(); MakeTorusSimulationAndDisplay();
return; return;
} }

View File

@ -72,8 +72,6 @@ private:
Standard_Real myRadius1; Standard_Real myRadius1;
Standard_Real myRadius2; Standard_Real myRadius2;
bool myOkRadius1;
bool myOkRadius2;
DlgRef_2Sel2Spin* GroupPoints; DlgRef_2Sel2Spin* GroupPoints;
DlgRef_2Spin* GroupDimensions; DlgRef_2Spin* GroupDimensions;

View File

@ -311,11 +311,11 @@ bool RepairGUI::OnSuppressFaces(const TopoDS_Shape& ShapeTopo, const char* Shape
Standard_CString Type; Standard_CString Type;
if(myGeomBase->GetShapeTypeString(S, Type)) { if(myGeomBase->GetShapeTypeString(S, Type)) {
aShellOrFace->NameType(Type); aShellOrFace->NameType(Type);
sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++); sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++);
} }
else { else {
aShellOrFace->NameType(tr("GEOM_SHAPE")); 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 */ /* Display with name */

View File

@ -140,6 +140,7 @@ void RepairGUI_OrientationDlg::ClickOnOk()
//================================================================================= //=================================================================================
void RepairGUI_OrientationDlg::ClickOnApply() void RepairGUI_OrientationDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -134,6 +134,7 @@ void RepairGUI_SewingDlg::ClickOnOk()
//================================================================================= //=================================================================================
void RepairGUI_SewingDlg::ClickOnApply() void RepairGUI_SewingDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes) if(myOkListShapes)
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision); myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);

View File

@ -131,6 +131,7 @@ void TransformationGUI_MirrorDlg::ClickOnOk()
//================================================================================= //=================================================================================
void TransformationGUI_MirrorDlg::ClickOnApply() void TransformationGUI_MirrorDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -258,6 +258,7 @@ void TransformationGUI_MultiRotationDlg::ClickOnOk()
//================================================================================= //=================================================================================
void TransformationGUI_MultiRotationDlg::ClickOnApply() void TransformationGUI_MultiRotationDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;
@ -429,13 +430,13 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox(double newValue)
QObject* send = (QObject*)sender(); QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1) if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
myNbTimes1 = newValue; myNbTimes1 = (int)newValue;
else if(send == GroupDimensions->SpinBox_DX1) else if(send == GroupDimensions->SpinBox_DX1)
myAng = newValue; myAng = newValue;
else if(send == GroupDimensions->SpinBox_DX2) else if(send == GroupDimensions->SpinBox_DX2)
myStep = newValue; myStep = newValue;
else if(send == GroupDimensions->SpinBox_DY2) else if(send == GroupDimensions->SpinBox_DY2)
myNbTimes2 = newValue; myNbTimes2 = (int)newValue;
if(myOkBase && myOkDir) if(myOkBase && myOkDir)
this->MakeMultiRotationSimulationAndDisplay(); this->MakeMultiRotationSimulationAndDisplay();

View File

@ -269,6 +269,7 @@ void TransformationGUI_MultiTranslationDlg::ClickOnOk()
//================================================================================= //=================================================================================
void TransformationGUI_MultiTranslationDlg::ClickOnApply() void TransformationGUI_MultiTranslationDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;
@ -488,7 +489,7 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu
if(send == GroupPoints->SpinBox_DX) if(send == GroupPoints->SpinBox_DX)
myStep1 = newValue; myStep1 = newValue;
else if(send == GroupPoints->SpinBox_DY) else if(send == GroupPoints->SpinBox_DY)
myNbTimes1 = newValue; myNbTimes1 = (int)newValue;
if(myOkBase && myOkDir1) if(myOkBase && myOkDir1)
this->MakeMultiTranslationSimulationAndDisplay(); this->MakeMultiTranslationSimulationAndDisplay();
break; break;
@ -498,11 +499,11 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu
if(send == GroupDimensions->SpinBox_DX1) if(send == GroupDimensions->SpinBox_DX1)
myStep1 = newValue; myStep1 = newValue;
else if(send == GroupDimensions->SpinBox_DY1) else if(send == GroupDimensions->SpinBox_DY1)
myNbTimes1 = newValue; myNbTimes1 = (int)newValue;
else if(send == GroupDimensions->SpinBox_DX2) else if(send == GroupDimensions->SpinBox_DX2)
myStep2 = newValue; myStep2 = newValue;
else if(send == GroupDimensions->SpinBox_DY2) else if(send == GroupDimensions->SpinBox_DY2)
myNbTimes2 = newValue; myNbTimes2 = (int)newValue;
if(myOkBase && myOkDir1 && myOkDir2) if(myOkBase && myOkDir1 && myOkDir2)
this->MakeMultiTranslationSimulationAndDisplay(); this->MakeMultiTranslationSimulationAndDisplay();
break; break;

View File

@ -142,6 +142,7 @@ void TransformationGUI_RotationDlg::ClickOnOk()
//================================================================================= //=================================================================================
void TransformationGUI_RotationDlg::ClickOnApply() void TransformationGUI_RotationDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -140,6 +140,7 @@ void TransformationGUI_ScaleDlg::ClickOnOk()
//================================================================================= //=================================================================================
void TransformationGUI_ScaleDlg::ClickOnApply() void TransformationGUI_ScaleDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;

View File

@ -148,6 +148,7 @@ void TransformationGUI_TranslationDlg::ClickOnOk()
//================================================================================= //=================================================================================
void TransformationGUI_TranslationDlg::ClickOnApply() void TransformationGUI_TranslationDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
return; return;