From: ana Date: Wed, 19 Nov 2014 12:40:00 +0000 (+0300) Subject: 0022765: [EDF] Improvement of local selection mechanism X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fana%2F22765;p=modules%2Fgeom.git 0022765: [EDF] Improvement of local selection mechanism First step --- diff --git a/doc/salome/gui/GEOM/images/point4.png b/doc/salome/gui/GEOM/images/point4.png index dc3e08641..3be67dbca 100755 Binary files a/doc/salome/gui/GEOM/images/point4.png and b/doc/salome/gui/GEOM/images/point4.png differ diff --git a/doc/salome/gui/GEOM/input/angle.doc b/doc/salome/gui/GEOM/input/angle.doc index 0a3e46b7d..3e81e3340 100644 --- a/doc/salome/gui/GEOM/input/angle.doc +++ b/doc/salome/gui/GEOM/input/angle.doc @@ -4,6 +4,10 @@ This operation returns the angle in degrees between two lines or linear edges. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html angle.png If both objects are vectors, the angle is computed in accordance with their orientations, otherwise the minimum angle is computed. diff --git a/doc/salome/gui/GEOM/input/basic_prop.doc b/doc/salome/gui/GEOM/input/basic_prop.doc index 05b539e0c..2a1c8b9ad 100644 --- a/doc/salome/gui/GEOM/input/basic_prop.doc +++ b/doc/salome/gui/GEOM/input/basic_prop.doc @@ -5,6 +5,10 @@ This operation returns Length, Surface and Volume properties for the selected geometrical object. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html neo-basicprop.png \nTUI Command: geompy.BasicProperties(Shape), where diff --git a/doc/salome/gui/GEOM/input/bounding_box.doc b/doc/salome/gui/GEOM/input/bounding_box.doc index 5d963b097..71e2b3f75 100644 --- a/doc/salome/gui/GEOM/input/bounding_box.doc +++ b/doc/salome/gui/GEOM/input/bounding_box.doc @@ -4,6 +4,10 @@ This operation performs precise computation of bounding box for the selected geometrical object and displays its dimensions. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html measures5.png The coordinates of two corners of its bounding box are shown in the table. diff --git a/doc/salome/gui/GEOM/input/center_mass.doc b/doc/salome/gui/GEOM/input/center_mass.doc index c50370de5..7cab8da45 100644 --- a/doc/salome/gui/GEOM/input/center_mass.doc +++ b/doc/salome/gui/GEOM/input/center_mass.doc @@ -5,6 +5,10 @@ This operation calculates and returns the coordinates of the gravity center for the selected geometrical object. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html measures3.png Press \b Apply or Apply and Close button to publish the \b Point in the study. diff --git a/doc/salome/gui/GEOM/input/creating_point.doc b/doc/salome/gui/GEOM/input/creating_point.doc index a235bf0cd..c4641a7a5 100644 --- a/doc/salome/gui/GEOM/input/creating_point.doc +++ b/doc/salome/gui/GEOM/input/creating_point.doc @@ -53,8 +53,10 @@ projected on the given edge to produce the resulting point. projected point. \image html point3_2.png -\n Fourthly, we can define a point by intersection of two \b Lines or \b Wires (or a Wire and a Line). -If they intersect only once, a point will be created. If there are several intersections, a compound of points will be created. The type of the selected object (Line or Wire) can be changed in the popup menu, after clicking the corresponding selection button. +\n Fourthly, we can define a point by intersection of two \b Lines or \b Wires (or a Wire and a Line). +The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. Press left mouse button to select appropriate object to the dialog box. +If they intersect only once, a point will be created. If there are several intersections, a compound of points will be created. \n TUI Command: geompy.MakePointOnLinesIntersection(myLine1,myWire1). \n Arguments: Name + 2 1D objects diff --git a/doc/salome/gui/GEOM/input/inertia.doc b/doc/salome/gui/GEOM/input/inertia.doc index 70b368497..d2fe665dc 100644 --- a/doc/salome/gui/GEOM/input/inertia.doc +++ b/doc/salome/gui/GEOM/input/inertia.doc @@ -4,6 +4,10 @@ This operation returns the axial moments of inertia for the selected geometrical object. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html measures4.png The table displays: diff --git a/doc/salome/gui/GEOM/input/min_distance.doc b/doc/salome/gui/GEOM/input/min_distance.doc index d4fa336b7..4188890f9 100644 --- a/doc/salome/gui/GEOM/input/min_distance.doc +++ b/doc/salome/gui/GEOM/input/min_distance.doc @@ -4,6 +4,10 @@ This operation returns the minimum distance between two geometrical objects. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html distance.png The query for minimum distance can find one or more solutions, or even an infinite set of solutions. diff --git a/doc/salome/gui/GEOM/input/tolerance.doc b/doc/salome/gui/GEOM/input/tolerance.doc index 2b0bdd0c6..2dd15097c 100644 --- a/doc/salome/gui/GEOM/input/tolerance.doc +++ b/doc/salome/gui/GEOM/input/tolerance.doc @@ -5,6 +5,10 @@ This operation returns the maximum and the minimum tolerance for the selected geometrical object. +\n The appropriate "local" selection is automatically switched on. If there are several entities of allowed types under the mouse cursor, first of them (top-level one) is highlighted. +Press button and scroll the mouse wheel to switch between different available shapes that are pointed by the mouse cursor. The corresponding entities are highlighted in the viewer. +Press left mouse button to select appropriate object to the dialog box. + \image html new-tolerance.png The table displays \b Min and \b Max tolerance values for \b Face, \b Edge and \b Vertex tolerance. diff --git a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx index 89c5f68ce..2f276ef1e 100644 --- a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx @@ -119,6 +119,8 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init() showOnlyPreviewControl(); + globalSelection(); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //@@ initialize dialog box widgets here @@// // Signal/slot connections @@ -160,7 +162,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply() return false; initName(); - + globalSelection(); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); return true; } @@ -171,6 +174,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply() void AdvancedGUI_SmoothingSurfaceDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + globalSelection(); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //displayPreview(); } @@ -249,6 +254,16 @@ bool AdvancedGUI_SmoothingSurfaceDlg::execute (ObjectList& objects) return res; } +//================================================================================= +// function : addSubshapesToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void AdvancedGUI_SmoothingSurfaceDlg::addSubshapesToStudy() +{ + for ( int i = 0; i < myPoints.count(); i++ ) + GEOMBase::PublishSubObject( myPoints[i].get() ); +} + //================================================================================= // function : getNbPoints() // purpose : Returns the number of points in myPoints list. @@ -337,5 +352,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::SetEditCurrentArgument() if ( sender() == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1; myEditCurrentArgument->setFocus(); + globalSelection(); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); SelectionIntoArgument(); } diff --git a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h index 822d2aa0f..23e800647 100644 --- a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h +++ b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h @@ -45,6 +45,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); + virtual void addSubshapesToStudy(); private: void Init(); diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 868c607bb..cf5356214 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -68,8 +69,6 @@ #define SPACING 6 #define MARGIN 9 -enum { SelectEdge, SelectWire }; - //================================================================================= // class : BasicGUI_PointDlg() // purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the @@ -150,20 +149,15 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ")); /* popup menu for line intersect buttons */ - myBtnPopup = new QMenu(this); QIcon ico_line = QIcon(image6); QIcon ico_wire = QIcon(image7); - myActions[myBtnPopup->addAction(ico_line, tr("GEOM_EDGE"))] = SelectEdge; - myActions[myBtnPopup->addAction(ico_wire, tr("GEOM_WIRE"))] = SelectWire; GroupLineIntersection = new DlgRef_2Sel(centralWidget()); GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION")); GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1")); GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2")); GroupLineIntersection->PushButton1->setIcon(image2); - GroupLineIntersection->PushButton1->setMenu(myBtnPopup); GroupLineIntersection->PushButton2->setIcon(image2); - GroupLineIntersection->PushButton2->setMenu(myBtnPopup); GroupLineIntersection->LineEdit2->setEnabled(false); myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget()); @@ -286,9 +280,7 @@ void BasicGUI_PointDlg::Init() connect(GroupOnSurface->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupLineIntersection->PushButton1, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument())); connect(GroupLineIntersection->PushButton2, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument())); - - connect(myBtnPopup, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*))); - + connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); @@ -391,8 +383,9 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId) case GEOM_POINT_INTINT: { globalSelection(); // close local contexts, if any - myNeedType = TopAbs_EDGE; - localSelection(GEOM::GEOM_Object::_nil(), myNeedType); + std::list needTypes; + needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ); + localSelection(GEOM::GEOM_Object::_nil(), needTypes ); myEditCurrentArgument = GroupLineIntersection->LineEdit1; GroupLineIntersection->LineEdit1->setText(""); @@ -500,7 +493,14 @@ void BasicGUI_PointDlg::SelectionIntoArgument() myLine2.nullify(); } - GEOM::GeomObjPtr aSelectedObject = getSelected(myNeedType); + GEOM::GeomObjPtr aSelectedObject; + if (id == GEOM_POINT_INTINT) { + QList needTypes; + needTypes << TopAbs_EDGE, needTypes << TopAbs_WIRE; + aSelectedObject= getSelected(needTypes); + } + else + aSelectedObject= getSelected(myNeedType); TopoDS_Shape aShape; if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) { QString aName = GEOMBase::GetName(aSelectedObject.get()); @@ -535,19 +535,13 @@ void BasicGUI_PointDlg::SelectionIntoArgument() if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) { myLine1 = aSelectedObject; if (myLine1 && !myLine2) { - GroupLineIntersection->PushButton2->setMenu(0); GroupLineIntersection->PushButton2->click(); - GroupLineIntersection->PushButton2->setDown(true); - GroupLineIntersection->PushButton2->setMenu(myBtnPopup); } } else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) { myLine2 = aSelectedObject; if (myLine2 && !myLine1) { - GroupLineIntersection->PushButton1->setMenu(0); GroupLineIntersection->PushButton1->click(); - GroupLineIntersection->PushButton1->setDown(true); - GroupLineIntersection->PushButton1->setMenu(myBtnPopup); } } } @@ -992,17 +986,6 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate) QTimer::singleShot(50, this, SLOT(updateSize())); } -//================================================================================= -// function : onBtnPopup() -// purpose : -//================================================================================= -void BasicGUI_PointDlg::onBtnPopup(QAction* a) -{ - globalSelection(); // close local contexts, if any - myNeedType = myActions[a] == SelectEdge ? TopAbs_EDGE : TopAbs_WIRE; - localSelection(GEOM::GEOM_Object::_nil(), myNeedType); -} - //================================================================================= // function : updateSize // purpose : adjust dialog size to minimum diff --git a/src/BasicGUI/BasicGUI_PointDlg.h b/src/BasicGUI/BasicGUI_PointDlg.h index ddd413f7b..ec691ae94 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.h +++ b/src/BasicGUI/BasicGUI_PointDlg.h @@ -99,7 +99,6 @@ private: QGroupBox* myParamGroup; QButtonGroup* myParamCoord; - QMenu* myBtnPopup; QMap myActions; TopAbs_ShapeEnum myNeedType; @@ -116,7 +115,6 @@ private slots: void SetDoubleSpinBoxStep( double ); void ClickParamCoord( int ); void CheckBoxClicked( int ); - void onBtnPopup( QAction* ); void updateSize(); }; diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index e7b02e6b4..ba67388e9 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -460,9 +460,9 @@ void GEOMBase_Helper::activate( const int theType ) //================================================================ // Function : localSelection // Purpose : Activate selection of sub-shapes in accordance with mode -// theMode is from TopAbs_ShapeEnum +// modes are from TopAbs_ShapeEnum //================================================================ -void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode ) +void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const std::list modes ) { SALOME_ListIO aListOfIO; @@ -478,7 +478,7 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); } - getDisplayer()->LocalSelection( aListOfIO, theMode ); + getDisplayer()->LocalSelection( aListOfIO, modes ); } //================================================================ @@ -486,19 +486,42 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo // Purpose : Activate selection of sub-shapes in accordance with mode // theMode is from TopAbs_ShapeEnum //================================================================ -void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode ) +void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode ) +{ + std::list modes; + modes.push_back( theMode ); + localSelection( theObjs, modes ); +} + +//================================================================ +// Function : localSelection +// Purpose : Activate selection of sub-shapes in accordance with mode +// modes are from TopAbs_ShapeEnum +//================================================================ +void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const std::list modes ) { // If object is null local selection for all objects is activated if ( obj->_is_nil() ) { - getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), mode ); + getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), modes ); return; } ObjectList objList; objList.push_back( obj ); - localSelection( objList, mode ); + localSelection( objList, modes ); } +//================================================================ +// Function : localSelection +// Purpose : Activate selection of sub-shapes in accordance with mode +// mode is from TopAbs_ShapeEnum +//================================================================ +void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode ) +{ + std::list modes; + modes.push_back( mode ); + localSelection( obj, modes ); +} //================================================================ // Function : globalSelection diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index 438c3c26d..731b63d06 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -95,7 +95,9 @@ protected: const bool = true ); void erasePreview ( const bool = true ); + void localSelection( const ObjectList&, const std::list ); void localSelection( const ObjectList&, const int ); + void localSelection( GEOM::GEOM_Object_ptr, const std::list ); void localSelection( GEOM::GEOM_Object_ptr, const int ); void activate( const int ); void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index c68154970..fe124e69e 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1772,7 +1772,7 @@ void GEOM_Displayer::internalReset() * of their sub-shapes (with opened local context for OCC viewer) */ //================================================================= -void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const int theMode ) +void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const std::list modes ) { SUIT_Session* session = SUIT_Session::session(); SalomeApp_Application* app = dynamic_cast( session->activeApplication() ); @@ -1789,11 +1789,25 @@ void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& the if (!theIO.IsNull() && !vf->isVisible(theIO)) Display(theIO); SALOME_Prs* prs = vf->CreatePrs( theIO.IsNull() ? 0 : theIO->getEntry() ); - vf->LocalSelection( prs, theMode ); + vf->LocalSelection( prs, modes ); delete prs; // delete presentation because displayer is its owner } } +//================================================================= +/*! + * GEOM_Displayer::LocalSelection + * Activate selection of CAD shapes with activisation of selection + * of their sub-shapes (with opened local context for OCC viewer) + */ +//================================================================= +void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const int theMode ) +{ + std::list modes; + modes.push_back( theMode ); + LocalSelection( theIO, modes ); +} + //================================================================= /*! * GEOM_Displayer::globalSelection @@ -1907,11 +1921,25 @@ void GEOM_Displayer::GlobalSelection( const TColStd_MapOfInteger& theModes, * of their sub-shapes (with opened local context for OCC viewer) */ //================================================================= -void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const int theMode ) +void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const std::list modes ) { SALOME_ListIteratorOfListIO Iter( theIOList ); for ( ; Iter.More(); Iter.Next() ) - LocalSelection( Iter.Value(), theMode ); + LocalSelection( Iter.Value(), modes ); +} + +//================================================================= +/*! + * GEOM_Displayer::LocalSelection + * Activate selection of CAD shapes with activisation of selection + * of their sub-shapes (with opened local context for OCC viewer) + */ +//================================================================= +void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const int theMode ) +{ + std::list modes; + modes.push_back( theMode ); + LocalSelection( theIOList, modes ); } //================================================================= diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 7f0d01d99..bc90d12c8 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -183,7 +183,9 @@ public: bool ToActivate() const; /* Activate/Deactivate selection*/ + void LocalSelection( const Handle(SALOME_InteractiveObject)&, const std::list ); void LocalSelection( const Handle(SALOME_InteractiveObject)&, const int ); + void LocalSelection( const SALOME_ListIO& theIOList, const std::list ); void LocalSelection( const SALOME_ListIO& theIOList, const int ); void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); void GlobalSelection( const TColStd_MapOfInteger&, const bool = false, const QList* = 0 ); diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 141b9598f..e45cd85c6 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -105,7 +105,8 @@ void GenerationGUI_FillingDlg::Init() myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->LineEdit1->setReadOnly(true); - globalSelection(GEOM_COMPOUND); + globalSelection(); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_COMPOUND ); int SpecificStep1 = 1; double SpecificStep2 = 0.0001; @@ -227,6 +228,7 @@ void GenerationGUI_FillingDlg::SetEditCurrentArgument() GroupPoints->LineEdit1->setFocus(); myEditCurrentArgument = GroupPoints->LineEdit1; globalSelection(GEOM_COMPOUND); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_COMPOUND ); this->SelectionIntoArgument(); } } @@ -240,7 +242,8 @@ void GenerationGUI_FillingDlg::ActivateThisDialog() GEOMBase_Skeleton::ActivateThisDialog(); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - globalSelection(GEOM_COMPOUND); + globalSelection(GEOM_COMPOUND); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_COMPOUND ); processPreview(); } @@ -372,3 +375,12 @@ bool GenerationGUI_FillingDlg::execute(ObjectList& objects) return true; } + +//================================================================================= +// function : addSubshapesToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void GenerationGUI_FillingDlg::addSubshapesToStudy() +{ + GEOMBase::PublishSubObject( myCompound.get() ); +} \ No newline at end of file diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.h b/src/GenerationGUI/GenerationGUI_FillingDlg.h index a6a828a04..650d048f3 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.h +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.h @@ -49,6 +49,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); + virtual void addSubshapesToStudy(); private: void Init(); diff --git a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx index 9afe3b922..6241fbb38 100644 --- a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx @@ -136,7 +136,10 @@ void MeasureGUI_AngleDlg::Init() // init variables myGrp->LineEdit1->setText(""); myGrp->LineEdit2->setText(""); - myObj = myObj2 = GEOM::GEOM_Object::_nil(); + myGrp->LineEdit1->setEnabled(true); + myGrp->LineEdit2->setEnabled(false); + myObj.nullify(); + myObj2.nullify(); mySelBtn = myGrp->PushButton1; mySelEdit = myGrp->LineEdit1; @@ -149,7 +152,7 @@ void MeasureGUI_AngleDlg::Init() connect(mySelEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(mySelBtn2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - globalSelection(GEOM_LINE); + activateSelection(); MeasureGUI_Skeleton::Init(); } @@ -159,15 +162,7 @@ void MeasureGUI_AngleDlg::Init() //================================================================================= void MeasureGUI_AngleDlg::SelectionIntoArgument() { - LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); - SALOME_ListIO aSelList; - aSelMgr->selectedObjects(aSelList); - - GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); - - if (aSelList.Extent() > 0) { - aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - } + GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_EDGE ); // clear selection disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); @@ -177,12 +172,12 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument() if (myEditCurrentArgument == mySelEdit) { myObj = aSelectedObject; - if (!myObj->_is_nil() && myObj2->_is_nil()) + if (myObj && !myObj2) myGrp->PushButton2->click(); } else { myObj2 = aSelectedObject; - if (!myObj2->_is_nil() && myObj->_is_nil()) + if (myObj2 && !myObj) myGrp->PushButton1->click(); } @@ -195,8 +190,8 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument() //================================================================================= void MeasureGUI_AngleDlg::processObject() { - myGrp->LineEdit1->setText(!myObj->_is_nil() ? GEOMBase::GetName(myObj ) : ""); - myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : ""); + myGrp->LineEdit1->setText(myObj ? GEOMBase::GetName(myObj.get()) : ""); + myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : ""); double anAngle = 0.; if (getParameters(anAngle)) { @@ -220,7 +215,7 @@ bool MeasureGUI_AngleDlg::getParameters (double& theAngle) if (isValid(msg)) { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); try { - theAngle = anOper->GetAngle(myObj, myObj2); + theAngle = anOper->GetAngle(myObj.get(), myObj2.get()); } catch(const SALOME::SALOME_Exception& e) { SalomeApp_Tools::QtCatchCorbaException(e); @@ -262,7 +257,7 @@ void MeasureGUI_AngleDlg::SetEditCurrentArgument() } disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); - globalSelection(GEOM_LINE); + activateSelection(); connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -304,10 +299,11 @@ void MeasureGUI_AngleDlg::LineEditReturnPressed() SALOME_Prs* MeasureGUI_AngleDlg::buildPrs() { double anAngle = 0.; + myGrp->LineEdit3->setText(""); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - if (myObj->_is_nil() || myObj2->_is_nil() || !getParameters(anAngle) || + if (!myObj || !myObj2 || !getParameters(anAngle) || vw->getViewManager()->getType() != OCCViewer_Viewer::Type()) return 0; @@ -315,8 +311,8 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs() try { OCC_CATCH_SIGNALS; TopoDS_Shape S1, S2; - if (GEOMBase::GetShape(myObj , S1, TopAbs_EDGE) && - GEOMBase::GetShape(myObj2, S2, TopAbs_EDGE)) { + if (GEOMBase::GetShape(myObj.get() , S1, TopAbs_EDGE) && + GEOMBase::GetShape(myObj2.get(), S2, TopAbs_EDGE)) { TopoDS_Edge anEdge1 = TopoDS::Edge(S1); TopoDS_Edge anEdge2 = TopoDS::Edge(S2); @@ -399,5 +395,15 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs() //================================================================================= bool MeasureGUI_AngleDlg::isValid (QString& msg) { - return MeasureGUI_Skeleton::isValid(msg) && !myObj2->_is_nil(); + return MeasureGUI_Skeleton::isValid(msg) && myObj2; +} + +//================================================================================= +// function : activateSelection() +// purpose : +//================================================================================= +void MeasureGUI_AngleDlg::activateSelection() +{ + globalSelection(GEOM_LINE); + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE ); } diff --git a/src/MeasureGUI/MeasureGUI_AngleDlg.h b/src/MeasureGUI/MeasureGUI_AngleDlg.h index 46615265d..d12a22666 100644 --- a/src/MeasureGUI/MeasureGUI_AngleDlg.h +++ b/src/MeasureGUI/MeasureGUI_AngleDlg.h @@ -52,6 +52,7 @@ protected: private: void Init(); bool getParameters( double& ); + void activateSelection(); private: QLineEdit* myEditCurrentArgument; @@ -59,7 +60,7 @@ private: QPushButton* mySelBtn2; MeasureGUI_2Sel1LineEdit* myGrp; - GEOM::GEOM_Object_var myObj2; + GEOM::GeomObjPtr myObj2; }; #endif // MEASUREGUI_ANGLEDLG_H diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 0da5051ba..436c4a003 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -124,7 +124,7 @@ void MeasureGUI_BndBoxDlg::Init() this, SLOT(SelectionIntoArgument())); initName(tr("GEOM_BNDBOX")); - globalSelection(); + activateSelection(); SelectionIntoArgument(); } @@ -148,6 +148,7 @@ bool MeasureGUI_BndBoxDlg::ClickOnApply() return false; initName(); + activateSelection(); return true; } @@ -162,7 +163,7 @@ void MeasureGUI_BndBoxDlg::ActivateThisDialog() connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - globalSelection(); + activateSelection(); redisplayPreview(); } @@ -216,11 +217,11 @@ bool MeasureGUI_BndBoxDlg::getParameters (double& theXmin, double& theXmax, double& theYmin, double& theYmax, double& theZmin, double& theZmax) { - if (myObj->_is_nil()) + if (!myObj) return false; GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation()); - anOper->GetBoundingBox(myObj, true, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax); + anOper->GetBoundingBox(myObj.get(), true, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax); return anOper->IsDone(); } @@ -249,28 +250,19 @@ SALOME_Prs* MeasureGUI_BndBoxDlg::buildPrs() void MeasureGUI_BndBoxDlg::SelectionIntoArgument() { myEditCurrentArgument->setText(""); - myObj = GEOM::GEOM_Object::_nil(); + myObj.nullify(); - LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); - SALOME_ListIO aSelList; - aSelMgr->selectedObjects(aSelList); + QList aTypes; + aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE; + myObj = getSelected( aTypes ); - if (aSelList.Extent() != 1) { + if ( !myObj ) { processObject(); erasePreview(); return; } - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First()); - - if (aSelectedObject->_is_nil()) { - processObject(); - erasePreview(); - return; - } - - myObj = aSelectedObject; - myEditCurrentArgument->setText(GEOMBase::GetName(myObj)); + myEditCurrentArgument->setText(GEOMBase::GetName(myObj.get())); processObject(); redisplayPreview(); } @@ -290,7 +282,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_BndBoxDlg::createOperation() //================================================================================= bool MeasureGUI_BndBoxDlg::isValid (QString&) { - return !myObj->_is_nil(); + return myObj; } //================================================================================= @@ -300,7 +292,7 @@ bool MeasureGUI_BndBoxDlg::isValid (QString&) bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects) { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation()); - GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj, true); + GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj.get(), true); if (!anObj->_is_nil()) objects.push_back(anObj._retn()); @@ -308,6 +300,20 @@ bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects) return true; } +//================================================================================= +// function : activateSelection() +// purpose : +//================================================================================= +void MeasureGUI_BndBoxDlg::activateSelection() +{ + globalSelection( GEOM_ALLSHAPES ); + std::list needTypes; + needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); + needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ); + needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND ); + localSelection(GEOM::GEOM_Object::_nil(), needTypes ); +} + //================================================================================= // function : redisplayPreview() // purpose : @@ -337,3 +343,12 @@ void MeasureGUI_BndBoxDlg::redisplayPreview() catch (...) { } } + +//================================================================================= +// function : addSubshapeToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void MeasureGUI_BndBoxDlg::addSubshapesToStudy() +{ + GEOMBase::PublishSubObject( myObj.get() ); +} diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h index 1386f0c30..0a7a3d9a1 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h @@ -48,7 +48,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - + virtual void addSubshapesToStudy(); void redisplayPreview(); virtual void processObject(); virtual SALOME_Prs* buildPrs(); @@ -56,10 +56,11 @@ protected: private: void Init(); void enterEvent (QEvent*); + void activateSelection(); bool getParameters (double&, double&, double&, double&, double&, double&); private: - GEOM::GEOM_Object_var myObj; + GEOM::GeomObjPtr myObj; MeasureGUI_1Sel6LineEdit* myGrp; private slots: diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx index 64a3f556e..8a6a2cc22 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -120,10 +120,23 @@ void MeasureGUI_CenterMassDlg::Init() SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); initName( tr( "GEOM_POINT") ); - globalSelection(); + activateSelection(); SelectionIntoArgument(); } +//================================================================================= +// function : activateSelection +// purpose : +//================================================================================= +void MeasureGUI_CenterMassDlg::activateSelection() +{ + globalSelection( GEOM_ALLSHAPES ); + std::list needTypes; + needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); + needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ); + needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND ); + localSelection(GEOM::GEOM_Object::_nil(), needTypes ); +} //================================================================================= // function : ClickOnOk() @@ -146,6 +159,7 @@ bool MeasureGUI_CenterMassDlg::ClickOnApply() return false; initName(); + activateSelection(); return true; // myMeasureGUI->MakeCDGAndDisplay( myGeomShape ); @@ -159,26 +173,17 @@ bool MeasureGUI_CenterMassDlg::ClickOnApply() void MeasureGUI_CenterMassDlg::SelectionIntoArgument() { erasePreview(); - myObj = GEOM::GEOM_Object::_nil(); - - LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); - SALOME_ListIO aSelList; - aSelMgr->selectedObjects(aSelList); - - if (aSelList.Extent() != 1) { - processObject(); - return; - } - GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + myObj.nullify(); + QList aTypes; + aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE; + myObj = getSelected( aTypes ); - if ( aSelectedObject->_is_nil() ) { + if ( !myObj ) { processObject(); return; } - myObj = aSelectedObject; processObject(); displayPreview(true); } @@ -220,7 +225,7 @@ void MeasureGUI_CenterMassDlg::ActivateThisDialog() connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - globalSelection(); + activateSelection(); displayPreview(true); } @@ -230,7 +235,7 @@ void MeasureGUI_CenterMassDlg::ActivateThisDialog() //================================================================================= void MeasureGUI_CenterMassDlg::processObject() { - if ( myObj->_is_nil() ) { + if ( !myObj ) { myGrp->LineEdit1->setText( "" ); myGrp->LineEdit2->setText( "" ); myGrp->LineEdit3->setText( "" ); @@ -242,7 +247,7 @@ void MeasureGUI_CenterMassDlg::processObject() getParameters( x, y, z ); - myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) ); + myGrp->LineEdit1->setText( GEOMBase::GetName( myObj.get() ) ); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); @@ -280,7 +285,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_CenterMassDlg::createOperation() //================================================================================= bool MeasureGUI_CenterMassDlg::isValid( QString& ) { - return !myObj->_is_nil(); + return myObj; } //================================================================================= @@ -289,12 +294,12 @@ bool MeasureGUI_CenterMassDlg::isValid( QString& ) //================================================================================= bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double& theZ ) { - if ( myObj->_is_nil() ) + if ( !myObj ) return false; else { try { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); - GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj ); + GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj.get() ); if ( !anOper->IsDone() ) return false; @@ -328,10 +333,19 @@ bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double bool MeasureGUI_CenterMassDlg::execute( ObjectList& objects ) { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); - GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj ); + GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj.get() ); if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); return true; } + +//================================================================================= +// function : addSubshapeToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void MeasureGUI_CenterMassDlg::addSubshapesToStudy() +{ + GEOMBase::PublishSubObject( myObj.get() ); +} diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.h b/src/MeasureGUI/MeasureGUI_CenterMassDlg.h index f279c6c33..ce1bbf335 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.h +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.h @@ -47,6 +47,7 @@ protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); + virtual void addSubshapesToStudy(); virtual bool execute( ObjectList& ); private slots: @@ -61,10 +62,11 @@ private: void Init(); void enterEvent( QEvent* ); void processObject(); + void activateSelection(); bool getParameters( double&, double&, double& ); private: - GEOM::GEOM_Object_var myObj; + GEOM::GeomObjPtr myObj; MeasureGUI_1Sel3LineEdit* myGrp; }; diff --git a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx index 8debf294c..e8a250b60 100644 --- a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx @@ -125,7 +125,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::processObject() myGrp->ListBox2->clear(); erasePreview(); - if (myObj->_is_nil()) + if (!myObj) return; QString aMsg (""); @@ -133,7 +133,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::processObject() bool isGood = false, isFailed = false; int nbPairs = 0; try { - isGood = anOper->CheckSelfIntersections(myObj, myInters); + isGood = anOper->CheckSelfIntersections(myObj.get(), myInters); nbPairs = myInters->length()/2; if (nbPairs*2 != myInters->length()) { isFailed = true; @@ -197,7 +197,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onErrorsListSelectionChanged() QStringList aSubShapeList; TopoDS_Shape aSelShape; - if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) { + if (myObj && GEOMBase::GetShape(myObj.get(), aSelShape)) { TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(aSelShape, anIndices); @@ -239,7 +239,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onSubShapesListSelectionChanged() TopoDS_Shape aSelShape; TopoDS_Shape aSubShape; TopTools_IndexedMapOfShape anIndices; - if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) { + if (myObj && GEOMBase::GetShape(myObj.get(), aSelShape)) { SALOME_Prs* aPrs = 0; TopExp::MapShapes(aSelShape, anIndices); QList::iterator it; diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx index 4fcbc5796..64e58fb08 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -128,6 +128,12 @@ void MeasureGUI_DistanceDlg::Init() myEditCurrentArgument = myGrp->LineEdit1; myDbls = new GEOM::ListOfDouble(); + myGrp->LineEdit1->setEnabled(true); + myGrp->LineEdit2->setEnabled(false); + + myObj1.nullify(); + myObj2.nullify(); + // signals and slots connections connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -140,7 +146,7 @@ void MeasureGUI_DistanceDlg::Init() connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - globalSelection(); + activateSelection(); SelectionIntoArgument(); } @@ -164,6 +170,7 @@ bool MeasureGUI_DistanceDlg::ClickOnApply() return false; initName(); + activateSelection(); return true; } @@ -178,7 +185,7 @@ void MeasureGUI_DistanceDlg::ActivateThisDialog() connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - globalSelection(); + activateSelection(); redisplayPreview(); } @@ -230,15 +237,9 @@ void MeasureGUI_DistanceDlg::SolutionSelected (int i) //================================================================================= void MeasureGUI_DistanceDlg::SelectionIntoArgument() { - LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); - SALOME_ListIO aSelList; - aSelMgr->selectedObjects(aSelList); - - GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); - - if (aSelList.Extent() > 0) { - aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First()); - } + QList aTypes; + aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE; + GEOM::GeomObjPtr aSelectedObject = getSelected( aTypes ); // clear selection disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); @@ -248,12 +249,12 @@ void MeasureGUI_DistanceDlg::SelectionIntoArgument() if (myEditCurrentArgument == myGrp->LineEdit1) { myObj1 = aSelectedObject; - if (!myObj1->_is_nil() && myObj2->_is_nil()) + if (myObj1 && !myObj2) myGrp->PushButton2->click(); } else { myObj2 = aSelectedObject; - if (!myObj2->_is_nil() && myObj1->_is_nil()) + if (myObj2 && !myObj1) myGrp->PushButton1->click(); } @@ -297,8 +298,8 @@ void MeasureGUI_DistanceDlg::SetEditCurrentArgument() //================================================================================= void MeasureGUI_DistanceDlg::processObject() { - myGrp->LineEdit1->setText(!myObj1->_is_nil() ? GEOMBase::GetName(myObj1) : ""); - myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : ""); + myGrp->LineEdit1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : ""); + myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : ""); myGrp->ComboBox1->clear(); myDbls->length(0); @@ -311,7 +312,7 @@ void MeasureGUI_DistanceDlg::processObject() GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation()); try { - nbSols = anOper->ClosestPoints(myObj1, myObj2, myDbls); + nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), myDbls); } catch (const SALOME::SALOME_Exception& e) { SalomeApp_Tools::QtCatchCorbaException(e); @@ -340,7 +341,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs() int currSol = myGrp->ComboBox1->currentIndex(); - if (myObj1->_is_nil() || myObj2->_is_nil() || + if (!myObj1 || !myObj2 || currSol == -1 || (currSol+1)*6 > myDbls->length() || vw->getViewManager()->getType() != OCCViewer_Viewer::Type()) return 0; @@ -424,7 +425,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation() //================================================================================= bool MeasureGUI_DistanceDlg::isValid (QString& msg) { - return !myObj1->_is_nil() && !myObj2->_is_nil(); + return myObj1 && myObj2; } //================================================================================= @@ -437,7 +438,7 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects) GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId()); GEOM::ListOfDouble_var aDbls; - int nbSols = anOper->ClosestPoints(myObj1, myObj2, aDbls); + int nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), aDbls); if (anOper->IsDone()) { bool doPublishAll = true; @@ -482,6 +483,20 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects) return true; } +//================================================================================= +// function : activateSelection() +// purpose : +//================================================================================= +void MeasureGUI_DistanceDlg::activateSelection() +{ + globalSelection( GEOM_ALLSHAPES ); + std::list needTypes; + needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ); + needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ); + needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND ); + localSelection(GEOM::GEOM_Object::_nil(), needTypes ); +} + //================================================================================= // function : redisplayPreview() // purpose : @@ -517,11 +532,21 @@ void MeasureGUI_DistanceDlg::redisplayPreview() QString MeasureGUI_DistanceDlg::getNewObjectName (int currObj) const { QString aName = tr("GEOM_MINDIST_NAME") + QString("_%1_").arg((currObj+1)/2); - aName += GEOMBase::GetName(currObj%2 ? myObj1 : myObj2); + aName += GEOMBase::GetName(currObj%2 ? myObj1.get() : myObj2.get()); return aName; } +//================================================================================= +// function : addSubshapeToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void MeasureGUI_DistanceDlg::addSubshapesToStudy() +{ + GEOMBase::PublishSubObject( myObj1.get() ); + GEOMBase::PublishSubObject( myObj2.get() ); +} + //================================================================================= // function : MeasureGUI_DistanceGroup // purpose : diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.h b/src/MeasureGUI/MeasureGUI_DistanceDlg.h index 04c9ed820..9b0b35d26 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.h +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.h @@ -99,6 +99,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); + virtual void addSubshapesToStudy(); virtual QString getNewObjectName (int CurrObj = -1) const; void redisplayPreview(); @@ -108,10 +109,11 @@ protected: private: void Init(); void enterEvent (QEvent*); + void activateSelection(); private: - GEOM::GEOM_Object_var myObj1; - GEOM::GEOM_Object_var myObj2; + GEOM::GeomObjPtr myObj1; + GEOM::GeomObjPtr myObj2; MeasureGUI_DistanceGroup* myGrp; GEOM::ListOfDouble_var myDbls; diff --git a/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx b/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx index 47a240e48..9d529f2f9 100644 --- a/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx @@ -114,6 +114,19 @@ void MeasureGUI_InertiaDlg::Init() MeasureGUI_Skeleton::Init(); } +//================================================================================= +// function : activateSelection() +// purpose : +//================================================================================= +void MeasureGUI_InertiaDlg::activateSelection() +{ + MeasureGUI_Skeleton::activateSelection(); + std::list needTypes; + needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND ); + localSelection(GEOM::GEOM_Object::_nil(), needTypes ); +} + + //================================================================================= // function : processObject // purpose : @@ -168,13 +181,13 @@ void MeasureGUI_InertiaDlg::processObject() bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I, gp_XYZ& theIXYZ ) { - if ( myObj->_is_nil() ) + if ( !myObj ) return false; else { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); try { double x, y, z; - anOper->GetInertia( myObj, + anOper->GetInertia( myObj.get(), I( 1, 1 ), I( 1, 2 ), I( 1, 3 ), I( 2, 1 ), I( 2, 2 ), I( 2, 3 ), I( 3, 1 ), I( 3, 2 ), I( 3, 3 ), @@ -190,3 +203,22 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I, return anOper->IsDone(); } } + +void MeasureGUI_InertiaDlg::SelectionIntoArgument() +{ + myObj.nullify(); + QList aTypes; + aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE; + myObj = getSelected( aTypes ); + + if (!myObj) { + mySelEdit->setText(""); + processObject(); + erasePreview(); + return; + } + + mySelEdit->setText(GEOMBase::GetName(myObj.get())); + processObject(); + redisplayPreview(); +} \ No newline at end of file diff --git a/src/MeasureGUI/MeasureGUI_InertiaDlg.h b/src/MeasureGUI/MeasureGUI_InertiaDlg.h index 48fa73f3e..79712359b 100644 --- a/src/MeasureGUI/MeasureGUI_InertiaDlg.h +++ b/src/MeasureGUI/MeasureGUI_InertiaDlg.h @@ -49,6 +49,8 @@ public: protected: // redefined from GEOMBase_Helper and MeasureGUI_Skeleton virtual void processObject(); + virtual void activateSelection(); + virtual void SelectionIntoArgument(); private: void Init(); diff --git a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx index 0e34b7650..612ac65b8 100644 --- a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx @@ -26,6 +26,7 @@ // #include "MeasureGUI_MaxToleranceDlg.h" #include "MeasureGUI_Widgets.h" +#include #include "DlgRef.h" #include @@ -163,7 +164,7 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler, else { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); try { - anOper->GetTolerance( myObj, + anOper->GetTolerance( myObj.get(), theMinFaceToler, theMaxFaceToler, theMinEdgeToler, theMaxEdgeToler, theMinVertexToler, theMaxVertexToler ); } @@ -175,3 +176,35 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler, return anOper->IsDone(); } } + +//================================================================================= +// function : activateSelection() +// purpose : +//================================================================================= +void MeasureGUI_MaxToleranceDlg::activateSelection() +{ + globalSelection( GEOM_ALLSHAPES ); + std::list needTypes; + needTypes.push_back( TopAbs_SHAPE ), needTypes.push_back( TopAbs_EDGE ); + needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ); + needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPSOLID ), needTypes.push_back( TopAbs_COMPOUND ); localSelection(GEOM::GEOM_Object::_nil(), needTypes ); +} + +void MeasureGUI_MaxToleranceDlg::SelectionIntoArgument() +{ + myObj.nullify(); + QList aTypes; + aTypes << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE; + myObj = getSelected( aTypes ); + + if (!myObj) { + mySelEdit->setText(""); + processObject(); + erasePreview(); + return; + } + + mySelEdit->setText(GEOMBase::GetName(myObj.get())); + processObject(); + redisplayPreview(); +} diff --git a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h index c225d6efa..69113b314 100644 --- a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h +++ b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h @@ -46,9 +46,11 @@ public: protected: // redefined from GEOMBase_Helper and MeasureGUI_Skeleton virtual void processObject(); + virtual void SelectionIntoArgument(); private: void Init(); + void activateSelection(); bool getParameters( double&, double&, double&, double&, double&, double& ); diff --git a/src/MeasureGUI/MeasureGUI_PointDlg.cxx b/src/MeasureGUI/MeasureGUI_PointDlg.cxx index e21d5252f..7f4c89798 100644 --- a/src/MeasureGUI/MeasureGUI_PointDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_PointDlg.cxx @@ -122,7 +122,7 @@ void MeasureGUI_PointDlg::activateSelection() void MeasureGUI_PointDlg::SelectionIntoArgument() { try { - myObj = GEOM::GEOM_Object::_nil(); + myObj.nullify(); myGrp->LineEdit1->setText( "" ); myGrp->LineEdit2->setText( "" ); myGrp->LineEdit3->setText( "" ); @@ -135,23 +135,20 @@ void MeasureGUI_PointDlg::SelectionIntoArgument() if (aSelList.Extent() < 1) return; - GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + myObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( aSelectedObject->_is_nil() ) + if ( !myObj ) return; - myObj = aSelectedObject; - TColStd_IndexedMapOfInteger anIndexes; aSelMgr->GetIndexes(aSelList.First(), anIndexes); TopoDS_Shape aShape; - if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj, aShape ) || aShape.IsNull() ) + if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj.get(), aShape ) || aShape.IsNull() ) return; TopoDS_Vertex aPoint; - QString aName = GEOMBase::GetName( myObj ); + QString aName = GEOMBase::GetName( myObj.get() ); if ( anIndexes.Extent() == 0 ) { if ( aShape.ShapeType() == TopAbs_VERTEX ) aPoint = TopoDS::Vertex( aShape ); @@ -180,7 +177,7 @@ void MeasureGUI_PointDlg::SelectionIntoArgument() } catch( ... ) { - myObj = GEOM::GEOM_Object::_nil(); + myObj.nullify(); myGrp->LineEdit1->setText( "" ); myGrp->LineEdit2->setText( "" ); myGrp->LineEdit3->setText( "" ); diff --git a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx index 9e434c969..c3ace18a2 100644 --- a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx @@ -122,8 +122,30 @@ void MeasureGUI_PropertiesDlg::activateSelection() } globalSelection( aTypes ); + + std::list needTypes; + needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND ); + localSelection(GEOM::GEOM_Object::_nil(), needTypes ); } +void MeasureGUI_PropertiesDlg::SelectionIntoArgument() +{ + myObj.nullify(); + QList aTypes; + aTypes << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND; + myObj = getSelected( aTypes ); + + if (!myObj) { + mySelEdit->setText(""); + processObject(); + erasePreview(); + return; + } + + mySelEdit->setText(GEOMBase::GetName(myObj.get())); + processObject(); + redisplayPreview(); +} //================================================================================= // function : processObject // purpose : @@ -155,12 +177,12 @@ bool MeasureGUI_PropertiesDlg::getParameters( double& theLength, double& theArea, double& theVolume ) { - if ( myObj->_is_nil() ) + if ( !myObj ) return false; else { GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); try { - anOper->GetBasicProperties( myObj, theLength, theArea, theVolume ); + anOper->GetBasicProperties( myObj.get(), theLength, theArea, theVolume ); } catch( const SALOME::SALOME_Exception& e ) { SalomeApp_Tools::QtCatchCorbaException( e ); @@ -180,8 +202,8 @@ SALOME_Prs* MeasureGUI_PropertiesDlg::buildPrs() SALOME_Prs* prs = 0; TopoDS_Shape shape; - if ( GEOMBase::GetShape( myObj, shape, TopAbs_EDGE ) && - getDisplayer()->IsDisplayed( GEOMBase::GetEntry(myObj) ) ) { + if ( GEOMBase::GetShape( myObj.get(), shape, TopAbs_EDGE ) && + getDisplayer()->IsDisplayed( GEOMBase::GetEntry(myObj.get()) ) ) { shape = GEOMBase::CreateArrowForLinearEdge( shape ); if ( !shape.IsNull() ) prs = getDisplayer()->BuildPrs( shape ); diff --git a/src/MeasureGUI/MeasureGUI_PropertiesDlg.h b/src/MeasureGUI/MeasureGUI_PropertiesDlg.h index 4911b4c18..41cf932fb 100644 --- a/src/MeasureGUI/MeasureGUI_PropertiesDlg.h +++ b/src/MeasureGUI/MeasureGUI_PropertiesDlg.h @@ -48,6 +48,7 @@ protected: // redefined from GEOMBase_Helper and MeasureGUI_Skeleton virtual void processObject(); virtual void activateSelection(); + virtual void SelectionIntoArgument(); virtual SALOME_Prs* buildPrs(); private: diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx index 1a5943a07..b254c4f9c 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.cxx +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -245,27 +245,24 @@ void MeasureGUI_Skeleton::SetEditCurrentArgument() //================================================================================= void MeasureGUI_Skeleton::SelectionIntoArgument() { - myObj = GEOM::GEOM_Object::_nil(); + myObj.nullify(); LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); SALOME_ListIO aSelList; aSelMgr->selectedObjects(aSelList); - GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); - if (aSelList.Extent() > 0) { - aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + myObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); } - if (aSelectedObject->_is_nil()) { + if ( !myObj ) { mySelEdit->setText(""); processObject(); erasePreview(); return; } - myObj = aSelectedObject; - mySelEdit->setText(GEOMBase::GetName(myObj)); + mySelEdit->setText(GEOMBase::GetName(myObj.get())); processObject(); redisplayPreview(); } @@ -356,7 +353,7 @@ void MeasureGUI_Skeleton::activateSelection() //================================================================================= bool MeasureGUI_Skeleton::isValid( QString& ) { - return !myObj->_is_nil(); + return myObj; } //================================================================ diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.h b/src/MeasureGUI/MeasureGUI_Skeleton.h index a12b40bf3..fa5ceef21 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.h +++ b/src/MeasureGUI/MeasureGUI_Skeleton.h @@ -77,7 +77,7 @@ protected: protected: QPushButton* mySelBtn; QLineEdit* mySelEdit; - GEOM::GEOM_Object_var myObj; + GEOM::GeomObjPtr myObj; GeometryGUI* myGeomGUI; GEOM_Displayer* myDisplayer; diff --git a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx index 1a6e03c8d..f9d2ea902 100644 --- a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx @@ -202,13 +202,13 @@ void MeasureGUI_WhatisDlg::ClickOnProperties() //================================================================================= bool MeasureGUI_WhatisDlg::getParameters( QString& theText ) { - if ( myObj->_is_nil() ) + if ( !myObj ) return false; GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() ); try { - theText = anOper->WhatIs( myObj ); + theText = anOper->WhatIs( myObj.get() ); } catch( const SALOME::SALOME_Exception& e ) { @@ -231,7 +231,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); - if ( myObj->_is_nil() ) + if ( !myObj ) return aKindStr; GEOM::GEOM_IKindOfShape::shape_kind aKind; @@ -242,7 +242,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) try { - aKind = anOper->KindOfShape( myObj, anInts, aDbls ); + aKind = anOper->KindOfShape( myObj.get(), anInts, aDbls ); } catch( const SALOME::SALOME_Exception& e ) { SalomeApp_Tools::QtCatchCorbaException( e );