From 5606395f831825d448f3629adeb41cf4489202bd Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 14 Sep 2017 18:25:22 +0300 Subject: [PATCH] Fix for '54311: Ugly representation in the VTK Viewer after creation of the ParaView Viewer' issue. --- src/SVTK/SVTK_DeviceActor.cxx | 4 ++-- src/VTKViewer/VTKViewer_Actor.cxx | 17 +++++++++++++++-- src/VTKViewer/VTKViewer_Actor.h | 6 ++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index efa906100..8fefd95a8 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -62,8 +62,8 @@ SVTK_DeviceActor myRepresentation = VTKViewer::Representation::Surface; myIsResolveCoincidentTopology = true; - vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); + VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor, + myPolygonOffsetUnits); myMapper = VTKViewer_DataSetMapper::New(); diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index 76f5d153b..56312d57d 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -74,8 +74,8 @@ VTKViewer_Actor myIsPreselected(false), myIsHighlighted(false) { - vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); + VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor, + myPolygonOffsetUnits); for(int i = 0; i < 6; i++) myPassFilter.push_back(vtkPassThroughFilter::New()); @@ -273,6 +273,19 @@ VTKViewer_Actor units = myPolygonOffsetUnits; } +/*! + Get polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ +void +VTKViewer_Actor +::GetDefaultPolygonOffsetParameters(double& factor, + double& units) +{ + factor = 2.0; + units = 2.0; +} + /*! \return shrink factor */ diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index e09c1e3e5..306578bec 100755 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -257,6 +257,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor void GetPolygonOffsetParameters(double& factor, double& units); + + //! Get default ResolveCoincidentTopology parameters + static + void + GetDefaultPolygonOffsetParameters(double& factor, + double& units); virtual void -- 2.39.2