From: rnc Date: Tue, 6 Mar 2012 16:22:03 +0000 (+0000) Subject: Extruded boss / cut dialog improvement and documenation update X-Git-Tag: V6_5_0a1~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ee46a2770237a2ed9fcd7425510116fa93673a14;p=modules%2Fgeom.git Extruded boss / cut dialog improvement and documenation update --- diff --git a/doc/salome/gui/GEOM/images/change_direction.png b/doc/salome/gui/GEOM/images/change_direction.png new file mode 100644 index 000000000..fb34fedda Binary files /dev/null and b/doc/salome/gui/GEOM/images/change_direction.png differ diff --git a/doc/salome/gui/GEOM/images/extruded_boss.png b/doc/salome/gui/GEOM/images/extruded_boss.png new file mode 100644 index 000000000..fca4e90d8 Binary files /dev/null and b/doc/salome/gui/GEOM/images/extruded_boss.png differ diff --git a/doc/salome/gui/GEOM/images/extruded_boss_dlg.png b/doc/salome/gui/GEOM/images/extruded_boss_dlg.png new file mode 100644 index 000000000..80c767eec Binary files /dev/null and b/doc/salome/gui/GEOM/images/extruded_boss_dlg.png differ diff --git a/doc/salome/gui/GEOM/images/extruded_cut_dlg.png b/doc/salome/gui/GEOM/images/extruded_cut_dlg.png new file mode 100644 index 000000000..f18ed6aca Binary files /dev/null and b/doc/salome/gui/GEOM/images/extruded_cut_dlg.png differ diff --git a/doc/salome/gui/GEOM/input/extruded_boss_operation.doc b/doc/salome/gui/GEOM/input/extruded_boss_operation.doc index 79d50f0cd..a7d6d92f2 100644 --- a/doc/salome/gui/GEOM/input/extruded_boss_operation.doc +++ b/doc/salome/gui/GEOM/input/extruded_boss_operation.doc @@ -2,7 +2,42 @@ \page extruded_boss_operation_page Extruded boss -The "Extruded boss" operation allows you to add material to an object by extruding a profile or a face -along the normal to its plane. +The Extruded boss operation allows you to easily add material on a \b solid by extruding a profile along the normal to its plane. -*/ +\image html extruded_boss_example.png + +To produce the extruded boss: + +1. Draw the \b profile of the extrusion. It can be: + + - a \b Sketch drawn on a planar face of the object you want to boss. + + - any closed edge or wire of the desired shape (circle, ellipse ...). + +2. In the Main Menu select Operations - > Extruded Boss or click on +\image html extruded_boss.png + +3. Fill in the dialog box fields: + +\image html extruded_boss_dlg.png + +The input arguments are: + +- The initial shape you want to add material on. It must be a solid or a compound made of a single solid. + +- The \b profile. It must be a \b closed edge or wire and it must be \b planar. + +- The \b height of extrusion. It's calculated from the base profile along the normal to its plane. + +And optionnaly: + +- A draft angle in degrees. Activated by clicking on \image html draft.png + +The direction can be reversed by pushing the Change direction button: \image html change_direction.png + + +This functionality is available via the textual interface with the command: + +\n TUI Command: geompy.MakeExtrudedBoss(InitShape, Profile, Height, Angle), + +*/ \ No newline at end of file diff --git a/doc/salome/gui/GEOM/input/extruded_cut_operation.doc b/doc/salome/gui/GEOM/input/extruded_cut_operation.doc index c1c940158..efd7e76e0 100644 --- a/doc/salome/gui/GEOM/input/extruded_cut_operation.doc +++ b/doc/salome/gui/GEOM/input/extruded_cut_operation.doc @@ -4,7 +4,7 @@ The Extruded cut operation allows you to easily remove material from a \b solid by extruding a profile along the normal to its plane. -- \image html extruded_cut_example.png +\image html extruded_cut_example.png To produce the extruded cut: @@ -19,9 +19,9 @@ To produce the extruded cut: 3. Fill in the dialog box fields: -\image +\image html extruded_cut_dlg.png -The input parameters are: +The input arguments are: - The initial shape you want to cut. It must be a solid or a compound made of a single solid. @@ -33,6 +33,12 @@ And optionnaly: - A draft angle in degrees. Activated by clicking on \image html draft.png +The direction can be reversed by pushing the Change direction button: \image html change_direction.png + + +This functionality is available via the textual interface with the command: + +\n TUI Command: geompy.MakeExtrudedCut(InitShape, Profile, Height,Angle), */ diff --git a/resources/Makefile.am b/resources/Makefile.am index 9719dd063..ef1cc9fa1 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -57,6 +57,7 @@ chamferedge.png \ chamferface.png \ chamferedgefromface.png \ change_orientation.png \ +change_direction.png \ check.png \ circle.png \ circlepointvector.png \ diff --git a/resources/change_direction.png b/resources/change_direction.png new file mode 100644 index 000000000..fb34fedda Binary files /dev/null and b/resources/change_direction.png differ diff --git a/src/DlgRef/DlgRef.cxx b/src/DlgRef/DlgRef.cxx index 8c21e214d..65541592b 100644 --- a/src/DlgRef/DlgRef.cxx +++ b/src/DlgRef/DlgRef.cxx @@ -442,6 +442,20 @@ DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push() { } +////////////////////////////////////////// +// DlgRef_2Sel2Spin2Push +////////////////////////////////////////// + +DlgRef_2Sel2Spin2Push::DlgRef_2Sel2Spin2Push( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} + +DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push() +{ +} + ////////////////////////////////////////// // DlgRef_2Sel3Spin2Rb ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef.h b/src/DlgRef/DlgRef.h index 0673ad7dc..9b565ba0a 100644 --- a/src/DlgRef/DlgRef.h +++ b/src/DlgRef/DlgRef.h @@ -515,6 +515,22 @@ public: ~DlgRef_2Sel2Spin1Push(); }; +////////////////////////////////////////// +// DlgRef_2Sel2Spin2Push +////////////////////////////////////////// + +#include "ui_DlgRef_2Sel2Spin2Push_QTD.h" + +class DLGREF_EXPORT DlgRef_2Sel2Spin2Push : public QWidget, + public Ui::DlgRef_2Sel2Spin2Push_QTD +{ + Q_OBJECT + +public: + DlgRef_2Sel2Spin2Push( QWidget* = 0, Qt::WindowFlags = 0 ); + ~DlgRef_2Sel2Spin2Push(); +}; + ////////////////////////////////////////// // DlgRef_2Sel3Spin2Rb ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef_2Sel2Spin1Push_QTD.ui b/src/DlgRef/DlgRef_2Sel2Spin1Push_QTD.ui index 4c3dbe5e8..d24095449 100644 --- a/src/DlgRef/DlgRef_2Sel2Spin1Push_QTD.ui +++ b/src/DlgRef/DlgRef_2Sel2Spin1Push_QTD.ui @@ -122,6 +122,13 @@ + + + + TL4 + + + diff --git a/src/DlgRef/DlgRef_2Sel2Spin2Push_QTD.ui b/src/DlgRef/DlgRef_2Sel2Spin2Push_QTD.ui new file mode 100644 index 000000000..625ad9d62 --- /dev/null +++ b/src/DlgRef/DlgRef_2Sel2Spin2Push_QTD.ui @@ -0,0 +1,173 @@ + + + DlgRef_2Sel2Spin2Push_QTD + + + + 0 + 0 + 281 + 165 + + + + + + + + 0 + + + 0 + + + + + + + + + + + + 0 + 0 + + + + TL1 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL2 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL3 + + + false + + + + + + + + + + TL4 + + + + + + + + + + true + + + + + + + + + + + + + true + + + + + + + TL5 + + + + + + + + + + qPixmapFromMimeSource + + + SalomeApp_DoubleSpinBox + QDoubleSpinBox +
SalomeApp_DoubleSpinBox.h
+
+
+ + PushButton1 + LineEdit1 + PushButton2 + LineEdit2 + SpinBox_DX + SpinBox_DY + + + +
diff --git a/src/DlgRef/Makefile.am b/src/DlgRef/Makefile.am index 8566c14e1..e5266843a 100644 --- a/src/DlgRef/Makefile.am +++ b/src/DlgRef/Makefile.am @@ -66,6 +66,7 @@ UIC_FILES = \ ui_DlgRef_2Sel2Spin3Check_QTD.h \ ui_DlgRef_2Sel2Spin_QTD.h \ ui_DlgRef_2Sel2Spin1Push_QTD.h \ + ui_DlgRef_2Sel2Spin2Push_QTD.h \ ui_DlgRef_2Sel3Spin2Rb_QTD.h \ ui_DlgRef_2Sel3Spin_QTD.h \ ui_DlgRef_2Sel4Spin1Check_QTD.h \ diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index d10d88748..8acae0f62 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -147,6 +147,10 @@ ICON_DLG_CHANGE_ORIENTATION change_orientation.png + + ICON_DLG_CHANGE_DIRECTION + change_direction.png + ICON_DLG_REMOVE_EXTRA_EDGES remove_extra_edges.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 6936f97e8..48edbe8ac 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -325,6 +325,10 @@ Please, select face, shell or solid and try again GEOM_CHANGE_ORIENTATION Objects to change orientation + + GEOM_CHANGE_DIRECTION + Change direction + GEOM_CHANGE_ORIENTATION_TITLE Change orientation @@ -541,6 +545,10 @@ Please, select face, shell or solid and try again GEOM_DropSmallEdges DropSmallEdges + + GEOM_DRAFT_ANGLE + Draft angle: + GEOM_EDGE Edge @@ -1211,6 +1219,10 @@ Please, select face, shell or solid and try again GEOM_PIPE_TITLE Pipe Construction + + GEOM_PROFILE + Profile + GEOM_SEGMENT Segment of straight line diff --git a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx index 80f6a8e53..44e8c46d7 100644 --- a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx @@ -69,6 +69,7 @@ OperationGUI_ExtrudedFeatureDlg::OperationGUI_ExtrudedFeatureDlg(const int theOp QPixmap image0; QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICO_DRAFT"))); + QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHANGE_DIRECTION"))); QString aTitle; switch (myOperation) { @@ -94,15 +95,21 @@ OperationGUI_ExtrudedFeatureDlg::OperationGUI_ExtrudedFeatureDlg(const int theOp mainFrame()->RadioButton1->setChecked(true); - myGroup = new DlgRef_2Sel2Spin1Push(centralWidget()); + myGroup = new DlgRef_2Sel2Spin2Push(centralWidget()); + + myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); + myGroup->PushButton1->setIcon(image1); myGroup->PushButton2->setIcon(image1); myGroup->PushButton3->setIcon(image2); + myGroup->PushButton4->setIcon(image3); myGroup->LineEdit1->setReadOnly(true); myGroup->LineEdit2->setReadOnly(true); myGroup->TextLabel1->setText(tr("GEOM_INIT_SHAPE")); - myGroup->TextLabel2->setText(tr("GEOM_SKETCH")); + myGroup->TextLabel2->setText(tr("GEOM_PROFILE")); myGroup->TextLabel3->setText(tr("GEOM_HEIGHT")); + myGroup->TextLabel4->setText(tr("GEOM_DRAFT_ANGLE")); + myGroup->TextLabel5->setText(tr("GEOM_CHANGE_DIRECTION")); QVBoxLayout* layout = new QVBoxLayout(centralWidget()); @@ -153,6 +160,7 @@ void OperationGUI_ExtrudedFeatureDlg::Init() connect(myGroup->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(myGroup->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(myGroup->PushButton3, SIGNAL(clicked(bool)), this, SLOT(ButtonClicked(bool))); + connect(myGroup->PushButton4, SIGNAL(clicked(bool)), this, SLOT(ButtonClicked(bool))); connect(myGroup->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(myGroup->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); @@ -331,7 +339,10 @@ void OperationGUI_ExtrudedFeatureDlg::ValueChangedInSpinBox() //================================================================================= void OperationGUI_ExtrudedFeatureDlg::ButtonClicked(bool checked) { - myGroup->SpinBox_DY->setEnabled(checked); + QPushButton* send = (QPushButton*)sender(); + if (send == myGroup->PushButton3) + myGroup->SpinBox_DY->setEnabled(checked); + displayPreview(true); } @@ -362,16 +373,24 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects) GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation()); double angle=0.0; + double aHeight = myGroup->SpinBox_DX->value(); + if (myGroup->PushButton3->isChecked()) angle=myGroup->SpinBox_DY->value(); + + if (myGroup->PushButton4->isChecked()) + { + aHeight = -aHeight; + angle = -angle; + } bool isProtrusion = (myOperation == OperationGUI::BOSS); // Hide the initial shape in order to see the modifications on the preview - erase(myObject1.get(),false); + erase(myObject1.get(),false); GEOM::GEOM_Object_var anObj = anOper->MakeDraftPrism(myObject1.get(), myObject2.get(), - myGroup->SpinBox_DX->value(), + aHeight, angle, isProtrusion); if (!anObj->_is_nil()) diff --git a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.h b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.h index 6a3123105..e1bdd3066 100644 --- a/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.h +++ b/src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.h @@ -36,7 +36,7 @@ // class DlgRef_2Sel; // class DlgRef_1Sel3Spin; // class DlgRef_1Sel2Spin; -class DlgRef_2Sel2Spin1Push; +class DlgRef_2Sel2Spin2Push; // class QLineEdit; // class QGroupBox; @@ -73,7 +73,7 @@ private: GEOM::GeomObjPtr myObject1; GEOM::GeomObjPtr myObject2; - DlgRef_2Sel2Spin1Push* myGroup; + DlgRef_2Sel2Spin2Push* myGroup; private slots: void ClickOnOk();