From 57dc2546bf5f26c07b1dcb71bf39365057db4cf8 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 20 Jan 2006 14:30:51 +0000 Subject: [PATCH] Fixed bug GVIEW11261 : SMESH: Diagonal Inversion, Union of two triangles - exception and selection problems --- src/SVTK/SVTK_Actor.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 3a6b6fc05..337075bb1 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -178,20 +178,25 @@ SVTK_Actor vtkDataSet *aSourceDataSet = theMapActor->GetInput(); CopyPoints(GetSource(),aSourceDataSet); + if(theMapIndex.Extent() == 2){ - if(vtkCell* aCell = theMapActor->GetElemCell(theMapIndex(1))){ - int anEdgeId = theMapIndex(2); - if(anEdgeId < 0){ - int anEdgeId = -theMapIndex(2) - 1; - int aNbOfEdges = aCell->GetNumberOfEdges(); - if(0 <= anEdgeId || anEdgeId < aNbOfEdges){ - if(vtkCell* anEdge = aCell->GetEdge(anEdgeId)) - myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds()); + int anEdgeId = theMapIndex(1) < 0 ? theMapIndex(1) : theMapIndex(2); + int aCellId = theMapIndex(1) < 0 ? theMapIndex(2) : theMapIndex(1); + + if(aCellId > 0){ + if(vtkCell* aCell = theMapActor->GetElemCell(aCellId)){ + if(anEdgeId < 0){ + anEdgeId = -anEdgeId - 1; + int aNbOfEdges = aCell->GetNumberOfEdges(); + if(0 <= anEdgeId || anEdgeId < aNbOfEdges){ + if(vtkCell* anEdge = aCell->GetEdge(anEdgeId)) + myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds()); + } } } } } - + UnShrink(); if(theMapActor->IsShrunk()){ SetShrinkFactor(theMapActor->GetShrinkFactor()); -- 2.39.2