From: akl Date: Thu, 9 Apr 2015 15:23:55 +0000 (+0400) Subject: 52633: Activation of the ParaVis module leads to the breaking on the pre-selection... X-Git-Tag: V7_6_0b1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=299ff9d2bba572d0eea0303bf4d84c6fa0fadfc7;p=modules%2Fgui.git 52633: Activation of the ParaVis module leads to the breaking on the pre-selection and selection highlighting in the VTK Viewer. --- 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); } /*!