From 299ff9d2bba572d0eea0303bf4d84c6fa0fadfc7 Mon Sep 17 00:00:00 2001 From: akl Date: Thu, 9 Apr 2015 19:23:55 +0400 Subject: [PATCH] 52633: Activation of the ParaVis module leads to the breaking on the pre-selection and selection highlighting in the VTK Viewer. --- src/SVTK/SVTK_DeviceActor.cxx | 31 +++++++++++++++++-------------- src/VTKViewer/VTKViewer_Actor.cxx | 29 ++++++++++++++++------------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index 675c18408..47f10044b 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -621,21 +621,24 @@ void SVTK_DeviceActor ::Render(vtkRenderer *ren, vtkMapper* m) { - if(myIsResolveCoincidentTopology){ - int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - double aFactor, aUnit; - vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); - - vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); - vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); - Superclass::Render(ren,m); - - vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); - vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology); - }else{ - Superclass::Render(ren,m); + int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); + double aFactor, aUnit; + vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); + + double aNewFactor = myPolygonOffsetFactor, aNewUnit = myPolygonOffsetUnits; + if(!myIsResolveCoincidentTopology){ + static double EPS = .01; + aNewFactor *= (1.0-EPS); + aNewUnit *= (1.0-EPS); } + + vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); + vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aNewFactor, + aNewUnit); + Superclass::Render(ren,m); + + vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); + vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology); } /*! diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index f68d23d85..2080fe6d7 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -218,21 +218,24 @@ VTKViewer_Actor SetNumberOfCloudPoints(aNbOfPoints); } - if(myIsResolveCoincidentTopology){ - int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - double aFactor, aUnit; - vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); + int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); + double aFactor, aUnit; + vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); + + double aNewFactor = myPolygonOffsetFactor, aNewUnit = myPolygonOffsetUnits; + if(!myIsResolveCoincidentTopology){ + static double EPS = .01; + aNewFactor *= (1.0-EPS); + aNewUnit *= (1.0-EPS); + } - vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); - vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); - Superclass::Render(ren,m); + vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); + vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aNewFactor, + aNewUnit); + Superclass::Render(ren,m); - vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); - vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology); - }else{ - Superclass::Render(ren,m); - } + vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); + vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology); } /*! -- 2.39.2