From: apo Date: Mon, 5 Dec 2005 15:30:06 +0000 (+0000) Subject: Fix for Bug GVIEW10709 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR-D5-38-2003_Base;p=modules%2Fvisu.git Fix for Bug GVIEW10709 wrong presentation of quadratic mesh elements --- diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index bdc73dfe..f0596c53 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), @@ -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); } } } diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 7b9de9b4..099575fe 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -265,7 +265,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor vtkSmartPointer myCursorPyramidSelected; vtkSmartPointer myCellSource; - vtkSmartPointer myCellActor; + vtkSmartPointer myCellActor; bool myBarVisibility; vtkSmartPointer myScalarBarCtrl;