From: dcq Date: Mon, 6 Oct 2003 11:58:02 +0000 (+0000) Subject: DCQ : New architecture X-Git-Tag: DCQ_03_12_03~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=531fd066393241de2ae4a936cd2c4510e72ed130;p=modules%2Fgeom.git DCQ : New architecture --- diff --git a/resources/GEOM_en.xml b/resources/GEOM_en.xml index 3cbdb6828..3b15e0d46 100644 --- a/resources/GEOM_en.xml +++ b/resources/GEOM_en.xml @@ -41,28 +41,28 @@ - - - - - - - + + + + + + + - - - + + + - - - - - - + + + + + + - + @@ -70,106 +70,106 @@ - - - + + + - - + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + + + - - + + - - + + - - - + + + - + - - + + - + - - - + + + - - - + + + @@ -178,12 +178,12 @@ - + - - - - + + + + @@ -194,29 +194,29 @@ - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - + + + + @@ -227,28 +227,28 @@ - - - - + + + + - - + + - + - - - + + + - + @@ -258,17 +258,17 @@ - - + + - - - + + + - + - - + + diff --git a/src/BasicGUI/BasicGUI.cxx b/src/BasicGUI/BasicGUI.cxx index 697305166..7e919795e 100644 --- a/src/BasicGUI/BasicGUI.cxx +++ b/src/BasicGUI/BasicGUI.cxx @@ -75,7 +75,7 @@ bool BasicGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 3011: // POINT + case 4011: // POINT { Handle(AIS_InteractiveContext) ic; if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { @@ -85,37 +85,37 @@ bool BasicGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) BasicGUI_PointDlg *aDlg = new BasicGUI_PointDlg(parent, "", this, Sel, ic); break; } - case 3012: // LINE + case 4012: // LINE { BasicGUI_LineDlg *aDlg = new BasicGUI_LineDlg(parent, "", this, Sel); break; } - case 3013: // CIRCLE + case 4013: // CIRCLE { BasicGUI_CircleDlg *aDlg = new BasicGUI_CircleDlg(parent, "", this, Sel); break; } - case 3014: // ELLIPSE + case 4014: // ELLIPSE { BasicGUI_EllipseDlg *aDlg = new BasicGUI_EllipseDlg(parent, "", this, Sel); break; } - case 3015: // ARC + case 4015: // ARC { BasicGUI_ArcDlg *aDlg = new BasicGUI_ArcDlg(parent, "", this, Sel); break ; } - case 3016: // VECTOR + case 4016: // VECTOR { BasicGUI_VectorDlg *aDlg = new BasicGUI_VectorDlg(parent, "", this, Sel); break; } - case 3017: // PLANE + case 4017: // PLANE { BasicGUI_PlaneDlg *aDlg = new BasicGUI_PlaneDlg(parent, "", this, Sel); break; } - case 3018: // WORKING PLANE + case 4018: // WORKING PLANE { BasicGUI_WorkingPlaneDlg *aDlg = new BasicGUI_WorkingPlaneDlg(parent, "", this, Sel); break; diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index fd11b431c..a26fd00dd 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -115,6 +115,7 @@ void BasicGUI_CircleDlg::Init() connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 2e51e4ce8..88646a656 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -121,6 +121,9 @@ void BasicGUI_EllipseDlg::Init() connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 225de7d2b..d026949ff 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -166,6 +166,13 @@ void BasicGUI_PlaneDlg::Init() connect(GroupPointDirection->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_S, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointDirection->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupFace->SpinBox_DX, SLOT(SetStep(double))); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* Displays Dialog */ diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 659aaeff5..c339d3043 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -156,6 +156,11 @@ void BasicGUI_PointDlg::Init(const Handle(AIS_InteractiveContext)& ic) connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* displays Dialog */ diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index b696752de..73d0cf4c4 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -53,15 +53,15 @@ BasicGUI_VectorDlg::BasicGUI_VectorDlg(QWidget* parent, const char* name, BasicG /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_VECTOR")); RadioButton1->setPixmap(image0); - RadioButton2->close(TRUE); + RadioButton2->setPixmap(image1); RadioButton3->close(TRUE); GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS")); GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1")); GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2")); - GroupPoints->PushButton1->setPixmap(image1); - GroupPoints->PushButton2->setPixmap(image1); + GroupPoints->PushButton1->setPixmap(image2); + GroupPoints->PushButton2->setPixmap(image2); GroupDimensions = new DlgRef_3Spin1Check(this, "GroupDimensions"); GroupDimensions->GroupBox1->setTitle(tr("GEOM_COORDINATES")); @@ -141,6 +141,10 @@ void BasicGUI_VectorDlg::Init() connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); + connect(GroupDimensions->CheckBox1, SIGNAL(stateChanged(int)), this, SLOT(ReverseVector(int))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); diff --git a/src/BooleanGUI/BooleanGUI.cxx b/src/BooleanGUI/BooleanGUI.cxx index ce5a73b76..1af21f9d9 100644 --- a/src/BooleanGUI/BooleanGUI.cxx +++ b/src/BooleanGUI/BooleanGUI.cxx @@ -70,22 +70,22 @@ bool BooleanGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 4011: // FUSE + case 5011: // FUSE { BooleanGUI_FuseDlg *aDlg = new BooleanGUI_FuseDlg(parent, "", this, Sel); break; } - case 4012: // COMMON + case 5012: // COMMON { BooleanGUI_CommonDlg *aDlg = new BooleanGUI_CommonDlg(parent, "", this, Sel); break; } - case 4013: // CUT + case 5013: // CUT { BooleanGUI_CutDlg *aDlg = new BooleanGUI_CutDlg(parent, "", this, Sel); break; } - case 4014: // SECTION + case 5014: // SECTION { BooleanGUI_SectionDlg *aDlg = new BooleanGUI_SectionDlg(parent, "", this, Sel); break; diff --git a/src/BuildGUI/BuildGUI.cxx b/src/BuildGUI/BuildGUI.cxx index 8d74df5d3..08824e2b6 100644 --- a/src/BuildGUI/BuildGUI.cxx +++ b/src/BuildGUI/BuildGUI.cxx @@ -80,39 +80,39 @@ bool BuildGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 303: // EXPLODE : use ic + case 407: // EXPLODE : use ic { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); BuildGUI_SubShapeDlg *aDlg = new BuildGUI_SubShapeDlg(parent, "", this, Sel, ic); break ; } - case 304: // GEOM::EDGE + case 4081: // GEOM::EDGE { BuildGUI_EdgeDlg *aDlg = new BuildGUI_EdgeDlg(parent, "", this, Sel); break; } - case 305: // GEOM::WIRE + case 4082: // GEOM::WIRE { BuildGUI_WireDlg *aDlg = new BuildGUI_WireDlg(parent, "", this, Sel); break; } - case 306: // GEOM::FACE + case 4083: // GEOM::FACE { BuildGUI_FaceDlg *aDlg = new BuildGUI_FaceDlg(parent, "", this, Sel); break; } - case 315: // GEOM::SHELL + case 4084: // GEOM::SHELL { BuildGUI_ShellDlg *aDlg = new BuildGUI_ShellDlg(parent, "", this, Sel); break; } - case 316: // GEOM::SOLID + case 4085: // GEOM::SOLID { BuildGUI_SolidDlg *aDlg = new BuildGUI_SolidDlg(parent, "", this, Sel); break; } - case 308: // GEOM::COMPOUND + case 4086: // GEOM::COMPOUND { BuildGUI_CompoundDlg *aDlg = new BuildGUI_CompoundDlg(parent, "", this, Sel); break; diff --git a/src/DlgRef/DlgRef_SpinBox.cxx b/src/DlgRef/DlgRef_SpinBox.cxx index ba262d597..b5097abe6 100644 --- a/src/DlgRef/DlgRef_SpinBox.cxx +++ b/src/DlgRef/DlgRef_SpinBox.cxx @@ -28,74 +28,74 @@ using namespace std; #include "DlgRef_SpinBox.h" -//#include "DlgRef.h" #include -//#include -//#include "utilities.h" //================================================================================= // class : DlgRef_SpinBox() // purpose : constructor of specific widget accepting floats in double precision. //================================================================================= -DlgRef_SpinBox::DlgRef_SpinBox( QWidget* parent, const char* name ) -: QAD_SpinBoxDbl( parent, name) +DlgRef_SpinBox::DlgRef_SpinBox(QWidget* parent, const char* name) +: QAD_SpinBoxDbl(parent, name) { - /* when step value is changed in myGeomGUI */ - //connect( DlgRef::GetDlgRef(), SIGNAL( SignalDefaultStepValueChanged( double )), this, SLOT( SetStep( double ) ) ); } //================================================================================= -// function : SetStep() [SLOT] -// purpose : +// function : ~DlgRef_SpinBox() +// purpose : destructor //================================================================================= -void DlgRef_SpinBox::SetStep( double newStep ) +DlgRef_SpinBox::~DlgRef_SpinBox() { - setLineStep( newStep ); } + //================================================================================= -// function : ~DlgRef_SpinBox() -// purpose : destructor +// function : SetStep() [SLOT] +// purpose : //================================================================================= -DlgRef_SpinBox::~DlgRef_SpinBox() +void DlgRef_SpinBox::SetStep(double newStep) { + setLineStep(newStep); } + //================================================================================= // function : SetValue() // purpose : //================================================================================= -void DlgRef_SpinBox::SetValue( double v ) +void DlgRef_SpinBox::SetValue(double v) { - setValue( v ); + setValue(v); } + //================================================================================= // function : GetValue() // purpose : returns a double //================================================================================= -double DlgRef_SpinBox::GetValue( ) +double DlgRef_SpinBox::GetValue() { return value(); } + //================================================================================= // function : GetString() // purpose : returns a QString //================================================================================= -QString DlgRef_SpinBox::GetString( ) +QString DlgRef_SpinBox::GetString() { return cleanText(); } + //================================================================================= // function : RangeStepAndValidator() // purpose : //================================================================================= -void DlgRef_SpinBox::RangeStepAndValidator( double min, double max, double step, unsigned short decimals ) +void DlgRef_SpinBox::RangeStepAndValidator(double min, double max, double step, unsigned short decimals) { - setRange( min, max ); - setLineStep( step ); - ( ( QDoubleValidator* )validator() )->setRange( min, max, decimals ) ; + setRange(min, max); + setLineStep(step); + ((QDoubleValidator*)validator())->setRange(min, max, decimals); } diff --git a/src/GEOMBase/GEOMBase_Context.cxx b/src/GEOMBase/GEOMBase_Context.cxx index 004515abd..2939a8e59 100644 --- a/src/GEOMBase/GEOMBase_Context.cxx +++ b/src/GEOMBase/GEOMBase_Context.cxx @@ -276,7 +276,6 @@ bool GEOMBase_Context::GetTopoFromSelection(SALOME_Selection *Sel, TopoDS_Shape& } - //===================================================================================== // function : PrepareSubShapeSelection() // purpose : (localContextId of the method is opened and defined here) @@ -907,7 +906,7 @@ bool GEOMBase_Context::DefineDlgPosition(QWidget* aDlg, int& x, int& y) { /* Here the position is on the bottom right corner - 10 */ QAD_Desktop* PP = QAD_Application::getDesktop(); - x = abs(PP->x() + PP->size().width() - aDlg->size().width() - 10); + x = abs(PP->x() + PP->size().width() - aDlg->size().width() - 10); y = abs(PP->y() + PP->size().height() - aDlg->size().height() - 10); return true; } @@ -963,36 +962,35 @@ void GEOMBase_Context::SetDisplayedObjectList() //===================================================================================== void GEOMBase_Context::DisplaySimulationShape(const TopoDS_Shape& S) { - if( S.IsNull() ) - return ; + if(S.IsNull()) + return; //NRI DEBUG : 14/02/2002 - if ( myActiveStudy->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) - return ; + if(myActiveStudy->getActiveStudyFrame()->getTypeView() > VIEW_OCC) + return; OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); + Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); try { /* erase any previous */ - ic->Erase( this->mySimulationShape, Standard_True, Standard_False ); - ic->ClearPrs( this->mySimulationShape ); - this->mySimulationShape = new AIS_Shape( TopoDS_Shape() ) ; - this->mySimulationShape->Set( S ) ; - this->mySimulationShape->SetColor(Quantity_NOC_VIOLET) ; - ic->Deactivate( this->mySimulationShape ); - ic->Display( this->mySimulationShape, Standard_False ); + ic->Erase(this->mySimulationShape, Standard_True, Standard_False); + ic->ClearPrs(this->mySimulationShape); + this->mySimulationShape = new AIS_Shape(TopoDS_Shape()); + this->mySimulationShape->Set(S); + this->mySimulationShape->SetColor(Quantity_NOC_VIOLET); + ic->Deactivate(this->mySimulationShape); + ic->Display(this->mySimulationShape, Standard_False); ic->UpdateCurrentViewer(); } catch(Standard_Failure) { - MESSAGE( "Exception catched in GEOMBase_Context::DisplaySimulationShape " ) ; + MESSAGE("Exception catched in GEOMBase_Context::DisplaySimulationShape "); } - this->mySimulationShape->UnsetColor() ; - return ; + this->mySimulationShape->UnsetColor(); + return; } - //================================================================================== // function : EraseSimulationShape() // purpose : Clears the display of 'mySimulationShape' a pure graphical shape @@ -1000,18 +998,15 @@ void GEOMBase_Context::DisplaySimulationShape(const TopoDS_Shape& S) void GEOMBase_Context::EraseSimulationShape() { int count = myActiveStudy->getStudyFramesCount(); - for ( int i = 0; i < count; i++ ) { - if (myActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC ) { + for(int i = 0; i < count; i++) { + if(myActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC) { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myActiveStudy->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); - ic->Erase( this->mySimulationShape, Standard_True, Standard_False ); - ic->ClearPrs( this->mySimulationShape ); + Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); + ic->Erase(this->mySimulationShape, Standard_True, Standard_False); + ic->ClearPrs(this->mySimulationShape); ic->UpdateCurrentViewer(); - - } else if (myActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_VTK ) { // VTK - } + } } - // MESSAGE ( " GEOMBase_Context::EraseSimulationShape done. " ) } @@ -1027,115 +1022,102 @@ bool GEOMBase_Context::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString nam Sel->ClearIObjects(); if(aShape->_is_nil()) { - QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), - tr ("GEOM_WRN_WARNING"), - tr ("GEOM_PRP_ABORT"), - tr ("GEOM_BUT_OK") ); - return false ; + QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_PRP_ABORT"), tr("GEOM_BUT_OK")); + return false; } TopoDS_Shape shape = myShapeReader.GetShape(myComponentGeom, aShape); - - if ( shape.IsNull() ) + if(shape.IsNull()) return false; - SALOMEDS::Study_var aStudy = myActiveStudy->getStudyDocument(); - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::Study_var aStudy = myActiveStudy->getStudyDocument(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributePixMap_var aPixmap; + SALOMEDS::AttributeName_var aName; + SALOMEDS::AttributePixMap_var aPixmap; SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM"); int aLocked = false; - if (father->_is_nil()) { - QAD_Operation* op = new SALOMEGUI_ImportOperation( myActiveStudy ); + if(father->_is_nil()) { + QAD_Operation* op = new SALOMEGUI_ImportOperation(myActiveStudy); op->start(); aLocked = aStudy->GetProperties()->IsLocked(); - if (aLocked) aStudy->GetProperties()->SetLocked(false); + if(aLocked) + aStudy->GetProperties()->SetLocked(false); father = aStudyBuilder->NewComponent("GEOM"); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - // aName->SetValue( tr("GEOM_MEN_COMPONENT") ); - aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) ); + aName->SetValue(QAD_Application::getDesktop()->getComponentUserName("GEOM")); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" ); + aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry"); myActiveStudy->updateObjBrowser(); - if (aLocked) aStudy->GetProperties()->SetLocked(true); + if(aLocked) + aStudy->GetProperties()->SetLocked(true); op->finish(); } -// if (aLocked) return false; - aStudyBuilder->DefineComponentInstance( father, myComponentGeom ); - father->ComponentIOR( myFatherior ); + aStudyBuilder->DefineComponentInstance(father, myComponentGeom); + father->ComponentIOR(myFatherior); TCollection_AsciiString nameG(""); Standard_CString Type; - if ( TCollection_AsciiString(name).IsEqual(Standard_CString("")) ) { - if ( TCollection_AsciiString(aShape->NameType()).IsEqual(Standard_CString("")) ) { + if(TCollection_AsciiString(name).IsEqual(Standard_CString(""))) { + if(TCollection_AsciiString(aShape->NameType()).IsEqual(Standard_CString(""))) { Standard_CString type; GetShapeTypeString(shape,type); - aShape->NameType( type ); - nameG += TCollection_AsciiString( type ) + TCollection_AsciiString("_") + - TCollection_AsciiString( myNbGeom++ ) + TCollection_AsciiString("\0"); - } else - nameG += TCollection_AsciiString( aShape->NameType()) + TCollection_AsciiString("_") + - TCollection_AsciiString( myNbGeom++ ) + TCollection_AsciiString("\0"); - } else + aShape->NameType(type); + nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myNbGeom++) + TCollection_AsciiString("\0"); + } + else + nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myNbGeom++) + TCollection_AsciiString("\0"); + } + else nameG = TCollection_AsciiString(name); // VTK - if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { + if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer(); int themode = myRenderInter->GetDisplayMode(); - vtkActorCollection* theActors = - GEOM_AssemblyBuilder::BuildActors(shape,0,themode,Standard_True); + vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(shape, 0, themode, Standard_True); theActors->InitTraversal(); vtkActor* anActor = (vtkActor*)theActors->GetNextActor(); - IO = new GEOM_InteractiveObject(aShape->Name(), - myFatherior, - "GEOM"); + IO = new GEOM_InteractiveObject(aShape->Name(), myFatherior, "GEOM"); while(!(anActor==NULL)) { - GEOM_Actor* GActor = GEOM_Actor::SafeDownCast( anActor ); - GActor->setIO( IO ); - GActor->setName( nameG.ToCString() ); + GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor); + GActor->setIO(IO); + GActor->setName(nameG.ToCString()); theRenderer->AddActor(GActor); anActor = (vtkActor*)theActors->GetNextActor(); } } // OCC - else if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { + else if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); - Handle(GEOM_AISShape) theResult = new GEOM_AISShape( shape, nameG.ToCString() ); - theResult->SetShadingColor( myShadingColor ); - IO = new GEOM_InteractiveObject(aShape->Name(), - myFatherior, - "GEOM"); - theResult->setIO( IO ); - theResult->setName( nameG.ToCString() ); + Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); + Handle(GEOM_AISShape) theResult = new GEOM_AISShape(shape, nameG.ToCString()); + theResult->SetShadingColor(myShadingColor); + IO = new GEOM_InteractiveObject(aShape->Name(), myFatherior, "GEOM"); + theResult->setIO(IO); + theResult->setName(nameG.ToCString()); /* Precaution : close any local context to permit the display */ - if ( ic->HasOpenedContext() ) { + if(ic->HasOpenedContext()) ic->CloseAllContexts(); - } - -// if(isInfinite) -// theResult->SetInfiniteState() ; - + ic->Display(theResult); } - Sel->AddIObject( IO, false ); + Sel->AddIObject(IO, false); myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame()->Repaint(); - if ( mySettings_AddInStudy ) - AddInStudy( false, IO ); - + if(mySettings_AddInStudy) + AddInStudy(false, IO); + return true; } @@ -1146,41 +1128,41 @@ bool GEOMBase_Context::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString nam //===================================================================================== bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)& anIO) { - SALOME_Selection* Sel = SALOME_Selection::Selection( myActiveStudy->getSelection() ); - if ( !( !mySettings_AddInStudy || selection ) ) { + SALOME_Selection* Sel = SALOME_Selection::Selection(myActiveStudy->getSelection()); + if (!(!mySettings_AddInStudy || selection)) { Sel->ClearIObjects(); } - SALOMEDS::Study_var aStudy = myActiveStudy->getStudyDocument(); - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributePixMap_var aPixmap; - SALOMEDS::AttributeIOR_var anIOR; + SALOMEDS::Study_var aStudy = myActiveStudy->getStudyDocument(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::GenericAttribute_var anAttr; + SALOMEDS::AttributeName_var aName; + SALOMEDS::AttributePixMap_var aPixmap; + SALOMEDS::AttributeIOR_var anIOR; SALOMEDS::AttributeSelectable_var aSelAttr; SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM"); int aLocked = false; - if (father->_is_nil()) { - QAD_Operation* op = new SALOMEGUI_ImportOperation( myActiveStudy ); + if(father->_is_nil()) { + QAD_Operation* op = new SALOMEGUI_ImportOperation(myActiveStudy); op->start(); aLocked = aStudy->GetProperties()->IsLocked(); - if (aLocked) aStudy->GetProperties()->SetLocked(false); + if(aLocked) + aStudy->GetProperties()->SetLocked(false); father = aStudyBuilder->NewComponent("GEOM"); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - // aName->SetValue( tr("GEOM_MEN_COMPONENT") ); - aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) ); + aName->SetValue( QAD_Application::getDesktop()->getComponentUserName("GEOM")); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" ); - if (aLocked) aStudy->GetProperties()->SetLocked(true); + aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry"); + if (aLocked) + aStudy->GetProperties()->SetLocked(true); op->finish(); } -// if (aLocked) return false; - aStudyBuilder->DefineComponentInstance( father, myComponentGeom ); - father->ComponentIOR( myFatherior ); + aStudyBuilder->DefineComponentInstance(father, myComponentGeom); + father->ComponentIOR(myFatherior); SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myActiveStudy->getActiveStudyFrame()->entry()); @@ -1190,20 +1172,20 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv bool found = false; // VTK - if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { + if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { vtkRenderer *Renderer = ((VTKViewer_ViewFrame*)myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer(); vtkActorCollection* theActors = Renderer->GetActors(); theActors->InitTraversal(); vtkActor *ac = theActors->GetNextActor(); while(!(ac==NULL)) { - if ( ac->IsA("GEOM_Actor") ) { - GEOM_Actor* anActor = GEOM_Actor::SafeDownCast( ac ); - if ( anActor->hasIO() ) { + if(ac->IsA("GEOM_Actor")) { + GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(ac); + if(anActor->hasIO()) { Handle(SALOME_InteractiveObject) IO = anActor->getIO(); - if ( IO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - GIO = Handle(GEOM_InteractiveObject)::DownCast( IO ); - if ( anIO->isSame( GIO ) ) { + if(IO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) { + GIO = Handle(GEOM_InteractiveObject)::DownCast(IO); + if(anIO->isSame(GIO)) { found = true; GActor = anActor; break; @@ -1214,25 +1196,25 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv ac = theActors->GetNextActor(); } - if ( !found ) + if(!found) return false; } // OCC - else if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { + else if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); AIS_ListOfInteractive List; ic->DisplayedObjects(List); AIS_ListIteratorOfListOfInteractive ite(List); - while (ite.More()) { - if (ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) { + while(ite.More()) { + if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) { Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value()); - if ( aSh->hasIO() ) { + if(aSh->hasIO()) { Handle(SALOME_InteractiveObject) IO = aSh->getIO(); - if ( IO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject)) ) { - GIO = Handle(GEOM_InteractiveObject)::DownCast( IO ); - if ( anIO->isSame( GIO ) ) { + if ( IO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) { + GIO = Handle(GEOM_InteractiveObject)::DownCast(IO); + if(anIO->isSame(GIO)) { found = true; GAISShape = aSh; break; @@ -1243,37 +1225,35 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv ite.Next(); } - if ( !found ) + if(!found) return false; } - if ( !mySettings_AddInStudy || selection ) { - QString Name = SALOMEGUI_NameDlg::getName( QAD_Application::getDesktop(), anIO->getName() ); - if ( !Name.isEmpty() ) { + if(!mySettings_AddInStudy || selection) { + QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName()); + if(!Name.isEmpty()) { // VTK - if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { - GActor->setName( strdup(Name.latin1()) ); - } + if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) + GActor->setName(strdup(Name.latin1())); // OCC - else if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - GAISShape->setName( strdup(Name.latin1()) ); - } - } else { + else if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) + GAISShape->setName(strdup(Name.latin1())); + } + else return false; - } } // open transaction - QAD_Operation* op = new SALOMEGUI_ImportOperation( myActiveStudy ); + QAD_Operation* op = new SALOMEGUI_ImportOperation(myActiveStudy); op->start(); SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(father); - GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( GIO->getIOR() ); + GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString(GIO->getIOR()); /* For the shape inserted into the study we set its field 'studyshapeid' */ /* so the shape will contain its corresponding entry in the study Ocaf doc. */ - aShape->StudyShapeId(newObj->GetID()) ; + aShape->StudyShapeId(newObj->GetID()); GIO->setEntry(newObj->GetID()); @@ -1286,32 +1266,31 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - if ( aShape->ShapeType() == GEOM::COMPOUND ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPOUND" ); - } else if ( aShape->ShapeType() == GEOM::COMPSOLID ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPSOLID" ); - } else if ( aShape->ShapeType() == GEOM::SOLID ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_SOLID" ); - } else if ( aShape->ShapeType() == GEOM::SHELL ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_SHELL" ); - } else if ( aShape->ShapeType() == GEOM::FACE ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_FACE" ); - } else if ( aShape->ShapeType() == GEOM::WIRE ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_WIRE" ); - } else if ( aShape->ShapeType() == GEOM::EDGE ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_EDGE" ); - } else if ( aShape->ShapeType() == GEOM::VERTEX ) { - aPixmap->SetPixMap( "ICON_OBJBROWSER_VERTEX" ); - } + if(aShape->ShapeType() == GEOM::COMPOUND) + aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND"); + else if(aShape->ShapeType() == GEOM::COMPSOLID) + aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID"); + else if(aShape->ShapeType() == GEOM::SOLID) + aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID"); + else if(aShape->ShapeType() == GEOM::SHELL) + aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL"); + else if(aShape->ShapeType() == GEOM::FACE) + aPixmap->SetPixMap("ICON_OBJBROWSER_FACE"); + else if(aShape->ShapeType() == GEOM::WIRE) + aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE"); + else if(aShape->ShapeType() == GEOM::EDGE) + aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE"); + else if(aShape->ShapeType() == GEOM::VERTEX) + aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX"); // VTK - if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { - GActor->setIO( GIO ); + if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { + GActor->setIO(GIO); aName->SetValue(GActor->getName()); } // OCC - else if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - GAISShape->setIO( GIO ); + else if(myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { + GAISShape->setIO(GIO); aName->SetValue(GAISShape->getName()); } @@ -1321,7 +1300,7 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv GEOM::GEOM_Gen::ListOfIOR_var listIOR = new GEOM::GEOM_Gen::ListOfIOR; listIOR = myComponentGeom->GetReferencedObjects(aShape); - if (listIOR->length()>0) { + if(listIOR->length()>0) { SALOMEDS::SObject_var Arguments = aStudyBuilder->NewObject(newObj); anAttr = aStudyBuilder->FindOrCreateAttribute(Arguments, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); @@ -1334,30 +1313,25 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv for (unsigned int ind = 0; ind < listIOR->length();ind++) { SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(listIOR[ind]); - if ( !theObj->_is_nil() ) { + if(!theObj->_is_nil()) { SALOMEDS::SObject_var RefObject = aStudyBuilder->NewObject(Arguments); aStudyBuilder->Addreference(RefObject, theObj); ObjectReferenced = true; } } - if ( !ObjectReferenced ) + if(!ObjectReferenced) aStudyBuilder->RemoveObject(Arguments); } - op->finish(); - - if ( !mySettings_AddInStudy || selection ) { + if(!mySettings_AddInStudy || selection) myActiveStudy->updateObjBrowser(); - } else { + else { myActiveStudy->updateObjBrowser(false); - Sel->AddIObject( GIO ); + Sel->AddIObject(GIO); } - - // MESSAGE ( " highlihght done" ) return true; - } @@ -1365,25 +1339,23 @@ bool GEOMBase_Context::AddInStudy(bool selection, const Handle(SALOME_Interactiv // function : GetShapeFromIOR() // purpose : exist also as static method ! //===================================================================================== -TopoDS_Shape GEOMBase_Context::GetShapeFromIOR( QString IOR ) +TopoDS_Shape GEOMBase_Context::GetShapeFromIOR(QString IOR) { TopoDS_Shape result; - if( IOR.stripWhiteSpace().isEmpty() ) + if(IOR.stripWhiteSpace().isEmpty()) return result; - ORB_INIT &init = *SINGLETON_::Instance() ; + ORB_INIT &init = *SINGLETON_::Instance(); CORBA::ORB_var& _orb = init.orb() ; - CORBA::Object_var obj = _orb->string_to_object( (char*)(IOR.latin1()) ); - if ( CORBA::is_nil( obj ) ) + CORBA::Object_var obj = _orb->string_to_object((char*)(IOR.latin1())); + if(CORBA::is_nil(obj)) return result; - GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString( IOR ); - if (!aShape->_is_nil()) { - result = myShapeReader.GetShape( myComponentGeom, aShape ); - } + GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString(IOR); + if(!aShape->_is_nil()) + result = myShapeReader.GetShape(myComponentGeom, aShape); return result; } - //======================================================================= // function : Parameter() // purpose : return a parameter (float) from a dialog box diff --git a/src/GEOMBase/GEOMBase_Display.cxx b/src/GEOMBase/GEOMBase_Display.cxx index 79d17e78c..653849a7a 100644 --- a/src/GEOMBase/GEOMBase_Display.cxx +++ b/src/GEOMBase/GEOMBase_Display.cxx @@ -69,7 +69,7 @@ bool GEOMBase_Display::OnGUIEvent(int theCommandID, QAD_Desktop* parent) { switch (theCommandID) { - case 6021: // SHADING/WIREFRAME - MENU + case 211: // SHADING/WIREFRAME - MENU { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { QApplication::setOverrideCursor(waitCursor); @@ -79,11 +79,11 @@ bool GEOMBase_Display::OnGUIEvent(int theCommandID, QAD_Desktop* parent) int themode = myRenderInter->GetDisplayMode(); if(themode==0) { myRenderInter->SetDisplayMode(1); - myGeomGUI->GetDesktop()->menuBar()->changeItem(6021, tr("GEOM_MEN_WIREFRAME")); + myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME")); } else { myRenderInter->SetDisplayMode(0); - myGeomGUI->GetDesktop()->menuBar()->changeItem(6021, tr("GEOM_MEN_SHADING")); + myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING")); } QApplication::restoreOverrideCursor(); @@ -113,15 +113,15 @@ bool GEOMBase_Display::OnGUIEvent(int theCommandID, QAD_Desktop* parent) ic->SetDisplayMode(newmode, Standard_False); if(newmode == 1) - myGeomGUI->GetDesktop()->menuBar()->changeItem(6021, tr("GEOM_MEN_WIREFRAME")); + myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME")); else - myGeomGUI->GetDesktop()->menuBar()->changeItem(6021, tr("GEOM_MEN_SHADING")); + myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING")); QApplication::restoreOverrideCursor(); } break; } - case 6022: // DISPLAY ALL - MENU + case 212: // DISPLAY ALL - MENU { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll(); @@ -129,7 +129,7 @@ bool GEOMBase_Display::OnGUIEvent(int theCommandID, QAD_Desktop* parent) this->OnDisplayAll(); break; } - case 6024: // ERASE ALL - MENU + case 214: // ERASE ALL - MENU { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->EraseAll(); @@ -276,7 +276,7 @@ void GEOMBase_Display::OnDisplayAll(bool onlyPreviousDisplayedObject) //===================================================================================== void GEOMBase_Display::OnVTKDisplayOnly() { - QApplication::setOverrideCursor( Qt::waitCursor ); + QApplication::setOverrideCursor(Qt::waitCursor); // Erase all not selected actors vtkRenderer* aren = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer(); @@ -307,7 +307,7 @@ void GEOMBase_Display::OnVTKDisplayOnly() Handle(SALOME_InteractiveObject) IObject = It.Value(); SALOMEDS::SObject_var obj = aStudy->FindObjectID( IObject->getEntry() ); - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); + VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); if(myRenderInter->isInViewer(IObject)) { myRenderInter->Display(IObject); diff --git a/src/GEOMBase/GEOMBase_NbIsosDlg.cxx b/src/GEOMBase/GEOMBase_NbIsosDlg.cxx index 1827bc487..bee45b30b 100644 --- a/src/GEOMBase/GEOMBase_NbIsosDlg.cxx +++ b/src/GEOMBase/GEOMBase_NbIsosDlg.cxx @@ -44,16 +44,16 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg(QWidget* parent, const char* name, bool modal, WFlags fl) + :QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - if ( !name ) - setName( "GEOMBase_NbIsosDlg" ); - setCaption( name ); - setSizeGripEnabled( TRUE ); - QGridLayout* MyDialogLayout = new QGridLayout( this ); - MyDialogLayout->setSpacing( 6 ); - MyDialogLayout->setMargin( 11 ); + if( !name ) + setName("GEOMBase_NbIsosDlg"); + setCaption(name); + setSizeGripEnabled(TRUE); + QGridLayout* MyDialogLayout = new QGridLayout(this); + MyDialogLayout->setSpacing(6); + MyDialogLayout->setMargin(11); /***************************************************************/ QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); @@ -109,18 +109,18 @@ GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg( QWidget* parent, const char* name, bool GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); /***************************************************************/ - MyDialogLayout->addWidget( GroupC1, 0, 0 ); - MyDialogLayout->addWidget( GroupButtons, 1, 0 ); + MyDialogLayout->addWidget(GroupC1, 0, 0); + MyDialogLayout->addWidget(GroupButtons, 1, 0); /* Retrieve GeomGUI */ - myGeomGUI = GEOMBase_Context::GetGeomGUI() ; + myGeomGUI = GEOMBase_Context::GetGeomGUI(); // signals and slots connections - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); /* Move widget on the botton right corner of main widget */ - QAD_Tools::centerWidget( this, parent ); + QAD_Tools::centerWidget(this, parent); } @@ -132,4 +132,3 @@ GEOMBase_NbIsosDlg::~GEOMBase_NbIsosDlg() { // no need to delete child widgets, Qt does it all for us } - diff --git a/src/GEOMBase/GEOMBase_NbIsosDlg.h b/src/GEOMBase/GEOMBase_NbIsosDlg.h index 392662718..ce87260d3 100644 --- a/src/GEOMBase/GEOMBase_NbIsosDlg.h +++ b/src/GEOMBase/GEOMBase_NbIsosDlg.h @@ -45,17 +45,18 @@ class GEOMBase_NbIsosDlg : public QDialog Q_OBJECT public: - GEOMBase_NbIsosDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + GEOMBase_NbIsosDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~GEOMBase_NbIsosDlg(); - GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */ + GEOMBase_Context* myGeomGUI; /* Current GeomGUI object */ + + QPushButton* buttonOk; + QPushButton* buttonCancel; + QLabel* TextLabel1; + QLabel* TextLabel2; + QSpinBox* SpinBoxU; + QSpinBox* SpinBoxV; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QLabel* TextLabel1 ; - QLabel* TextLabel2 ; - QSpinBox* SpinBoxU ; - QSpinBox* SpinBoxV ; }; #endif // GEOMETRYGUI_NBISOSDLG_H diff --git a/src/GEOMBase/GEOMBase_Sketcher.cxx b/src/GEOMBase/GEOMBase_Sketcher.cxx index d30ecba6a..a08814eac 100644 --- a/src/GEOMBase/GEOMBase_Sketcher.cxx +++ b/src/GEOMBase/GEOMBase_Sketcher.cxx @@ -78,7 +78,7 @@ bool GEOMBase_Sketcher::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 312: // SKETCHER + case 404: // SKETCHER { ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002 @@ -87,111 +87,126 @@ bool GEOMBase_Sketcher::OnGUIEvent(int theCommandID, QAD_Desktop* parent) mySketcher = Sketch(v3d->getViewer3d()); myGeomGUI->SetState(CURRENT_SKETCH); - QMenuItem* item = Mb->findItem(10010, &pp); - mySketcher.SetParameterVisibility(LENGTH_PARAMETER, pp->isItemChecked(10010)); - item = Mb->findItem(10011, &pp); - mySketcher.SetParameterVisibility(ANGLE_PARAMETER, pp->isItemChecked(10011)); - item = Mb->findItem(10012, &pp); - mySketcher.SetParameterVisibility(RADIUS_PARAMETER, pp->isItemChecked(10012)); - item = Mb->findItem(10013, &pp); - mySketcher.SetParameterVisibility(XVALUE_PARAMETER, pp->isItemChecked(10013)); - item = Mb->findItem(10014, &pp); - mySketcher.SetParameterVisibility(YVALUE_PARAMETER, pp->isItemChecked(10014)); + QMenuItem* item = Mb->findItem(4061, &pp); + mySketcher.SetParameterVisibility(LENGTH_PARAMETER, pp->isItemChecked(4061)); + item = Mb->findItem(4062, &pp); + mySketcher.SetParameterVisibility(ANGLE_PARAMETER, pp->isItemChecked(4062)); + item = Mb->findItem(4063, &pp); + mySketcher.SetParameterVisibility(RADIUS_PARAMETER, pp->isItemChecked(4063)); + item = Mb->findItem(4064, &pp); + mySketcher.SetParameterVisibility(XVALUE_PARAMETER, pp->isItemChecked(4064)); + item = Mb->findItem(4065, &pp); + mySketcher.SetParameterVisibility(YVALUE_PARAMETER, pp->isItemChecked(4065)); mySketcher.SetTransitionStatus(NOCONSTRAINT); - item = Mb->findItem(3133, &pp); - pp->setItemChecked(3133, false); - item = Mb->findItem(3134, &pp); - pp->setItemChecked(3134, false); + item = Mb->findItem(4052, &pp); + pp->setItemChecked(4052, false); + item = Mb->findItem(4053, &pp); + pp->setItemChecked(4053, false); break; } - case 3133: // sketcher - { - QMenuItem* item = Mb->findItem(3133, &pp); - pp->setItemChecked(3133, !pp->isItemChecked(3133)); - if (pp->isItemChecked(3133) == true) - mySketcher.SetTransitionStatus(TANGENT); - else - mySketcher.SetTransitionStatus(NOCONSTRAINT); - - pp->setItemChecked(3134, false); - break; - } - case 3134: // sketcher - { - QMenuItem* item = Mb->findItem(3134, &pp); - pp->setItemChecked(3134,!pp->isItemChecked(3134)); - if (pp->isItemChecked(3134) == true) - mySketcher.SetTransitionStatus(PERPENDICULAR); - else - mySketcher.SetTransitionStatus(NOCONSTRAINT); - - pp->setItemChecked(3133, false); - break; - } - case 10000 : // SKETCH Segment + case 4041: // SKETCH Segment { mySketcher.ChangeMode(SEGMENT); break; } - case 10001 : // SKETCH Arc + case 4042: // SKETCH Arc { mySketcher.ChangeMode(ARC_CHORD); break; } - case 10002 : // SKETCH Set Angle + case 4043: // SKETCH Set Angle { OnSketchSetAngle(); break; } - case 10003 : // SKETCH Set X + case 4044: // SKETCH Set X { OnSketchSetx(); break; } - case 10004 : // SKETCH Set Y + case 4045: // SKETCH Set Y { OnSketchSety(); break; } - case 10006 : // SKETCH Delete + case 4046: // SKETCH Delete { OnSketchDelete(); break; } - case 10007 : // SKETCH End + case 4047: // SKETCH End { OnSketchEnd(); break; } - case 10008 : // SKETCH Close + case 4048: // SKETCH Close { OnSketchClose(); break; } - case 10010 : // SKETCH OptionsOnofflengthdimension + case 4051: // sketcher Set Plane { - OnSketchOptionsOnofflengthdimension(); + //TO DO + break; + } + case 4052: // sketcher TANGENT + { + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID)); + if(pp->isItemChecked(theCommandID) == true) + mySketcher.SetTransitionStatus(TANGENT); + else + mySketcher.SetTransitionStatus(NOCONSTRAINT); + + pp->setItemChecked(4053, false); break; } - case 10011 : // SKETCH OptionsOnoffangledimension + case 4053: // sketcher PERPENDICULAR { - OnSketchOptionsOnoffangledimension(); + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID,!pp->isItemChecked(theCommandID)); + if(pp->isItemChecked(theCommandID) == true) + mySketcher.SetTransitionStatus(PERPENDICULAR); + else + mySketcher.SetTransitionStatus(NOCONSTRAINT); + + pp->setItemChecked(4052, false); + break; + } + case 4061: // SKETCH OptionsOnofflengthdimension + { + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID)); + mySketcher.SetParameterVisibility(LENGTH_PARAMETER, pp->isItemChecked(theCommandID)); + break; + } + case 4062: // SKETCH OptionsOnoffangledimension + { + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID)); + mySketcher.SetParameterVisibility(ANGLE_PARAMETER, pp->isItemChecked(theCommandID)); break; } - case 10012 : // SKETCH OptionsOnoffradiusdimension + case 4063: // SKETCH OptionsOnoffradiusdimension { - OnSketchOptionsOnoffradiusdimension(); + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID)); + mySketcher.SetParameterVisibility(RADIUS_PARAMETER, pp->isItemChecked(theCommandID)); break; } - case 10013 : // SKETCH OptionsOnoffxdimension + case 4064: // SKETCH OptionsOnoffxdimension { - OnSketchOptionsOnoffxdimension(); + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID)); + mySketcher.SetParameterVisibility(XVALUE_PARAMETER, pp->isItemChecked(theCommandID)); break; } - case 10014 : // SKETCH OptionsOnoffydimension + case 4065: // SKETCH OptionsOnoffydimension { - OnSketchOptionsOnoffydimension(); + QMenuItem* item = Mb->findItem(theCommandID, &pp); + pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID)); + mySketcher.SetParameterVisibility(YVALUE_PARAMETER, pp->isItemChecked(theCommandID)); break; } default: @@ -221,10 +236,10 @@ void GEOMBase_Sketcher::OnSketchSetAngle() mySketcher.SetSegmentAngle(anAngle); QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(3133, &pp); - pp->setItemChecked(3133, false); - item = Mb->findItem(3134, &pp); - pp->setItemChecked(3134, false); + QMenuItem* item = Mb->findItem(4052, &pp); + pp->setItemChecked(4052, false); + item = Mb->findItem(4053, &pp); + pp->setItemChecked(4053, false); } return; } @@ -243,10 +258,10 @@ void GEOMBase_Sketcher::OnSketchSetx() mySketcher.SetXDimension(X); QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(3133, &pp); - pp->setItemChecked(3133, false); - item = Mb->findItem(3134, &pp); - pp->setItemChecked(3134, false); + QMenuItem* item = Mb->findItem(4052, &pp); + pp->setItemChecked(4052, false); + item = Mb->findItem(4053, &pp); + pp->setItemChecked(4053, false); return; } @@ -264,10 +279,10 @@ void GEOMBase_Sketcher::OnSketchSety() mySketcher.SetYDimension(Y); QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(3133, &pp); - pp->setItemChecked(3133, false); - item = Mb->findItem(3134, &pp); - pp->setItemChecked(3134, false); + QMenuItem* item = Mb->findItem(4052, &pp); + pp->setItemChecked(4052, false); + item = Mb->findItem(4053, &pp); + pp->setItemChecked(4053, false); return; } @@ -281,8 +296,8 @@ void GEOMBase_Sketcher::OnSketchDelete() if(mySketcher.GetmyEdgesNumber() == 1) { QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(313, &pp); - pp->setItemEnabled(313, false); // SKETCH CONTRAINTS + QMenuItem* item = Mb->findItem(406, &pp); + pp->setItemEnabled(406, false); // SKETCH CONTRAINTS mySketcher.SetTransitionStatus(NOCONSTRAINT); } @@ -375,8 +390,8 @@ void GEOMBase_Sketcher::OnSketchClose() myGeomGUI->ResetState(); QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(313, &pp); - pp->setItemEnabled(313, false); // SKETCH CONTRAINTS + QMenuItem* item = Mb->findItem(406, &pp); + pp->setItemEnabled(406, false); // SKETCH CONTRAINTS mySketcher.SetTransitionStatus(NOCONSTRAINT); return; } @@ -465,83 +480,8 @@ void GEOMBase_Sketcher::OnSketchEnd() myGeomGUI->ResetState(); QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(313, &pp); - pp->setItemEnabled(313, false); // SKETCH CONTRAINTS + QMenuItem* item = Mb->findItem(406, &pp); + pp->setItemEnabled(406, false); // SKETCH CONTRAINTS mySketcher.SetTransitionStatus(NOCONSTRAINT); return; } - - -//======================================================================= -// function : OnSketchOptionsOnoffangledimension() -// purpose : -//======================================================================= -void GEOMBase_Sketcher::OnSketchOptionsOnoffangledimension() -{ - QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); - QMenuData* pp; - QMenuItem* item = Mb->findItem(10011, &pp); - pp->setItemChecked(10011, !pp->isItemChecked(10011)); - mySketcher.SetParameterVisibility(ANGLE_PARAMETER, pp->isItemChecked(10011)); - return; -} - - -//======================================================================= -// function : OnSketchOptionsOnofflengthdimension() -// purpose : -//======================================================================= -void GEOMBase_Sketcher::OnSketchOptionsOnofflengthdimension() -{ - QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); - QMenuData* pp; - QMenuItem* item = Mb->findItem(10010, &pp); - pp->setItemChecked(10010, !pp->isItemChecked(10010)); - mySketcher.SetParameterVisibility(LENGTH_PARAMETER, pp->isItemChecked(10010)); - return; -} - - -//======================================================================= -// function : OnSketchOptionsOnoffradiusdimension() -// purpose : -//======================================================================= -void GEOMBase_Sketcher::OnSketchOptionsOnoffradiusdimension() -{ - QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); - QMenuData* pp; - QMenuItem* item = Mb->findItem(10012, &pp); - pp->setItemChecked(10012, !pp->isItemChecked(10012)); - mySketcher.SetParameterVisibility(RADIUS_PARAMETER, pp->isItemChecked(10012)); - return; -} - - -//======================================================================= -// function : OnSketchOptionsOnoffxdimension() -// purpose : -//======================================================================= -void GEOMBase_Sketcher::OnSketchOptionsOnoffxdimension() -{ - QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); - QMenuData* pp; - QMenuItem* item = Mb->findItem(10013, &pp); - pp->setItemChecked(10013, !pp->isItemChecked(10013)); - mySketcher.SetParameterVisibility(XVALUE_PARAMETER, pp->isItemChecked(10013)); - return; -} - - -//======================================================================= -// function : OnSketchOptionsOnoffydimension() -// purpose : -//======================================================================= -void GEOMBase_Sketcher::OnSketchOptionsOnoffydimension() -{ - QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); - QMenuData* pp; - QMenuItem* item = Mb->findItem(10014, &pp); - pp->setItemChecked(10014, !pp->isItemChecked(10014)); - mySketcher.SetParameterVisibility(YVALUE_PARAMETER, pp->isItemChecked(10014)); - return; -} diff --git a/src/GEOMBase/GEOMBase_Sketcher.h b/src/GEOMBase/GEOMBase_Sketcher.h index 5e794839f..0b657e8a6 100644 --- a/src/GEOMBase/GEOMBase_Sketcher.h +++ b/src/GEOMBase/GEOMBase_Sketcher.h @@ -53,12 +53,6 @@ public : void OnSketchDelete(); void OnSketchClose(); void OnSketchEnd(); - - void OnSketchOptionsOnoffangledimension(); - void OnSketchOptionsOnofflengthdimension(); - void OnSketchOptionsOnoffradiusdimension(); - void OnSketchOptionsOnoffxdimension(); - void OnSketchOptionsOnoffydimension(); private: GEOMBase_Context* myGeomGUI; diff --git a/src/GEOMBase/GEOMBase_Tools.cxx b/src/GEOMBase/GEOMBase_Tools.cxx index 57c95c919..11bae7c38 100644 --- a/src/GEOMBase/GEOMBase_Tools.cxx +++ b/src/GEOMBase/GEOMBase_Tools.cxx @@ -84,9 +84,6 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) myGeomGUI->EmitSignalDeactivateDialog(); SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection()); - QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); - QMenuData* pp; - SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); @@ -147,25 +144,29 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) myGeomGUI->ResetState(); break; } - case 701: // SETTINGS - COPY + case 411: // SETTINGS - COPY { - QMenuItem* item = parent->menuBar()->findItem(701, &pp); - bool check = !pp->isItemChecked(701); - pp->setItemChecked(701, check); + QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); + QMenuData* pp; + QMenuItem* item = parent->menuBar()->findItem(411, &pp); + bool check = !pp->isItemChecked(411); + pp->setItemChecked(411, check); myGeomGUI->GetSettings_Copy() = check; QAD_CONFIG->addSetting("Geometry:SettingsCopy", myGeomGUI->GetSettings_Copy()); break; } - case 702: // SETTINGS - ADD IN STUDY + case 412: // SETTINGS - ADD IN STUDY { - QMenuItem* item = parent->menuBar()->findItem(702, &pp); - bool check = !pp->isItemChecked(702); - pp->setItemChecked(702,check); + QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar(); + QMenuData* pp; + QMenuItem* item = parent->menuBar()->findItem(412, &pp); + bool check = !pp->isItemChecked(412); + pp->setItemChecked(412,check); myGeomGUI->GetSettings_AddInStudy() = check; QAD_CONFIG->addSetting("Geometry:SettingsAddInStudy", myGeomGUI->GetSettings_AddInStudy()); break; } - case 703: // SETTINGS - SHADING COLOR + case 413: // SETTINGS - SHADING COLOR { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) break; @@ -212,7 +213,7 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) } break; } - case 704: // SETTINGS - ISOS + case 414: // SETTINGS - ISOS { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) break; @@ -228,8 +229,7 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) else IsoV = "1"; - GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(myGeomGUI->GetDesktop(), - tr("GEOM_MEN_ISOS"), TRUE); + GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(myGeomGUI->GetDesktop(), tr("GEOM_MEN_ISOS"), TRUE); int UIso = IsoU.toInt(); int VIso = IsoV.toInt(); @@ -270,7 +270,7 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) ic->UpdateCurrentViewer(); break; } - case 705: // SETTINGS : STEP VALUE FOR SPIN BOXES + case 415: // SETTINGS : STEP VALUE FOR SPIN BOXES { QString step = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); if(step.isEmpty()) @@ -288,7 +288,7 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) parent->putInfo(tr("GEOM_PRP_ABORT")); break; } - case 801: // ADD IN STUDY - POPUP VIEWER + case 804: // ADD IN STUDY - POPUP VIEWER { const SALOME_ListIO& ListSelected = Sel->StoredIObjects(); SALOME_ListIteratorOfListIO It(ListSelected); @@ -558,7 +558,7 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) } break; } - case 5001: // CHECK GEOMETRY + case 5103: // CHECK GEOMETRY { QAD_PyEditor* PyEditor = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getPyEditor(); PyEditor->setText("from GEOM_usinggeom import *\n"); @@ -566,7 +566,7 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) PyEditor->handleReturn(); break; } - case 8031: // COLOR - POPUP VIEWER + case 8032: // COLOR - POPUP VIEWER { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { // VTK @@ -621,12 +621,12 @@ bool GEOMBase_Tools::OnGUIEvent(int theCommandID, QAD_Desktop* parent) QApplication::restoreOverrideCursor(); break; } - case 8032: // TRANSPARENCY - POPUP VIEWER + case 8033: // TRANSPARENCY - POPUP VIEWER { GEOMBase_TransparencyDlg *aDlg = new GEOMBase_TransparencyDlg(parent, "", Sel, ic); break; } - case 8033: // ISOS - POPUP VIEWER + case 8034: // ISOS - POPUP VIEWER { if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) break; diff --git a/src/GEOMBase/GEOMBase_TransparencyDlg.cxx b/src/GEOMBase/GEOMBase_TransparencyDlg.cxx index 9930c20e7..c80538ce4 100644 --- a/src/GEOMBase/GEOMBase_TransparencyDlg.cxx +++ b/src/GEOMBase/GEOMBase_TransparencyDlg.cxx @@ -54,22 +54,17 @@ using namespace std; // : WARNING : this dialog is modal ! // //================================================================================= -GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg( QWidget* parent, - const char* name, - SALOME_Selection* Sel, - const Handle(AIS_InteractiveContext)& ic, - bool modal, - WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic, bool modal, WFlags fl) + :QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - if ( !name ) - setName( "GEOMBase_TransparencyDlg" ); - resize( 152, 107 ); - setCaption( tr( "GEOM_TRANSPARENCY_TITLE" ) ); - setSizeGripEnabled( TRUE ); - GEOMBase_TransparencyDlgLayout = new QGridLayout( this ); - GEOMBase_TransparencyDlgLayout->setSpacing( 6 ); - GEOMBase_TransparencyDlgLayout->setMargin( 11 ); + if(!name) + setName("GEOMBase_TransparencyDlg"); + resize(152, 107); + setCaption(tr("GEOM_TRANSPARENCY_TITLE")); + setSizeGripEnabled(TRUE); + GEOMBase_TransparencyDlgLayout = new QGridLayout(this); + GEOMBase_TransparencyDlgLayout->setSpacing(6); + GEOMBase_TransparencyDlgLayout->setMargin(11); /*************************************************************************/ QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); @@ -116,35 +111,33 @@ GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg( QWidget* parent, GroupC1Layout->addMultiCellWidget( Slider1, 1, 1, 0, 2 ); /*************************************************************************/ - GEOMBase_TransparencyDlgLayout->addWidget( GroupC1, 0, 0 ); - GEOMBase_TransparencyDlgLayout->addWidget( GroupButtons, 1, 0 ); + GEOMBase_TransparencyDlgLayout->addWidget(GroupC1, 0, 0); + GEOMBase_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0); /* Initialisations */ - this->myGeomGUI = GEOMBase_Context::GetGeomGUI() ; - this->myIc = ic ; - this->mySel = Sel ; + this->myGeomGUI = GEOMBase_Context::GetGeomGUI(); + this->myIc = ic; + this->mySel = Sel; /* First call valueChanged() method for initialisation */ /* The default value of transparency will change with the selection */ - this->myFirstInit = true ; + this->myFirstInit = true; // Slider1->setMaxValue( 10 ); // Slider1->setValue( 5 ) ; - this->ValueHasChanged( Slider1->value() ) ; + this->ValueHasChanged(Slider1->value()); // signals and slots connections : after ValueHasChanged() - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( Slider1, SIGNAL( valueChanged(int) ), this, SLOT( ValueHasChanged(int) ) ); + connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(ValueHasChanged(int))); /* Move widget on the botton right corner of main widget */ int x, y ; - myGeomGUI->DefineDlgPosition( this, x, y ) ; - this->move( x, y ) ; + myGeomGUI->DefineDlgPosition(this, x, y); + this->move(x, y) ; this->show() ; /* Displays this Dialog */ } - - //================================================================================= // function : ~GEOMBase_TransparencyDlg() // purpose : @@ -161,8 +154,8 @@ GEOMBase_TransparencyDlg::~GEOMBase_TransparencyDlg() //======================================================================= void GEOMBase_TransparencyDlg::ClickOnOk() { - accept() ; - return ; + accept(); + return; } @@ -172,8 +165,8 @@ void GEOMBase_TransparencyDlg::ClickOnOk() //======================================================================= void GEOMBase_TransparencyDlg::ClickOnClose() { - accept() ; - return ; + accept(); + return; } @@ -182,68 +175,64 @@ void GEOMBase_TransparencyDlg::ClickOnClose() // purpose : Called when value of slider change // : or the first time as initilisation //================================================================================= -void GEOMBase_TransparencyDlg::ValueHasChanged( int newValue ) +void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue) { - - if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { + if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { // VTK - // vtkQGLRenderWindowInteractor* myRenderInter= myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getVTKView()->getRWInteractor(); VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); - SALOME_ListIteratorOfListIO It( this->mySel->StoredIObjects() ); + SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects()); Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject(); - if( !FirstIOS.IsNull() ) { - + if(!FirstIOS.IsNull()) { /* The first time as initialisation */ - if( this->myFirstInit ) { - this->myFirstInit = false ; - float transp = ( myRenderInter->GetTransparency(FirstIOS))*10.0 ; - this->Slider1->setValue( int(transp) ) ; + if(this->myFirstInit) { + this->myFirstInit = false; + float transp = (myRenderInter->GetTransparency(FirstIOS))*10.0; + this->Slider1->setValue(int(transp)); } } - QApplication::setOverrideCursor( Qt::waitCursor ); - for( ;It.More(); It.Next() ) { + QApplication::setOverrideCursor(Qt::waitCursor); + for(;It.More(); It.Next()) { Handle(SALOME_InteractiveObject) IOS = It.Value(); - myRenderInter->SetTransparency( IOS, newValue/10.0 ); + myRenderInter->SetTransparency(IOS, newValue/10.0); } QApplication::restoreOverrideCursor(); } - else if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { + else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { // OCC - SALOME_ListIteratorOfListIO It( this->mySel->StoredIObjects() ); - Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject() ; - if( !FirstIOS.IsNull() ) { + SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects()); + Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject(); + if(!FirstIOS.IsNull()) { /* The first time as initialisation */ - if( this->myFirstInit ) { - this->myFirstInit = false ; + if(this->myFirstInit) { + this->myFirstInit = false; Standard_Boolean found; Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(FirstIOS, found); - if( !found ) { - return ; - } - float transp = ( int( Shape->Transparency() * 10.0 + 0.001) ); - this->Slider1->setValue(int(transp) ) ; - return ; + if(!found) + return; + float transp = (int(Shape->Transparency() * 10.0 + 0.001)); + this->Slider1->setValue(int(transp)); + return; } } - QApplication::setOverrideCursor( Qt::waitCursor ); - for( ;It.More(); It.Next() ) { + QApplication::setOverrideCursor(Qt::waitCursor); + for(;It.More(); It.Next()) { Handle(SALOME_InteractiveObject) IObject = It.Value(); Standard_Boolean found; Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found); - if( !found ) { + if(!found) { QApplication::restoreOverrideCursor(); - return ; + return; } - this->myIc->SetTransparency( Shape, newValue / 10.0, false ); - myIc->Redisplay( Shape, Standard_False, Standard_True ); + this->myIc->SetTransparency(Shape, newValue / 10.0, false); + myIc->Redisplay(Shape, Standard_False, Standard_True); } myIc->UpdateCurrentViewer(); } QApplication::restoreOverrideCursor(); - return ; + return; } diff --git a/src/GEOMBase/GEOMBase_aParameterDlg.cxx b/src/GEOMBase/GEOMBase_aParameterDlg.cxx index e8e0c7fc3..a26f3c6bd 100644 --- a/src/GEOMBase/GEOMBase_aParameterDlg.cxx +++ b/src/GEOMBase/GEOMBase_aParameterDlg.cxx @@ -58,80 +58,72 @@ using namespace std; // TRUE to construct a modal dialog. // //====================================================================================== -GEOMBase_aParameterDlg::GEOMBase_aParameterDlg( const char *aValue1, - const char *aTitle1, - QWidget* parent, - const char* name, - bool modal, - WFlags fl, - const double bottom, - const double top, - const int decimals ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +GEOMBase_aParameterDlg::GEOMBase_aParameterDlg(const char *aValue1, const char *aTitle1, QWidget* parent, const char* name, bool modal, WFlags fl, const double bottom, const double top, const int decimals) + :QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - if ( !name ) + if(!name) setName( "MyParameterDialog" ); - resize( 288, 81 ); - setCaption( name ); /* appears on the title bar */ - setSizeGripEnabled( TRUE ); - - QGridLayout* topLayout = new QGridLayout( this ); - topLayout->setSpacing( 6 ); - topLayout->setMargin( 11 ); - - QGroupBox* mainGrp = new QGroupBox( this, "mainGrp" ); - mainGrp->setColumnLayout(0, Qt::Vertical ); - mainGrp->layout()->setSpacing( 0 ); - mainGrp->layout()->setMargin( 0 ); - QGridLayout* mainGrpLayout = new QGridLayout( mainGrp->layout() ); - mainGrpLayout->setAlignment( Qt::AlignTop ); - mainGrpLayout ->setSpacing( 6 ); - mainGrpLayout->setMargin( 11 ); - topLayout->addWidget( mainGrp, 0, 0 ); + resize(288, 81); + setCaption(name); /* appears on the title bar */ + setSizeGripEnabled(TRUE); + + QGridLayout* topLayout = new QGridLayout(this); + topLayout->setSpacing(6); + topLayout->setMargin(11); + + QGroupBox* mainGrp = new QGroupBox(this, "mainGrp"); + mainGrp->setColumnLayout(0, Qt::Vertical); + mainGrp->layout()->setSpacing(0); + mainGrp->layout()->setMargin(0); + QGridLayout* mainGrpLayout = new QGridLayout(mainGrp->layout()); + mainGrpLayout->setAlignment(Qt::AlignTop); + mainGrpLayout ->setSpacing(6); + mainGrpLayout->setMargin(11); + topLayout->addWidget(mainGrp, 0, 0); /* aTitle1 : text prompt on left of edit line */ - QLabel* TextLabel1 = new QLabel( mainGrp, "TextLabel1" ); - TextLabel1->setText( tr( aTitle1 ) ); - mainGrpLayout->addWidget( TextLabel1, 0, 0 ); - - mySpinBox = new QAD_SpinBoxDbl( mainGrp, "mySpinBox" ); - mySpinBox->setPrecision( 12); - mySpinBox->setRange( bottom, top ); - (( QDoubleValidator* )(mySpinBox->validator()))->setRange(bottom, top, decimals); + QLabel* TextLabel1 = new QLabel(mainGrp, "TextLabel1"); + TextLabel1->setText(tr(aTitle1)); + mainGrpLayout->addWidget(TextLabel1, 0, 0); + + mySpinBox = new QAD_SpinBoxDbl(mainGrp, "mySpinBox"); + mySpinBox->setPrecision(12); + mySpinBox->setRange(bottom, top); + ((QDoubleValidator*)(mySpinBox->validator()))->setRange(bottom, top, decimals); mySpinBox->setValue(QString(aValue1).toDouble()); - mainGrpLayout->addWidget( mySpinBox, 0, 1 ); + mainGrpLayout->addWidget(mySpinBox, 0, 1); - QGroupBox* btnGrp = new QGroupBox( this, "btnGrp" ); - btnGrp->setColumnLayout(0, Qt::Vertical ); - btnGrp->layout()->setSpacing( 0 ); - btnGrp->layout()->setMargin( 0 ); - QGridLayout* btnGrpLayout = new QGridLayout( btnGrp->layout() ); - btnGrpLayout->setAlignment( Qt::AlignTop ); - btnGrpLayout->setSpacing( 6 ); - btnGrpLayout->setMargin( 11 ); - topLayout->addWidget( btnGrp, 1, 0 ); + QGroupBox* btnGrp = new QGroupBox(this, "btnGrp"); + btnGrp->setColumnLayout(0, Qt::Vertical); + btnGrp->layout()->setSpacing(0); + btnGrp->layout()->setMargin(0); + QGridLayout* btnGrpLayout = new QGridLayout(btnGrp->layout()); + btnGrpLayout->setAlignment(Qt::AlignTop); + btnGrpLayout->setSpacing(6); + btnGrpLayout->setMargin(11); + topLayout->addWidget(btnGrp, 1, 0); /* Ok button */ - myButtonOk = new QPushButton( btnGrp, "buttonOk" ); - myButtonOk->setText( tr("GEOM_BUT_OK") ); - myButtonOk->setAutoDefault( TRUE ); - myButtonOk->setDefault( TRUE ); - btnGrpLayout->addWidget( myButtonOk, 0, 0 ); + myButtonOk = new QPushButton(btnGrp, "buttonOk"); + myButtonOk->setText(tr("GEOM_BUT_OK")); + myButtonOk->setAutoDefault(TRUE); + myButtonOk->setDefault(TRUE); + btnGrpLayout->addWidget(myButtonOk, 0, 0); - btnGrpLayout->addItem( new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1 ); + btnGrpLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); /* Cancel button */ - myButtonCancel = new QPushButton( btnGrp, "buttonCancel" ); - myButtonCancel->setText( tr("GEOM_BUT_CANCEL") ); - myButtonCancel->setAutoDefault( TRUE ); - btnGrpLayout->addWidget( myButtonCancel, 0, 2 ); + myButtonCancel = new QPushButton(btnGrp, "buttonCancel"); + myButtonCancel->setText(tr("GEOM_BUT_CANCEL")); + myButtonCancel->setAutoDefault(TRUE); + btnGrpLayout->addWidget(myButtonCancel, 0, 2); /* signals and slots connections */ - connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect(myButtonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(myButtonCancel, SIGNAL(clicked()), this, SLOT(reject())); /* Retrieve GeomGUI */ - myGeomGUI = GEOMBase_Context::GetGeomGUI() ; + myGeomGUI = GEOMBase_Context::GetGeomGUI(); /* Move widget on the botton right corner of main widget */ QAD_Tools::centerWidget(this, parent); @@ -143,18 +135,21 @@ GEOMBase_aParameterDlg::GEOMBase_aParameterDlg( const char *aValue1, // purpose : Destroys the object and frees any allocated resources //====================================================================================== GEOMBase_aParameterDlg::~GEOMBase_aParameterDlg() -{ // no need to delete child widgets, Qt does it all for us +{ + // no need to delete child widgets, Qt does it all for us } + //====================================================================================== // function : GEOMBase_aParameterDlg::setValue // purpose : sets value //====================================================================================== -void GEOMBase_aParameterDlg::setValue( double val ) +void GEOMBase_aParameterDlg::setValue(double val) { - mySpinBox->setValue( val ); + mySpinBox->setValue(val); } + //====================================================================================== // function : GEOMBase_aParameterDlg::getValue // purpose : gets value @@ -163,4 +158,3 @@ double GEOMBase_aParameterDlg::getValue() { return mySpinBox->value(); } - diff --git a/src/GEOMBase/GEOMBase_aParameterDlg.h b/src/GEOMBase/GEOMBase_aParameterDlg.h index d8d962a59..244efa952 100644 --- a/src/GEOMBase/GEOMBase_aParameterDlg.h +++ b/src/GEOMBase/GEOMBase_aParameterDlg.h @@ -45,28 +45,19 @@ class GEOMBase_aParameterDlg : public QDialog Q_OBJECT public: - GEOMBase_aParameterDlg( const char* aValue1 = "25", - const char* aTitle1 = "Value :", - QWidget* parent = 0, - const char* name = 0, - bool modal = FALSE, - WFlags fl = 0, - const double bottom = -1E6, - const double top = +1E6, - const int decimals = 6 ) ; - + GEOMBase_aParameterDlg(const char* aValue1 = "25", const char* aTitle1 = "Value :", QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const double bottom = -1E6, const double top = +1E6, const int decimals = 6); ~GEOMBase_aParameterDlg(); - void setValue( double val ); + void setValue(double val); double getValue(); private: - GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */ + GEOMBase_Context* myGeomGUI; /* Current GeomGUI object */ - QPushButton* myButtonOk; - QPushButton* myButtonCancel; + QPushButton* myButtonOk; + QPushButton* myButtonCancel; QAD_SpinBoxDbl* mySpinBox; - + }; #endif // GEOMBase_aParameterDlg.h diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 1e5d2bc54..50aaa8818 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -113,16 +113,6 @@ GeometryGUI::~GeometryGUI() } -// //======================================================================= -// // function : GetGEOMBase_Context() static -// // purpose : Returns current 'GeomGUI' a static pointer -// //======================================================================= -// GEOMBase_Context* GeometryGUI::GetGeomGUI() -// { -// return GeomGUI; -// } - - //======================================================================= // function : GetOrCreateGEOMBase() // purpose : Gets or create an object 'GEOMBase' with initialisations @@ -149,18 +139,21 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) ViewOCC = true; else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) - ViewOCC = true; + ViewOCC = false; else return false; - Mb->setItemEnabled( 312, ViewOCC);//Sketch - Mb->setItemEnabled( 309, ViewOCC);//SuppressFace - Mb->setItemEnabled( 314, ViewOCC);//SuppressHole + Mb->setItemEnabled(404, ViewOCC);//Sketch + Mb->setItemEnabled(405, ViewOCC);//Sketch + Mb->setItemEnabled(406, ViewOCC);//Sketch + + Mb->setItemEnabled(603, ViewOCC);//SuppressFace + Mb->setItemEnabled(604, ViewOCC);//SuppressHole - Mb->setItemEnabled( 703, ViewOCC);// ShadingColor Settings - Mb->setItemEnabled( 704, ViewOCC);// Isos Settings + Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings + Mb->setItemEnabled(414, ViewOCC);// Isos Settings - if (GeomGUI->GetState() == CURRENT_SKETCH && theCommandID != 10000 && theCommandID != 10001 && theCommandID != 10002 && theCommandID != 10003 && theCommandID != 10004 && theCommandID != 10006 && theCommandID != 10007 && theCommandID != 10008 && theCommandID != 10010 && theCommandID != 10011 && theCommandID != 10012 && theCommandID != 10013 && theCommandID != 10014 && theCommandID != 3133 && theCommandID != 3134) + if (GeomGUI->GetState() == CURRENT_SKETCH && theCommandID != 404 && theCommandID != 4041 && theCommandID != 4042 && theCommandID != 4043 && theCommandID != 4044 && theCommandID != 4045 && theCommandID != 4046 && theCommandID != 4047 && theCommandID != 4048 && theCommandID != 4051 && theCommandID != 4052 && theCommandID != 4053 && theCommandID != 4061 && theCommandID != 4062 && theCommandID != 4063 && theCommandID != 4064 && theCommandID != 4065) return false; @@ -169,42 +162,41 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) // int theCommandID_Group = theCommandID_str.toInt(); if(theCommandID == 31 || theCommandID == 33 || theCommandID == 111 || theCommandID == 112 || theCommandID == 113 || theCommandID == 121 || - theCommandID == 122 || theCommandID == 123 || theCommandID == 701 || - theCommandID == 702 || theCommandID == 703 || theCommandID == 704 || - theCommandID == 705 || theCommandID == 801 || theCommandID == 901 || - theCommandID == 903 || theCommandID == 5001 || theCommandID == 8031 || - theCommandID == 8032 || theCommandID == 8033 || theCommandID == 9024) { + theCommandID == 122 || theCommandID == 123 || theCommandID == 411 || + theCommandID == 412 || theCommandID == 413 || theCommandID == 414 || + theCommandID == 415 || theCommandID == 804 || theCommandID == 901 || + theCommandID == 903 || theCommandID == 5103 || theCommandID == 8032 || + theCommandID == 8033 || theCommandID == 8034 || theCommandID == 9024) { GEOMBase_Tools* myToolsGUI = new GEOMBase_Tools(); myToolsGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 312 || theCommandID == 3133 || theCommandID == 3134 || - theCommandID == 10000 || theCommandID == 10001 || theCommandID == 10002 || - theCommandID == 10003 || theCommandID == 10004 || theCommandID == 10006 || - theCommandID == 10007 || theCommandID == 10008 || theCommandID == 10010 || - theCommandID == 10011 || theCommandID == 10012 || theCommandID == 10013 || - theCommandID == 10014) { + if(theCommandID == 404 || theCommandID == 4041 || theCommandID == 4042 || + theCommandID == 4043 || theCommandID == 4044 || theCommandID == 4045 || + theCommandID == 4046 || theCommandID == 4047 || theCommandID == 4048 || + theCommandID == 4051 || theCommandID == 4052 || theCommandID == 4053 || + theCommandID == 4061 || theCommandID == 4062 || theCommandID == 4063 || + theCommandID == 4064 || theCommandID == 4065) { GEOMBase_Sketcher* mySketcherGUI = new GEOMBase_Sketcher(); mySketcherGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 6021 || theCommandID == 6022 || theCommandID == 6024 || + if(theCommandID == 211 || theCommandID == 212 || theCommandID == 214 || theCommandID == 8021 || theCommandID == 8022 || theCommandID == 8023 || theCommandID == 9022 || theCommandID == 9023) { GEOMBase_Display* myDisplayGUI = new GEOMBase_Display(); myDisplayGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 3011 || theCommandID == 3012 || - theCommandID == 3013 || theCommandID == 3014 || - theCommandID == 3015 || theCommandID == 3016 || - theCommandID == 3017 || theCommandID == 3018) { + if(theCommandID == 4011 || theCommandID == 4012 || theCommandID == 4013 || + theCommandID == 4014 || theCommandID == 4015 || theCommandID == 4016 || + theCommandID == 4017 || theCommandID == 4018) { BasicGUI* myBasicGUI = new BasicGUI(); myBasicGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 3021 || theCommandID == 3022 || theCommandID == 3023 || - theCommandID == 3024 || theCommandID == 3025) { + if(theCommandID == 4021 || theCommandID == 4022 || theCommandID == 4023 || + theCommandID == 4024 || theCommandID == 4025) { PrimitiveGUI* myPrimitiveGUI = new PrimitiveGUI(); myPrimitiveGUI->OnGUIEvent(theCommandID, parent); return true; @@ -215,39 +207,40 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) myGenerationGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 303 || theCommandID == 304 || theCommandID == 305 || - theCommandID == 306 || theCommandID == 308 || theCommandID == 315 || - theCommandID == 316) { + if(theCommandID == 407 || theCommandID == 4081 || theCommandID == 4082 || + theCommandID == 4083 || theCommandID == 4084 || theCommandID == 4085 || + theCommandID == 4086) { BuildGUI* myBuildGUI = new BuildGUI(); myBuildGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 4011 || theCommandID == 4012 || - theCommandID == 4013 || theCommandID == 4014) { + if(theCommandID == 5011 || theCommandID == 5012 || + theCommandID == 5013 || theCommandID == 5014) { BooleanGUI* myBooleanGUI = new BooleanGUI(); myBooleanGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 4021 || theCommandID == 4022 || theCommandID == 4023 || - theCommandID == 4024 || theCommandID == 4030 || theCommandID == 4040) { + if(theCommandID == 5021 || theCommandID == 5022 || theCommandID == 5023 || + theCommandID == 5024 || theCommandID == 5025 || theCommandID == 5026) { TransformationGUI* myTransformationGUI = new TransformationGUI(); myTransformationGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 501 || theCommandID == 502) { + if(theCommandID == 503 || theCommandID == 504 || + theCommandID == 505 || theCommandID == 506) { OperationGUI* myOperationGUI = new OperationGUI(); myOperationGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 501 || theCommandID == 502 || - theCommandID == 309 || theCommandID == 314) { + if(theCommandID == 601 || theCommandID == 602 || + theCommandID == 603 || theCommandID == 604) { RepairGUI* myRepairGUI = new RepairGUI(); myRepairGUI->OnGUIEvent(theCommandID, parent); return true; } - if(theCommandID == 601 || theCommandID == 604 || theCommandID == 605 || - theCommandID == 6060 || theCommandID == 6061 || - theCommandID == 607 || theCommandID == 608 || theCommandID == 609) { + if(theCommandID == 701 || theCommandID == 702 || theCommandID == 703 || + theCommandID == 7041 || theCommandID == 7042 || + theCommandID == 705 || theCommandID == 706 || theCommandID == 707) { MeasureGUI* myMeasureGUI = new MeasureGUI(); myMeasureGUI->OnGUIEvent(theCommandID, parent); return true; @@ -288,45 +281,40 @@ bool GeometryGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr /* Get the clicked or selected point */ gp_Pnt thePoint; - if (GeomGUI->GetState() == CURRENT_SKETCH) { + if(GeomGUI->GetState() == CURRENT_SKETCH) { GeomGUI->GetSketcher().ValidateEdge(); - if (GeomGUI->GetSketcher().GetmyEdgesNumber() == 1 ) { + if(GeomGUI->GetSketcher().GetmyEdgesNumber() == 1) { QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar(); QMenuData* pp; - QMenuItem* item = Mb->findItem(313,&pp); - pp->setItemEnabled( 313, true); // SKETCH CONTRAINTS + QMenuItem* item = Mb->findItem(405, &pp); + pp->setItemEnabled(405, true); // SKETCH CONTRAINTS } - } else if( GeomGUI->GetState() == POINT_METHOD ) { - - GeomGUI->EraseSimulationShape() ; - BasicGUI_PointDlg *DialogPt = (BasicGUI_PointDlg*)(GeomGUI->GetActiveDialogBox()) ; + } + else if(GeomGUI->GetState() == POINT_METHOD) { + GeomGUI->EraseSimulationShape(); + BasicGUI_PointDlg *DialogPt = (BasicGUI_PointDlg*)(GeomGUI->GetActiveDialogBox()); - if ( DialogPt->UseLocalContext() ) { + if(DialogPt->UseLocalContext()) { ic->InitSelected(); - if ( pe->state() == Qt::ShiftButton ) + if(pe->state() == Qt::ShiftButton) v3d->getAISSelector()->shiftSelect(); /* Append selection */ else v3d->getAISSelector()->select(); /* New selection */ - if ( ic->MoreSelected() ) { - thePoint = BRep_Tool::Pnt( TopoDS::Vertex(ic->SelectedShape()) ); - } + if(ic->MoreSelected()) + thePoint = BRep_Tool::Pnt( TopoDS::Vertex(ic->SelectedShape())); else - thePoint = GeomGUI->ConvertClickToPoint(pe->x(), pe->y(), ( (OCCViewer_ViewPort3d*)vp)->getView() ); + thePoint = GeomGUI->ConvertClickToPoint(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView()); } else - thePoint = GeomGUI->ConvertClickToPoint(pe->x(), pe->y(), ( (OCCViewer_ViewPort3d*)vp)->getView() ); - - if( DialogPt != 0 ) { - DialogPt->PointIntoCoordinates(thePoint, true) ; /* display point */ - } - else { - // MESSAGE ("On Mouse Press : myActiveDialogBox is null" << endl) ; + thePoint = GeomGUI->ConvertClickToPoint(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView()); + + if(DialogPt != 0) + DialogPt->PointIntoCoordinates(thePoint, true); /* display point */ + else GeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - } } - - return false ; + return false; } @@ -334,18 +322,18 @@ bool GeometryGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr // function : OnMouseMove() // purpose : [static] manage mouse events //======================================================================= -bool GeometryGUI::OnMouseMove (QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame) +bool GeometryGUI::OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame) { GeometryGUI::GetOrCreateGeometryGUI(parent); - if (GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) + if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) return false; OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort(); - if ( GeomGUI->GetState() == CURRENT_SKETCH) + if(GeomGUI->GetState() == CURRENT_SKETCH) GeomGUI->GetSketcher().MakeCurrentEdge(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView()); return true; @@ -356,15 +344,11 @@ bool GeometryGUI::OnMouseMove (QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr // function : SetSettings() // purpose : [static] //===================================================================================== -bool GeometryGUI::SetSettings( QAD_Desktop* parent ) +bool GeometryGUI::SetSettings(QAD_Desktop* parent) { GeometryGUI::GetOrCreateGeometryGUI(parent); - //DCQ parent->menuBar()->setItemEnabled( 504, false); // CORRECTING - //DCQ parent->menuBar()->setItemEnabled( 6062, false); // RADIUS - //VSR parent->menuBar()->setItemEnabled( 701, false); // AUTOMATIC COPY - parent->menuBar()->setItemEnabled( 313, false); // SKETCH CONTRAINTS - parent->menuBar()->setItemEnabled( 3131, false); // SKETCH SET PLAN + parent->menuBar()->setItemEnabled( 405, false); // SKETCH CONTRAINTS /* Shading Color */ QString SCr = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorRed"); @@ -375,61 +359,54 @@ bool GeometryGUI::SetSettings( QAD_Desktop* parent ) /* Wireframe or Shading */ int DisplayMode = 0; - if ( parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { + if(parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)parent->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); DisplayMode = ic->DisplayMode(); - } else if ( parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { + } + else if(parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)parent->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); DisplayMode = myRenderInter->GetDisplayMode(); } - if ( DisplayMode == 1 ) - parent->menuBar()->changeItem(6021, tr("GEOM_MEN_WIREFRAME") ); + if(DisplayMode == 1) + parent->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME")); else - parent->menuBar()->changeItem(6021, tr("GEOM_MEN_SHADING") ); - - /* Copy */ -// QString Copy = QAD_CONFIG->getSetting("Geometry:SettingsCopy"); -// if ( !Copy.isEmpty() ) { -// GeomGUI->GetSettings_Copy() = Copy.toInt(); -// QMenuData* pp; -// parent->menuBar()->findItem(701,&pp); -// pp->setItemChecked(701, GeomGUI->GetSettings_Copy()); -// } - QMenuData* pp; - if ( parent->menuBar()->findItem(701,&pp) ) - pp->removeItem(701); + parent->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING")); + + QMenuData* pp; + if(parent->menuBar()->findItem(411, &pp)) + pp->removeItem(411); /* Add in Study */ QString AddInStudy = QAD_CONFIG->getSetting("Geometry:SettingsAddInStudy"); - if ( !AddInStudy.isEmpty() ) + if(!AddInStudy.isEmpty()) GeomGUI->GetSettings_AddInStudy() = AddInStudy.toInt(); else GeomGUI->GetSettings_AddInStudy() = 1; - parent->menuBar()->findItem(702,&pp); - pp->setItemChecked(702, GeomGUI->GetSettings_AddInStudy()); + parent->menuBar()->findItem(412, &pp); + pp->setItemChecked(412, GeomGUI->GetSettings_AddInStudy()); /* step value */ - QString S = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ); - if( S.isEmpty() ) - QAD_CONFIG->addSetting( "Geometry:SettingsGeomStep", "100" ); + QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); + if(S.isEmpty()) + QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100"); /* isos */ QAD_Study* ActiveStudy = parent->getActiveStudy(); int count = ActiveStudy->getStudyFramesCount(); bool ViewOCC = false; - for ( int i = 0; i < count; i++ ) { - if ( ActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC ) { + for(int i = 0; i < count; i++) { + if(ActiveStudy->getStudyFrame(i)->getTypeView() == VIEW_OCC) { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)ActiveStudy->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer(); Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); QString IsoU = QAD_CONFIG->getSetting("Geometry:SettingsIsoU"); QString IsoV = QAD_CONFIG->getSetting("Geometry:SettingsIsoV"); - if ( !IsoU.isEmpty() ) + if(!IsoU.isEmpty()) ic->DefaultDrawer()->UIsoAspect()->SetNumber(IsoU.toInt()); - if ( !IsoV.isEmpty() ) + if(!IsoV.isEmpty()) ic->DefaultDrawer()->VIsoAspect()->SetNumber(IsoV.toInt()); ViewOCC = true; @@ -438,12 +415,15 @@ bool GeometryGUI::SetSettings( QAD_Desktop* parent ) QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar(); - Mb->setItemEnabled( 312, ViewOCC); //Sketch - Mb->setItemEnabled( 309, ViewOCC); //SuppressFace - Mb->setItemEnabled( 314, ViewOCC); //SuppressHole + Mb->setItemEnabled(404, ViewOCC);//Sketch + Mb->setItemEnabled(405, ViewOCC);//Sketch + Mb->setItemEnabled(406, ViewOCC);//Sketch + + Mb->setItemEnabled(603, ViewOCC);//SuppressFace + Mb->setItemEnabled(604, ViewOCC);//SuppressHole - Mb->setItemEnabled( 703, ViewOCC);// ShadingColor Settings - Mb->setItemEnabled( 704, ViewOCC);// Isos Settings + Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings + Mb->setItemEnabled(414, ViewOCC);// Isos Settings return true; } @@ -478,7 +458,7 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString if(GeomGUI->GetState() == CURRENT_SKETCH) theContext = "Sketch"; else { - if (Sel->IObjectCount() > 0) + if(Sel->IObjectCount() > 0) theContext = ""; else theContext = "NothingSelected"; @@ -486,14 +466,17 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString } else theContext = ""; + + return; } + //===================================================================================== // function : CustomPopup() // purpose : [static] //===================================================================================== bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext, - const QString& theParent,const QString& theObject) + const QString& theParent, const QString& theObject) { GeometryGUI::GetOrCreateGeometryGUI(parent); @@ -503,362 +486,315 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr Engines::Component_var comp = GeomGUI->GetDesktop()->getEngine("FactoryServer", "GEOM"); GEOM::GEOM_Gen_var myComponentGeom = GEOM::GEOM_Gen::_narrow(comp); - SALOME_Selection* Sel = SALOME_Selection::Selection( GeomGUI->GetActiveStudy()->getSelection() ); + SALOME_Selection* Sel = SALOME_Selection::Selection(GeomGUI->GetActiveStudy()->getSelection()); int nbSel = Sel->IObjectCount(); - if ( (nbSel == 0) && ( theContext.compare("Sketch")!=0 ) ) + if((nbSel == 0) && (theContext.compare("Sketch")!=0)) return false; - + + if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { + OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); + Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); + if(theParent.compare("Viewer")==0) { + if(theContext.compare("Sketch")==0) { + SketchStatus myCS = GeomGUI->GetSketcher().GetCurrentStatus(); + popup->setCheckable(TRUE); + if(myCS == SEGMENT) { + popup->setItemChecked(4041,true); //Sketch Segment Menu + popup->setItemChecked(4042,false); //Sketch Arc Menu + } + else if(myCS == ARC_CHORD) { + popup->setItemChecked(4041,false); //Sketch Segment Menu + popup->setItemChecked(4042,true); //Sketch Arc Menu + } + return true; + } + else if(theObject.compare("Component") == 0) { + popup->removeItem(QAD_DisplayOnly_Popup_ID); + return true; + } + else { + QFont f = QApplication::font(); + f.setBold( TRUE ); + if(nbSel==1) { + Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject(); + popup->removeItem(QAD_TopLabel_Popup_ID); + popup->insertItem(new CustomItem (QString(IObject->getName()), f), QAD_TopLabel_Popup_ID, 0); + if(IObject->hasEntry()) + popup->setItemEnabled(804, false); //Add in Study Menu + else + popup->setItemEnabled(804, true); //Add in Study Menu - if (GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) - { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()-> - getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); - if ( theParent.compare("Viewer")==0 ) - { - if ( theContext.compare("Sketch")==0 ) - { - SketchStatus myCS = GeomGUI->GetSketcher().GetCurrentStatus(); - popup->setCheckable(TRUE); - if (myCS==SEGMENT) - { - popup->setItemChecked(10000,true); - popup->setItemChecked(10001,false); - } - else if (myCS==ARC_CHORD) - { - popup->setItemChecked(10000,false); - popup->setItemChecked(10001,true); - } - - return true; + if(IObject->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) { + Standard_Boolean found; + Handle(GEOM_AISShape) Result = GeomGUI->ConvertIOinGEOMAISShape(IObject, found, true); + + if(found) { + if(Result->DisplayMode() == 1) + popup->changeItem(8031, tr("GEOM_MEN_WIREFRAME")); //Shading/Wireframe Menu + else + popup->changeItem(8031, tr("GEOM_MEN_SHADING")); //Shading/Wireframe Menu } + } + + if(!(v3d->isInViewer(IObject) && v3d->isVisible(IObject))) + popup->removeItem(QAD_Erase_Popup_ID); else - if (theObject.compare("Component") == 0) - { - popup->removeItem(QAD_DisplayOnly_Popup_ID); - return true; - } - else - { - QFont f = QApplication::font(); - f.setBold( TRUE ); - if (nbSel==1) - { - Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject(); - popup->removeItem(QAD_TopLabel_Popup_ID); - popup->insertItem( new CustomItem ( QString(IObject->getName()), f ), QAD_TopLabel_Popup_ID, 0 ); - if ( IObject->hasEntry() ) - popup->setItemEnabled( 801, false ); - else - popup->setItemEnabled( 801, true ); - - if (IObject->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) - { - Standard_Boolean found; - Handle(GEOM_AISShape) Result = GeomGUI->ConvertIOinGEOMAISShape(IObject, found, true); - - if ( found ) - { - if ( Result->DisplayMode() == 1 ) - popup->changeItem(8021, tr("GEOM_MEN_WIREFRAME") ); - else - popup->changeItem(8021, tr("GEOM_MEN_SHADING") ); - } - } - - if ( !(v3d->isInViewer( IObject ) && v3d->isVisible( IObject )) ) - popup->removeItem(QAD_Erase_Popup_ID); - else - popup->removeItem(QAD_Display_Popup_ID); - - } - else - { - popup->removeItem(QAD_DisplayOnly_Popup_ID); - popup->removeItem(QAD_TopLabel_Popup_ID); - popup->insertItem( new CustomItem ( tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f ), - QAD_TopLabel_Popup_ID, 0 ); - popup->setItemEnabled( 801, false ); - } - } - return true; + popup->removeItem(QAD_Display_Popup_ID); } - else - if ( theParent.compare("ObjectBrowser")==0 ) - { - popup->removeItem(QAD_TopLabel_Popup_ID); - int id = popup->idAt(0); // separator - if (id < 0) popup->removeItem(id); + else { + popup->removeItem(QAD_DisplayOnly_Popup_ID); + popup->removeItem(QAD_TopLabel_Popup_ID); + popup->insertItem(new CustomItem (tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f), QAD_TopLabel_Popup_ID, 0); + popup->setItemEnabled(804, false); //Add in Study Menu + } + } + return true; + } + else if(theParent.compare("ObjectBrowser")==0) { + popup->removeItem(QAD_TopLabel_Popup_ID); + int id = popup->idAt(0); // separator + if(id < 0) + popup->removeItem(id); - // checking for GEOM label in the selected list - SALOME_ListIteratorOfListIO It( Sel->StoredIObjects() ); - Handle(SALOME_InteractiveObject) anIObject; - - bool useSubItems = false; - bool needOpen = false; - bool needDisplay = false; - bool needErase = false; - SALOMEDS::GenericAttribute_var aTmpAttr; - for(;It.More();It.Next()) - { - anIObject = It.Value(); - if (!anIObject->hasEntry()) - continue; - - if (v3d->isInViewer(anIObject) && v3d->isVisible(anIObject)) - needErase = true; - else - needDisplay = true; - SALOMEDS::SObject_var obj = - GeomGUI->GetActiveStudy()->getStudyDocument()->FindObjectID( anIObject->getEntry() ); - if (!obj->_is_nil()) - { - GEOM::GEOM_Shape_var aShape; - if (obj->FindAttribute(aTmpAttr, "AttributeIOR")) { - char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value(); - if (str && strlen(str)) - aShape = myComponentGeom-> GetIORFromString(str); - } - else - if (obj->FindAttribute(aTmpAttr, "AttributePersistentRef")) - needOpen = true; - if (aShape->_is_nil()) - { - SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()-> - getStudyDocument()->NewChildIterator(obj); - while (anIter->More()) - { - SALOMEDS::SObject_var subobj = anIter->Value(); - if (subobj->FindAttribute(aTmpAttr, "AttributeIOR")) - { - useSubItems = true; - needErase = true; - needDisplay = true; - } - else - if (subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) - { - needOpen = true; - useSubItems = true; - } - anIter->Next(); - } - } - } + // checking for GEOM label in the selected list + SALOME_ListIteratorOfListIO It(Sel->StoredIObjects()); + Handle(SALOME_InteractiveObject) anIObject; + + bool useSubItems = false; + bool needOpen = false; + bool needDisplay = false; + bool needErase = false; + SALOMEDS::GenericAttribute_var aTmpAttr; + for(;It.More();It.Next()) { + anIObject = It.Value(); + if(!anIObject->hasEntry()) + continue; + + if(v3d->isInViewer(anIObject) && v3d->isVisible(anIObject)) + needErase = true; + else + needDisplay = true; + SALOMEDS::SObject_var obj = GeomGUI->GetActiveStudy()->getStudyDocument()->FindObjectID(anIObject->getEntry()); + if(!obj->_is_nil()) { + GEOM::GEOM_Shape_var aShape; + if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) { + char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value(); + if(str && strlen(str)) + aShape = myComponentGeom->GetIORFromString(str); + } + else if(obj->FindAttribute(aTmpAttr, "AttributePersistentRef")) + needOpen = true; + + if(aShape->_is_nil()) { + SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj); + while(anIter->More()) { + SALOMEDS::SObject_var subobj = anIter->Value(); + if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) { + useSubItems = true; + needErase = true; + needDisplay = true; } - // remove useless popup items - if (nbSel != 1) popup->removeItem(901); // rename - if (useSubItems) popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only - if (!needOpen) - { - int index = popup->indexOf(9024); - popup->removeItem(9024); // open - popup->removeItemAt(index); // separator under Open - - if (!needDisplay) popup->removeItem(QAD_Display_Popup_ID); - if (!needErase) popup->removeItem(QAD_Erase_Popup_ID); - if (!needDisplay && !needErase) - { - int id = popup->idAt(popup->count()-1); // last item - popup->removeItem(id); // separator - } + else if(subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) { + needOpen = true; + useSubItems = true; } - else - { - popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only - popup->removeItem(QAD_Display_Popup_ID); - popup->removeItem(QAD_Erase_Popup_ID); - if (nbSel!=1) - { - int id = popup->idAt(popup->count()-1); // last item - popup->removeItem(id); // separator - } - } - return true; + anIter->Next(); + } } - // MESSAGE ( " CUSTOM POPUP VIEWER OCC done. ") + } + } + // remove useless popup items + if(nbSel != 1) + popup->removeItem(901); // rename + if(useSubItems) + popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only + + if(!needOpen) { + int index = popup->indexOf(9024); // open + popup->removeItem(9024); + popup->removeItemAt(index); // separator under Open + + if (!needDisplay) + popup->removeItem(QAD_Display_Popup_ID); + if (!needErase) + popup->removeItem(QAD_Erase_Popup_ID); + + if(!needDisplay && !needErase) { + int id = popup->idAt(popup->count()-1); // last item + popup->removeItem(id); // separator + } + } + else { + popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only + popup->removeItem(QAD_Display_Popup_ID); + popup->removeItem(QAD_Erase_Popup_ID); + if (nbSel!=1) { + int id = popup->idAt(popup->count()-1); // last item + popup->removeItem(id); // separator + } + } + return true; } - else - if (GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) - { - // MESSAGE ( " CUSTOM POPUP VIEWER VTK ") - if ( ( theParent.compare("Viewer")==0 ) ) - { - - popup->setItemEnabled( 8033, false ); - if (theObject.compare("Component") == 0) - { - popup->removeItem(QAD_DisplayOnly_Popup_ID); - return true; - } + } + else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { + // MESSAGE ( " CUSTOM POPUP VIEWER VTK ") + if((theParent.compare("Viewer")==0)) { + popup->setItemEnabled(8034, false); //Isos Menu + if(theObject.compare("Component") == 0) { + popup->removeItem(QAD_DisplayOnly_Popup_ID); + return true; + } - //int id = popup->idAt(0); - QFont f = QApplication::font(); - f.setBold( TRUE ); - - if (nbSel==1) - { - Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject(); - popup->removeItem(QAD_TopLabel_Popup_ID); - popup->insertItem( new CustomItem ( QString(IObject->getName()), f ), QAD_TopLabel_Popup_ID, 0 ); - if ( IObject->hasEntry() ) - { - popup->setItemEnabled( 801, false ); - SALOMEDS::Study_var aStudy = GeomGUI->GetActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var SO = aStudy->FindObjectID( IObject->getEntry() ); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeIOR_var anIOR; - if ( !SO->_is_nil() ) - { - if (SO->FindAttribute(anAttr, "AttributeIOR") ) - { - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - Standard_Boolean found; - GEOM_Actor* Result = GeomGUI->ConvertIORinGEOMActor(anIOR->Value(), found, true); - if ( found ) - { - if ( Result->getDisplayMode() == 1 ) - popup->changeItem(8021, "Wireframe" ); - else - popup->changeItem(8021, "Shading" ); + //int id = popup->idAt(0); + QFont f = QApplication::font(); + f.setBold( TRUE ); + + if(nbSel==1) { + Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject(); + popup->removeItem(QAD_TopLabel_Popup_ID); + popup->insertItem(new CustomItem (QString(IObject->getName()), f), QAD_TopLabel_Popup_ID, 0); + if(IObject->hasEntry()) { + popup->setItemEnabled(804, false); //Add in Study Menu + SALOMEDS::Study_var aStudy = GeomGUI->GetActiveStudy()->getStudyDocument(); + SALOMEDS::SObject_var SO = aStudy->FindObjectID(IObject->getEntry()); + SALOMEDS::GenericAttribute_var anAttr; + SALOMEDS::AttributeIOR_var anIOR; + if(!SO->_is_nil()) { + if(SO->FindAttribute(anAttr, "AttributeIOR")) { + anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + Standard_Boolean found; + GEOM_Actor* Result = GeomGUI->ConvertIORinGEOMActor(anIOR->Value(), found, true); + if(found) { + if(Result->getDisplayMode() == 1) + popup->changeItem(8031, tr("GEOM_MEN_WIREFRAME")); //Shading/Wireframe Menu + else + popup->changeItem(8031, tr("GEOM_MEN_SHADING")); //Shading/Wireframe Menu - if ( !Result->GetVisibility() ) - popup->removeItem(QAD_Erase_Popup_ID); - else - popup->removeItem(QAD_Display_Popup_ID); - } - else - popup->removeItem(QAD_Erase_Popup_ID); - } - } - } + if(!Result->GetVisibility()) + popup->removeItem(QAD_Erase_Popup_ID); + else + popup->removeItem(QAD_Display_Popup_ID); + } else - popup->setItemEnabled( 801, true ); - } - else - { - popup->removeItem(QAD_DisplayOnly_Popup_ID); - popup->removeItem(QAD_TopLabel_Popup_ID); - popup->insertItem( new CustomItem ( tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f ), QAD_TopLabel_Popup_ID, 0 ); - popup->setItemEnabled( 801, false ); + popup->removeItem(QAD_Erase_Popup_ID); } - return true; + } } else - if ( theParent.compare("ObjectBrowser")==0 ) - { - popup->removeItem(QAD_TopLabel_Popup_ID); - int id = popup->idAt(0); // separator - if (id < 0) popup->removeItem(id); + popup->setItemEnabled(804, true); //Add in Study Menu + } + else { + popup->removeItem(QAD_DisplayOnly_Popup_ID); + popup->removeItem(QAD_TopLabel_Popup_ID); + popup->insertItem( new CustomItem (tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f), QAD_TopLabel_Popup_ID, 0); + popup->setItemEnabled(804, false); //Add in Study Menu + } + return true; + } + else if(theParent.compare("ObjectBrowser")==0) { + popup->removeItem(QAD_TopLabel_Popup_ID); + int id = popup->idAt(0); // separator + if(id < 0) + popup->removeItem(id); + + // checking for GEOM label in the selected list + SALOME_ListIteratorOfListIO It(Sel->StoredIObjects()); + Handle(SALOME_InteractiveObject) anIObject; - // checking for GEOM label in the selected list - SALOME_ListIteratorOfListIO It( Sel->StoredIObjects() ); - Handle(SALOME_InteractiveObject) anIObject; - - bool useSubItems = false; - bool needOpen = false; - bool needDisplay = false; - bool needErase = false; - SALOMEDS::GenericAttribute_var aTmpAttr; - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()-> - getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); - for(;It.More();It.Next()) - { - anIObject = It.Value(); - if ( !anIObject->hasEntry() ) - continue; - - if (myRenderInter->isInViewer(anIObject) && myRenderInter->isVisible(anIObject)) - needErase = true; - else - needDisplay = true; - - SALOMEDS::SObject_var obj = GeomGUI->GetActiveStudy()->getStudyDocument() - ->FindObjectID( anIObject->getEntry() ); - if (!obj->_is_nil()) { - GEOM::GEOM_Shape_var aShape; - if (obj->FindAttribute(aTmpAttr, "AttributeIOR")){ - char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value(); - if (str && strlen(str)) - aShape = myComponentGeom->GetIORFromString(str); - } - else - if (obj->FindAttribute(aTmpAttr, "AttributePersistentRef")) - needOpen = true; - if (aShape->_is_nil()) - { - SALOMEDS::ChildIterator_var anIter = - GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj); - while (anIter->More()) - { - SALOMEDS::SObject_var subobj = anIter->Value(); - if (subobj->FindAttribute(aTmpAttr, "AttributeIOR")) - { - useSubItems = true; - needDisplay = true; - needErase = true; - } - else - if (subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) - { - needOpen = true; - useSubItems = true; - } - anIter->Next(); - } - } - } - } - // remove useless popup items - if (nbSel != 1) popup->removeItem(901); // rename - if (useSubItems) popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only - if (!needOpen) - { - int index = popup->indexOf(9024); - popup->removeItem(9024); // open - popup->removeItemAt(index); // separator under Open - - if (!needDisplay) popup->removeItem(QAD_Display_Popup_ID); - if (!needErase) popup->removeItem(QAD_Erase_Popup_ID); - if (!needDisplay && !needErase) - { - int id = popup->idAt(popup->count()-1); // last item - popup->removeItem(id); // separator - } - } - else - { - popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only - popup->removeItem(QAD_Display_Popup_ID); - popup->removeItem(QAD_Erase_Popup_ID); - if (nbSel!=1) - { - int id = popup->idAt(popup->count()-1); // last item - popup->removeItem(id); // separator - } - } - return true; - // MESSAGE ( " CUSTOM POPUP VIEWER VTK done.") - } - } else - { // other viewer types not supported. - while (1) - { - int id = popup->idAt(0); - if (id <= QAD_TopLabel_Popup_ID && id != -1) - popup->removeItemAt(0); - else - break; + bool useSubItems = false; + bool needOpen = false; + bool needDisplay = false; + bool needErase = false; + SALOMEDS::GenericAttribute_var aTmpAttr; + VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); + for(;It.More();It.Next()) { + anIObject = It.Value(); + if(!anIObject->hasEntry()) + continue; + + if(myRenderInter->isInViewer(anIObject) && myRenderInter->isVisible(anIObject)) + needErase = true; + else + needDisplay = true; + + SALOMEDS::SObject_var obj = GeomGUI->GetActiveStudy()->getStudyDocument()->FindObjectID( anIObject->getEntry()); + if(!obj->_is_nil()) { + GEOM::GEOM_Shape_var aShape; + if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) { + char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value(); + if(str && strlen(str)) + aShape = myComponentGeom->GetIORFromString(str); + } + else if(obj->FindAttribute(aTmpAttr, "AttributePersistentRef")) + needOpen = true; + + if(aShape->_is_nil()) { + SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj); + while(anIter->More()) { + SALOMEDS::SObject_var subobj = anIter->Value(); + if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) { + useSubItems = true; + needDisplay = true; + needErase = true; + } + else if(subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) { + needOpen = true; + useSubItems = true; + } + anIter->Next(); } - popup->removeItem(QAD_DisplayOnly_Popup_ID); + } + } + } + // remove useless popup items + if(nbSel != 1) + popup->removeItem(901); // rename + if(useSubItems) + popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only + + if(!needOpen) { + int index = popup->indexOf(9024); // open + popup->removeItem(9024); + popup->removeItemAt(index); // separator under Open + + if(!needDisplay) popup->removeItem(QAD_Display_Popup_ID); + if(!needErase) popup->removeItem(QAD_Erase_Popup_ID); + if(!needDisplay && !needErase) { int id = popup->idAt(popup->count()-1); // last item - if (id < 0 && id != -1) popup->removeItem(id); // separator - return false; + popup->removeItem(id); // separator } + } + else { + popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only + popup->removeItem(QAD_Display_Popup_ID); + popup->removeItem(QAD_Erase_Popup_ID); + if(nbSel!=1) { + int id = popup->idAt(popup->count()-1); // last item + popup->removeItem(id); // separator + } + } + return true; + } + } + else { // other viewer types not supported. + while(1) { + int id = popup->idAt(0); + if(id <= QAD_TopLabel_Popup_ID && id != -1) + popup->removeItemAt(0); + else + break; + } + popup->removeItem(QAD_DisplayOnly_Popup_ID); + popup->removeItem(QAD_Display_Popup_ID); + popup->removeItem(QAD_Erase_Popup_ID); + int id = popup->idAt(popup->count()-1); // last item + if(id < 0 && id != -1) + popup->removeItem(id); // separator + return false; + } return false; } @@ -882,18 +818,21 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent) if(GeomGUI->GetDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) ViewOCC = true; - Mb->setItemEnabled(312, ViewOCC); //Sketch - Mb->setItemEnabled(309, ViewOCC); //SuppressFace - Mb->setItemEnabled(314, ViewOCC); //SuppressHole - - Mb->setItemEnabled(703, ViewOCC);// ShadingColor Settings - Mb->setItemEnabled(704, ViewOCC);// Isos Settings + Mb->setItemEnabled(404, ViewOCC);//Sketch + Mb->setItemEnabled(405, ViewOCC);//Sketch + Mb->setItemEnabled(406, ViewOCC);//Sketch + + Mb->setItemEnabled(603, ViewOCC);//SuppressFace + Mb->setItemEnabled(604, ViewOCC);//SuppressHole + + Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings + Mb->setItemEnabled(414, ViewOCC);// Isos Settings GeomGUI->EraseSimulationShape(); GeomGUI->EmitSignalCloseAllDialogs(); GeomGUI = 0; } - return ; + return; } @@ -915,43 +854,44 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI Handle(AIS_InteractiveContext) ic; vtkRenderer* Renderer; - if ( GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { + if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); ic = v3d->getAISContext(); - } else if ( GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { + } + else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { Renderer = ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer(); - } else + } + else return; - if (theIO.IsNull()) + if(theIO.IsNull()) MESSAGE("BuildPresentation(): null SALOME_InteractiveObject passed") - if (GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { + if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { // VTK - SALOMEDS::SObject_var fatherSF = - aStudy->FindObjectID(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry()); + SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry()); - SALOMEDS::SObject_var obj = aStudy->FindObjectID( theIO->getEntry() ); + SALOMEDS::SObject_var obj = aStudy->FindObjectID(theIO->getEntry()); - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); + VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; + SALOMEDS::AttributeName_var aName; + SALOMEDS::AttributeIOR_var anIOR; if(myRenderInter->isInViewer(theIO)) { myRenderInter->Display(theIO, false); } else { // Create new actor - if ( !obj->_is_nil() ) { - if ( obj->FindAttribute(anAttr, "AttributeIOR")) { + if(!obj->_is_nil()) { + if(obj->FindAttribute(anAttr, "AttributeIOR")) { // this SObject may be GEOM module root SObject bool useSubItems = false; SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj); - if (myComponentGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) { + if(myComponentGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) { while (anIter->More() && !useSubItems) { SALOMEDS::SObject_var subobj = anIter->Value(); SALOMEDS::GenericAttribute_var aTmpAttr; @@ -960,8 +900,12 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI anAttr = aTmpAttr; obj = subobj; useSubItems = true; - } else anIter->Next(); - } else anIter->Next(); + } + else + anIter->Next(); + } + else + anIter->Next(); } } @@ -970,7 +914,7 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString(anIOR->Value()); TopoDS_Shape Shape = GeomGUI->GetShapeReader().GetShape(myComponentGeom,aShape); - if (obj->FindAttribute(anAttr, "AttributeName")) { + if(obj->FindAttribute(anAttr, "AttributeName")) { aName = SALOMEDS::AttributeName::_narrow(anAttr); vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer(); @@ -982,18 +926,18 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI bool isDisplayed = false; while(!(actor==NULL)) { SALOME_Actor* Gactor = SALOME_Actor::SafeDownCast(actor); - if (Gactor!=NULL) { - if (Gactor->hasIO()) { - if (strcmp(Gactor->getIO()->getEntry(),obj->GetID())==0) { + if(Gactor!=NULL) { + if(Gactor->hasIO()) { + if(strcmp(Gactor->getIO()->getEntry(),obj->GetID())==0) { isDisplayed = true; anIObj = Gactor->getIO(); - if (!anIObj.IsNull()) myRenderInter->Display(anIObj, false); + if(!anIObj.IsNull()) myRenderInter->Display(anIObj, false); } } } actor=(vtkActor*)(theAllActors->GetNextActor()); } - if (!isDisplayed) { + if(!isDisplayed) { // open transaction QAD_Operation* op = new SALOMEGUI_ImportOperation( GeomGUI->GetActiveStudy() ); op->start(); @@ -1011,11 +955,11 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI theActors->InitTraversal(); vtkActor* anActor = (vtkActor*)theActors->GetNextActor(); while(!(anActor==NULL)) { - GEOM_Actor* GActor = GEOM_Actor::SafeDownCast( anActor ); + GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor); Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(anIOR->Value(), GeomGUI->GetFatherior(),"GEOM"); IO->setEntry(obj->GetID()); - GActor->setIO( IO ); - GActor->setName( theIO->getName() ); + GActor->setIO(IO); + GActor->setName(theIO->getName()); theRenderer->AddActor(GActor); // renWin->Render(); @@ -1024,18 +968,22 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI } } // next item iteration - if (useSubItems) { + if(useSubItems) { anIter->Next(); anAttr = SALOMEDS::GenericAttribute::_nil(); - while (anIter->More() && anAttr->_is_nil()) { + while(anIter->More() && anAttr->_is_nil()) { SALOMEDS::SObject_var subobject = anIter->Value(); SALOMEDS::GenericAttribute_var aTmpAttribute; if (subobject->FindAttribute(aTmpAttribute, "AttributeIOR")) { anAttr = aTmpAttribute; obj = subobject; - } else anIter->Next(); + } + else + anIter->Next(); } - } else anAttr = SALOMEDS::GenericAttribute::_nil(); + } + else + anAttr = SALOMEDS::GenericAttribute::_nil(); } } } @@ -1043,42 +991,47 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI // No viewer update should be done here! //myRenderInter->Render(); //GeomGUI->GetActiveStudy()->updateObjBrowser( true ); - } else if (GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) { - SALOMEDS::SObject_var fatherSF = - aStudy->FindObjectID( GeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry()); + } + else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { + SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry()); SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; + SALOMEDS::AttributeName_var aName; + SALOMEDS::AttributeIOR_var anIOR; - if ( v3d->isInViewer( theIO, true ) ) { + if(v3d->isInViewer(theIO, true)) { Standard_Boolean found; - Handle(GEOM_AISShape) aSh = GeomGUI->ConvertIOinGEOMAISShape( theIO, found, true ); - if ( found ) { + Handle(GEOM_AISShape) aSh = GeomGUI->ConvertIOinGEOMAISShape(theIO, found, true); + if(found) { ic->Display(aSh, false); ic->AddOrRemoveCurrentObject(aSh, false); } - } else { - SALOMEDS::SObject_var obj = aStudy->FindObjectID( theIO->getEntry() ); - if ( !obj->_is_nil() ) { + } + else { + SALOMEDS::SObject_var obj = aStudy->FindObjectID(theIO->getEntry()); + if(!obj->_is_nil()) { MESSAGE("BuildPresentation(): SObject not null") - if ( obj->FindAttribute(anAttr, "AttributeIOR")) { + if(obj->FindAttribute(anAttr, "AttributeIOR")) { MESSAGE("BuildPresentation(): SObject has IOR") // this SObject may be GEOM module root SObject bool useSubItems = false; SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj); - if (myComponentGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) { - while (anIter->More() && !useSubItems) { + if(myComponentGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) { + while(anIter->More() && !useSubItems) { SALOMEDS::SObject_var subobj = anIter->Value(); SALOMEDS::GenericAttribute_var aTmpAttr; - if (subobj->FindAttribute(aTmpAttr, "AttributeIOR")) { - if (!myComponentGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value())->_is_nil()) { + if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) { + if(!myComponentGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value())->_is_nil()) { anAttr = aTmpAttr; obj = subobj; useSubItems = true; - } else anIter->Next(); - } else anIter->Next(); + } + else + anIter->Next(); + } + else + anIter->Next(); } } @@ -1086,9 +1039,9 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); GEOM::GEOM_Shape_var aShape = myComponentGeom->GetIORFromString(anIOR->Value()); TopoDS_Shape Shape = GeomGUI->GetShapeReader().GetShape(myComponentGeom,aShape); - if (Shape.IsNull()) + if(Shape.IsNull()) MESSAGE("BuildPresentation(): TopoDS_Shape is null!") - if (obj->FindAttribute(anAttr, "AttributeName")) { + if(obj->FindAttribute(anAttr, "AttributeName")) { MESSAGE("BuildPresentation(): SObject has Name") aName = SALOMEDS::AttributeName::_narrow(anAttr); // searchin for already displayed objects with the same shape @@ -1098,15 +1051,18 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI Handle(AIS_Shape) anAISShape; for(;anIObjects.More();anIObjects.Next()) { anAISShape = Handle(AIS_Shape)::DownCast(anIObjects.Value()); - if (!anAISShape.IsNull()) { - if (anAISShape->Shape().IsSame(Shape)) break; + if(!anAISShape.IsNull()) { + if(anAISShape->Shape().IsSame(Shape)) + break; anAISShape.Nullify(); } } - if (!anAISShape.IsNull()) { - if (!ic->IsDisplayed(anAISShape)) ic->Display(anAISShape, false); - } else { - if (!useSubItems) { + if(!anAISShape.IsNull()) { + if(!ic->IsDisplayed(anAISShape)) + ic->Display(anAISShape, false); + } + else { + if(!useSubItems) { // open transaction QAD_Operation* op = new SALOMEGUI_ImportOperation( GeomGUI->GetActiveStudy() ); op->start(); @@ -1118,30 +1074,32 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI op->finish(); } Handle(GEOM_AISShape) aSh = new GEOM_AISShape(Shape, aName->Value()); - aSh->SetShadingColor( GeomGUI->GetShadingColor() ); - Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(anIOR->Value(), - GeomGUI->GetFatherior(), - "GEOM"); + aSh->SetShadingColor(GeomGUI->GetShadingColor()); + Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(anIOR->Value(), GeomGUI->GetFatherior(), "GEOM"); IO->setEntry(obj->GetID()); - aSh->setIO( IO ); - aSh->setName( aName->Value() ); - ic->Display (aSh, false); - if (!useSubItems) ic->AddOrRemoveCurrentObject(aSh, false); + aSh->setIO(IO); + aSh->setName(aName->Value()); + ic->Display(aSh, false); + if(!useSubItems) + ic->AddOrRemoveCurrentObject(aSh, false); } } // next item iteration - if (useSubItems) { + if(useSubItems) { anIter->Next(); anAttr=SALOMEDS::GenericAttribute::_nil(); while (anIter->More() && anAttr->_is_nil()) { SALOMEDS::SObject_var subobject = anIter->Value(); SALOMEDS::GenericAttribute_var aTmpAttribute; - if (subobject->FindAttribute(aTmpAttribute, "AttributeIOR")) { + if(subobject->FindAttribute(aTmpAttribute, "AttributeIOR")) { anAttr = aTmpAttribute; obj = subobject; - } else anIter->Next(); + } + else + anIter->Next(); } - } else + } + else anAttr = SALOMEDS::GenericAttribute::_nil(); } } @@ -1160,50 +1118,32 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI extern "C" { bool OnGUIEvent(int theCommandID, QAD_Desktop* parent) - { - return GeometryGUI::OnGUIEvent(theCommandID, parent); - } + {return GeometryGUI::OnGUIEvent(theCommandID, parent);} bool OnKeyPress (QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame) - { - return GeometryGUI::OnKeyPress(pe, parent, studyFrame); - } + {return GeometryGUI::OnKeyPress(pe, parent, studyFrame);} bool OnMousePress (QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame) - { - return GeometryGUI::OnMousePress(pe, parent, studyFrame); - } + {return GeometryGUI::OnMousePress(pe, parent, studyFrame);} bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame) - { - return GeometryGUI::OnMouseMove(pe, parent, studyFrame); - } + {return GeometryGUI::OnMouseMove(pe, parent, studyFrame);} bool SetSettings(QAD_Desktop* parent) - { - return GeometryGUI::SetSettings(parent); - } + {return GeometryGUI::SetSettings(parent);} bool customPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString & theContext, const QString & theParent, const QString & theObject) - { - return GeometryGUI::CustomPopup(parent, popup, theContext, theParent, theObject); - } + {return GeometryGUI::CustomPopup(parent, popup, theContext, theParent, theObject);} void definePopup(QString & theContext, QString & parent, QString & theObject) - { - GeometryGUI::DefinePopup(theContext, parent, theObject); - } + {GeometryGUI::DefinePopup(theContext, parent, theObject);} bool activeStudyChanged(QAD_Desktop* parent) - { - GeometryGUI::activeStudyChanged(parent); - } + {GeometryGUI::activeStudyChanged(parent);} void buildPresentation(const Handle(SALOME_InteractiveObject)& theIO) - { - GeometryGUI::BuildPresentation(theIO); - } + {GeometryGUI::BuildPresentation(theIO);} void supportedViewType(int* buffer, int bufferSize) { diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 84d01c4f3..ef0770396 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -56,10 +56,10 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(QWidget* parent, const char* GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); GroupPoints->TextLabel1->setText(tr("GEOM_FILLING_COMPOUND")); GroupPoints->TextLabel2->setText(tr("GEOM_FILLING_MIN_DEG")); - GroupPoints->TextLabel3->setText(tr("GEOM_FILLING_MAX_DEG")); - GroupPoints->TextLabel4->setText(tr("GEOM_FILLING_TOL_3D")); - GroupPoints->TextLabel5->setText(tr("GEOM_FILLING_TOL_2D")); - GroupPoints->TextLabel6->setText(tr("GEOM_FILLING_NB_ITER")); + GroupPoints->TextLabel3->setText(tr("GEOM_FILLING_TOL_2D")); + GroupPoints->TextLabel4->setText(tr("GEOM_FILLING_NB_ITER")); + GroupPoints->TextLabel5->setText(tr("GEOM_FILLING_MAX_DEG")); + GroupPoints->TextLabel6->setText(tr("GEOM_FILLING_TOL_3D")); GroupPoints->PushButton1->setPixmap(image1); Layout1->addWidget(GroupPoints, 1, 0); @@ -102,20 +102,20 @@ void GenerationGUI_FillingDlg::Init() /* Get setting of step value from file configuration */ QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); - step = St.toDouble(); + step = St.toInt(); /* min, max, step and decimals for spin boxes & initial values */ GroupPoints->SpinBox_1->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_2->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_3->RangeStepAndValidator(0.00001, 10000.0, 3, 10); - GroupPoints->SpinBox_4->RangeStepAndValidator(0.00001, 10000.0, 3, 10); - GroupPoints->SpinBox_5->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_2->RangeStepAndValidator(0.00001, 10000.0, 3, 10); + GroupPoints->SpinBox_3->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_4->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_5->RangeStepAndValidator(0.00001, 10000.0, 3, 10); GroupPoints->SpinBox_1->SetValue(myMinDeg); - GroupPoints->SpinBox_2->SetValue(myMaxDeg); - GroupPoints->SpinBox_3->SetValue(myTol3D); - GroupPoints->SpinBox_4->SetValue(myTol2D); - GroupPoints->SpinBox_5->SetValue(myNbIter); + GroupPoints->SpinBox_2->SetValue(myTol2D); + GroupPoints->SpinBox_3->SetValue(myNbIter); + GroupPoints->SpinBox_4->SetValue(myMaxDeg); + GroupPoints->SpinBox_5->SetValue(myTol3D); /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); @@ -155,10 +155,10 @@ void GenerationGUI_FillingDlg::ClickOnApply() myGeomGUI->GetDesktop()->putInfo(tr("")); myMinDeg = GroupPoints->SpinBox_1->value(); - myMaxDeg = GroupPoints->SpinBox_2->value(); - myTol3D = GroupPoints->SpinBox_3->value(); - myTol2D = GroupPoints->SpinBox_4->value(); - myNbIter = GroupPoints->SpinBox_5->value(); + myTol2D = GroupPoints->SpinBox_2->value(); + myNbIter = GroupPoints->SpinBox_3->value(); + myMaxDeg = GroupPoints->SpinBox_4->value(); + myTol3D = GroupPoints->SpinBox_5->value(); if(myOkSectionShape) myGenerationGUI->MakeFillingAndDisplay(myGeomShape, myMinDeg, myMaxDeg, myTol3D, myTol2D, myNbIter); diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index 13dd421f4..ae489da97 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -71,42 +71,42 @@ bool MeasureGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 601: // PROPERTIES (Length, surface, volume) + case 701: // PROPERTIES (Length, surface, volume) { MeasureGUI_PropertiesDlg *aDlg = new MeasureGUI_PropertiesDlg(parent, "", Sel); break; } - case 604: // CDG : Center of mass + case 702: // CDG : Center of mass { MeasureGUI_CenterMassDlg *aDlg = new MeasureGUI_CenterMassDlg(parent, "", this, Sel); break; } - case 605: // INERTIA + case 703: // INERTIA { MeasureGUI_InertiaDlg *aDlg = new MeasureGUI_InertiaDlg(parent, "", Sel); break; } - case 6060: // BOUNDING BOX + case 7041: // BOUNDING BOX { MeasureGUI_BndBoxDlg *aDlg = new MeasureGUI_BndBoxDlg(parent, "", Sel); break; } - case 6061: // MIN DISTANCE + case 7042: // MIN DISTANCE { MeasureGUI_DistanceDlg *aDlg = new MeasureGUI_DistanceDlg(parent, "", Sel); break; } - case 607: // MAXTOLERANCE + case 705: // MAXTOLERANCE { MeasureGUI_MaxToleranceDlg *aDlg = new MeasureGUI_MaxToleranceDlg(parent, "", Sel); break; } - case 608: // WHATIS + case 706: // WHATIS { MeasureGUI_WhatisDlg *aDlg = new MeasureGUI_WhatisDlg(parent, "", Sel); break; } - case 609: // CHECKSHAPE + case 707: // CHECKSHAPE { MeasureGUI_CheckShape *aDlg = new MeasureGUI_CheckShape(parent, "", Sel); break; diff --git a/src/OperationGUI/OperationGUI.cxx b/src/OperationGUI/OperationGUI.cxx index 27c9f54d5..f373fefc3 100644 --- a/src/OperationGUI/OperationGUI.cxx +++ b/src/OperationGUI/OperationGUI.cxx @@ -73,17 +73,17 @@ bool OperationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 4025: // PARTITION + case 503: // PARTITION { OperationGUI_PartitionDlg *aDlg = new OperationGUI_PartitionDlg(parent, "", this, Sel); break; } - case 4026: // ARCHIMEDE + case 504: // ARCHIMEDE { OperationGUI_ArchimedeDlg *aDlg = new OperationGUI_ArchimedeDlg(parent, "", this, Sel); break; } - case 4027: // FILLET + case 505: // FILLET { Handle(AIS_InteractiveContext) ic; if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { @@ -93,7 +93,7 @@ bool OperationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) OperationGUI_FilletDlg *aDlg = new OperationGUI_FilletDlg(parent, "", this, Sel, ic); break; } - case 4028: // CHAMFER + case 506: // CHAMFER { Handle(AIS_InteractiveContext) ic; if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { diff --git a/src/PrimitiveGUI/PrimitiveGUI.cxx b/src/PrimitiveGUI/PrimitiveGUI.cxx index dcc8c244b..6ce7d7c8b 100644 --- a/src/PrimitiveGUI/PrimitiveGUI.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI.cxx @@ -68,27 +68,27 @@ bool PrimitiveGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 3021: // BOX + case 4021: // BOX { PrimitiveGUI_BoxDlg *aDlg = new PrimitiveGUI_BoxDlg(parent, "", this, Sel); break; } - case 3022: // CYLINDER + case 4022: // CYLINDER { PrimitiveGUI_CylinderDlg *aDlg = new PrimitiveGUI_CylinderDlg(parent, "", this, Sel); break; } - case 3023: // SPHERE + case 4023: // SPHERE { PrimitiveGUI_SphereDlg *aDlg = new PrimitiveGUI_SphereDlg(parent, "", this, Sel); break; } - case 3024: // TORUS + case 4024: // TORUS { PrimitiveGUI_TorusDlg *aDlg = new PrimitiveGUI_TorusDlg(parent, "", this, Sel); break; } - case 3025: // CONE + case 4025: // CONE { PrimitiveGUI_ConeDlg *aDlg = new PrimitiveGUI_ConeDlg(parent, "", this, Sel); break; diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 3b6a64afe..0523144b0 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -133,6 +133,10 @@ void PrimitiveGUI_BoxDlg::Init() connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); + connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* displays Dialog */ diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index fb4983dfd..4ee474ca4 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -119,10 +119,10 @@ void PrimitiveGUI_ConeDlg::Init() /* 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_DY->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_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); GroupPoints->SpinBox_DX->SetValue(myRadius1); GroupPoints->SpinBox_DY->SetValue(myRadius2); @@ -148,6 +148,13 @@ void PrimitiveGUI_ConeDlg::Init() connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 8ade2054c..5106024e0 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -141,6 +141,11 @@ void PrimitiveGUI_CylinderDlg::Init() connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index af53c1150..c445d0a6e 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -118,8 +118,12 @@ void PrimitiveGUI_SphereDlg::Init() connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index d8f3db131..ca3fe0dad 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -137,6 +137,11 @@ void PrimitiveGUI_TorusDlg::Init() connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index 12da46f9d..a429ea340 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -70,17 +70,17 @@ bool RepairGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 501: // SEWING + case 601: // SEWING { RepairGUI_SewingDlg *aDlg = new RepairGUI_SewingDlg(parent, "", this, Sel); break; } - case 502: // ORIENTATION + case 602: // ORIENTATION { RepairGUI_OrientationDlg *aDlg = new RepairGUI_OrientationDlg(parent, "", this, Sel); break; } - case 309: // SUPPRESS FACES : use ic + case 603: // SUPPRESS FACES : use ic { Handle(AIS_InteractiveContext) ic; if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { @@ -90,7 +90,7 @@ bool RepairGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) RepairGUI_SuppressFacesDlg *aDlg = new RepairGUI_SuppressFacesDlg(parent, "", this, Sel, ic); break; } - case 314: // SUPPRESS HOLES : use ic + case 604: // SUPPRESS HOLES : use ic { Handle(AIS_InteractiveContext) ic; if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index 6a6407415..fb761198a 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -69,32 +69,32 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) switch (theCommandID) { - case 4021: // TRANSLATION + case 5021: // TRANSLATION { TransformationGUI_TranslationDlg *aDlg = new TransformationGUI_TranslationDlg(parent, "", this, Sel); break; } - case 4022: // ROTATION + case 5022: // ROTATION { TransformationGUI_RotationDlg *aDlg = new TransformationGUI_RotationDlg(parent, "", this, Sel); break; } - case 4023: // MIRROR + case 5023: // MIRROR { TransformationGUI_MirrorDlg *aDlg = new TransformationGUI_MirrorDlg(parent, "", this, Sel); break; } - case 4024: // SCALE + case 5024: // SCALE { TransformationGUI_ScaleDlg *aDlg = new TransformationGUI_ScaleDlg(parent, "", this, Sel ); break; } - case 4030: // MULTI TRANSLATION + case 5025: // MULTI TRANSLATION { TransformationGUI_MultiTranslationDlg *aDlg = new TransformationGUI_MultiTranslationDlg(parent, "", this, Sel); break; } - case 4040: // MULTI ROTATION + case 5026: // MULTI ROTATION { TransformationGUI_MultiRotationDlg *aDlg = new TransformationGUI_MultiRotationDlg(parent, "", this, Sel); break;