]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug GVIEW10709 BR-D5-38-2003_Base
authorapo <apo@opencascade.com>
Mon, 5 Dec 2005 15:30:06 +0000 (15:30 +0000)
committerapo <apo@opencascade.com>
Mon, 5 Dec 2005 15:30:06 +0000 (15:30 +0000)
   wrong presentation of quadratic mesh elements

src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsAct.h

index bdc73dfeb1ce1cc3f7443cecdc72ac6eb691597f..f0596c53acae5d006b6482a7ce8729682cc84e71 100644 (file)
@@ -106,7 +106,7 @@ VISU_GaussPtsAct
   myCursorPyramid(VISU_CursorPyramid::New()),
   myCursorPyramidSelected(VISU_CursorPyramid::New()),
   myCellSource(vtkUnstructuredGrid::New()),
-  myCellActor(vtkActor::New()),
+  myCellActor(SVTK_Actor::New()),
   myScalarBarCtrl(VISU_ScalarBarCtrl::New()),
   myBarVisibility(true),
   myPickingSettings(NULL),
@@ -134,16 +134,21 @@ VISU_GaussPtsAct
 
   myTextActor->SetVisibility(false);
   myTextActor->SetPickable(false);
-  //
+
   myCellSource->Allocate();
-  vtkDataSetMapper* aCellMapper = vtkDataSetMapper::New();
-  aCellMapper->SetInput(myCellSource.GetPointer());
-  myCellActor->SetMapper(aCellMapper);
+  myCellActor->Initialize();
+  myCellActor->SetRepresentation(VTK_WIREFRAME);
+  myCellActor->SetSource(myCellSource.GetPointer());
+  
+  //vtkDataSetMapper* aCellMapper = vtkDataSetMapper::New();
+  //aCellMapper->SetInput(myCellSource.GetPointer());
+  //myCellActor->SetMapper(aCellMapper);
+
   myCellActor->SetVisibility(0);
   myCellActor->SetPickable(0);
   myCellActor->GetProperty()->SetAmbient(1.0);
   myCellActor->GetProperty()->SetDiffuse(0.0);
-  myCellActor->GetProperty()->SetRepresentationToWireframe(); 
+  //myCellActor->GetProperty()->SetRepresentationToWireframe(); 
 
   myScalarBarCtrl->Delete();
   myScalarBarCtrl->SetMode(0);
@@ -237,7 +242,8 @@ VISU_GaussPtsAct
   myDeviceActor->AddToRender(theRenderer);
 
   theRenderer->AddActor(myTextActor.GetPointer());
-  theRenderer->AddActor(myCellActor.GetPointer());
+  //theRenderer->AddActor(myCellActor.GetPointer());
+  myCellActor->AddToRender(theRenderer);
 
   myCursorPyramid->AddToRender(theRenderer);
   myCursorPyramidSelected->AddToRender(theRenderer);
@@ -255,7 +261,8 @@ VISU_GaussPtsAct
   myDeviceActor->RemoveFromRender(theRenderer);
   
   theRenderer->RemoveActor(myTextActor.GetPointer());
-  theRenderer->RemoveActor(myCellActor.GetPointer());
+  //theRenderer->RemoveActor(myCellActor.GetPointer());
+  myCellActor->RemoveFromRender(theRenderer);
   
   myCursorPyramid->RemoveFromRender(theRenderer);
   myCursorPyramidSelected->RemoveFromRender(theRenderer);
@@ -804,8 +811,9 @@ VISU_GaussPtsAct
       vtkIdType aCellID = aGaussPointID.first;
       vtkCell* aCell = aParent->GetElemCell(aCellID);
       myCellSource->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
-      myCellActor->GetProperty()->SetRepresentationToWireframe(); // VTK bug
+      //myCellActor->GetProperty()->SetRepresentationToWireframe(); // VTK bug
       myCellActor->SetVisibility(anIsVisible && theIsHighlight);
+      myCellActor->SetRepresentation(VTK_WIREFRAME);
     }
   }
 }
index 7b9de9b4ecc110c637fd58329c7f7bc022e0aa1e..099575fe2806e9d4d96114f2ba87053b678eac75 100644 (file)
@@ -265,7 +265,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   vtkSmartPointer<VISU_CursorPyramid> myCursorPyramidSelected;
   
   vtkSmartPointer<vtkUnstructuredGrid> myCellSource;
-  vtkSmartPointer<vtkActor> myCellActor;
+  vtkSmartPointer<SVTK_Actor> myCellActor;
 
   bool myBarVisibility;
   vtkSmartPointer<VISU_ScalarBarCtrl> myScalarBarCtrl;