mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-31 22:37:48 +05:00
NPAL18362: EDF634: SIGSEV when we try to create a point and when a geom object is selected.
This commit is contained in:
parent
771241721f
commit
19a2c21851
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -49,7 +49,9 @@
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
|
||||
#include <qapplication.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_PointDlg()
|
||||
// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
|
||||
@ -220,7 +222,7 @@ void BasicGUI_PointDlg::Init()
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DZ, SLOT(SetStep(double)));
|
||||
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
initName( tr("GEOM_VERTEX") );
|
||||
|
||||
@ -369,29 +371,27 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
|
||||
{
|
||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||
{
|
||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||
TColStd_IndexedMapOfInteger aMap;
|
||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||
if ( aMap.Extent() == 1 )
|
||||
{
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
aSelMgr->clearSelected();
|
||||
}
|
||||
}
|
||||
{
|
||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||
TColStd_IndexedMapOfInteger aMap;
|
||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||
if ( aMap.Extent() == 1 )
|
||||
{
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
}
|
||||
}
|
||||
if ( id == 0 )
|
||||
{
|
||||
if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
|
||||
return;
|
||||
if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
|
||||
return;
|
||||
|
||||
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
|
||||
GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
|
||||
@ -410,14 +410,14 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
||||
}
|
||||
else if ( id == 3 )
|
||||
{
|
||||
if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
|
||||
myLine1 = aSelectedObject;
|
||||
GroupLineIntersection->LineEdit1->setText( aName );
|
||||
}
|
||||
else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
|
||||
myLine2 = aSelectedObject;
|
||||
GroupLineIntersection->LineEdit2->setText( aName );
|
||||
}
|
||||
if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
|
||||
myLine1 = aSelectedObject;
|
||||
GroupLineIntersection->LineEdit1->setText( aName );
|
||||
}
|
||||
else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
|
||||
myLine2 = aSelectedObject;
|
||||
GroupLineIntersection->LineEdit2->setText( aName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -435,10 +435,10 @@ void BasicGUI_PointDlg::LineEditReturnPressed()
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if ( send == GroupRefPoint->LineEdit1 || send == GroupOnCurve->LineEdit1 ||
|
||||
send == GroupLineIntersection->LineEdit1 || send == GroupLineIntersection->LineEdit2 )
|
||||
{
|
||||
myEditCurrentArgument = send;
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
}
|
||||
{
|
||||
myEditCurrentArgument = send;
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user