]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fixed bug GVIEW11261 : SMESH: Diagonal Inversion, Union of two triangles - exception...
authorouv <ouv@opencascade.com>
Fri, 20 Jan 2006 14:30:51 +0000 (14:30 +0000)
committerouv <ouv@opencascade.com>
Fri, 20 Jan 2006 14:30:51 +0000 (14:30 +0000)
src/SVTK/SVTK_Actor.cxx

index 3a6b6fc05db944bce6f4d74eb291ba9f0929aff5..337075bb1a4e8d52e43b9dfba5b3886709200cfc 100644 (file)
@@ -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());