From 20d9681852fd16ea99a29d8408056c6f60f576f8 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 5 Dec 2005 15:33:11 +0000 Subject: [PATCH] Fix for [Bug GVIEW10709] wrong presentation of quadratic mesh elements --- src/OBJECT/VISU_GaussPtsAct.cxx | 26 +++++++++++++++++--------- src/OBJECT/VISU_GaussPtsAct.h | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index ff17fb3a..9c69b73c 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -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), @@ -135,16 +135,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); @@ -816,8 +823,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); } } } diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 13eec03f..ae8264e9 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -273,7 +273,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor vtkSmartPointer myCursorPyramidSelected; vtkSmartPointer myCellSource; - vtkSmartPointer myCellActor; + vtkSmartPointer myCellActor; bool myBarVisibility; vtkSmartPointer myScalarBarCtrl; -- 2.39.2