]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
#19463 fix edges flickering with group of volumes
authorViktor UZLOV <viktor.uzlov@opencascade.com>
Thu, 15 Jul 2021 17:38:17 +0000 (20:38 +0300)
committerViktor UZLOV <viktor.uzlov@opencascade.com>
Thu, 15 Jul 2021 17:38:17 +0000 (20:38 +0300)
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_Actor.h
src/OBJECT/SMESH_ActorDef.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx

index 8baeb3c8b1b3d5c69d5da10b6fc9856d5d2269da..0b3dcee32280b81b90be78eefcdf38cfd01bec3e 100644 (file)
@@ -1270,15 +1270,7 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   // coincident patch. See also #18940.
   // NOTE: use Resolve coincident topology for actors in the same 
   // mapper. If several mappers, then use Relative coincident topology
-  double aFactor, aUnits;
-  my2DActor->GetPolygonOffsetParameters(aFactor,aUnits);
-  my2DActor->SetPolygonOffsetParameters(aFactor,aUnits);
-  my2DExtActor->SetPolygonOffsetParameters(aFactor,aUnits*0.5);
-  my3DActor->SetPolygonOffsetParameters(aFactor*2,aUnits*2);
-  myHighlitableActor->GetMapper()->SetRelativeCoincidentTopologyLineOffsetParameters(aFactor*(-1.0),
-                                                                                     aUnits*(-50));
-  my2DActor->GetMapper()->SetRelativeCoincidentTopologyPolygonOffsetParameters(-aFactor, -aUnits);
-  my3DActor->GetMapper()->SetRelativeCoincidentTopologyLineOffsetParameters(-aUnits-1, -aUnits-1);
+  SetRelativeTopologyOffsetParameters(2, 2);
 
   SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
   if( !mgr )
@@ -2559,6 +2551,16 @@ void SMESH_ActorDef::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMa
   myMarkerTexture = theMarkerTexture; // for deferred update of myHighlightActor
 }
 
+void SMESH_ActorDef::SetRelativeTopologyOffsetParameters(double f, double u,
+                                                         double f_delta, double u_delta)
+{
+  my2DActor->SetPolygonOffsetParameters(f,u + u_delta);
+  my2DExtActor->SetPolygonOffsetParameters(f,u*0.5 + u_delta);
+  my3DActor->SetPolygonOffsetParameters(f,u*2 + u_delta);
+  myHighlitableActor->GetMapper()->SetRelativeCoincidentTopologyLineOffsetParameters(-f + f_delta,
+                                                                                     u*(-50) + 10*u_delta);
+}
+
 void SMESH_ActorDef::UpdateFilter()
 {
   unsigned int anObjectEntities = eAllEntity; // entities present in my object
index 6de50af116431745fd1198b0bd6aa5dfa348b866..bcb684a76060d0674765fa9c154f8a202d5565e2 100644 (file)
@@ -176,6 +176,9 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
 
   virtual void UpdateFilter() = 0;
 
+  virtual void SetRelativeTopologyOffsetParameters(double f, double u,
+                                                   double f_delta = 0, double u_delta = 0) = 0;
+
 #ifndef DISABLE_PLOT2DVIEWER
   virtual SPlot2d_Histogram* GetPlot2Histogram() = 0;
   virtual SPlot2d_Histogram* UpdatePlot2Histogram() = 0;
index 0d3051c54f032a5590c4eee4dbe8899e6a3d3ebe..67efe44824db26f4f07116d683ebc01c8b4cf874 100644 (file)
@@ -239,6 +239,9 @@ class SMESH_ActorDef : public SMESH_Actor
   virtual void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
   virtual void SetMarkerTexture( int, VTK::MarkerTexture );
 
+  virtual void SetRelativeTopologyOffsetParameters(double f, double u,
+                                                   double f_delta = 0, double u_delta = 0);
+
   virtual void UpdateFilter();
 
  protected:
index e3d6adeab7f29434b546e565a93955d8a0e52dad..77267b55f61afd90c93c1e7c2f9c30a7818e8c3a 100644 (file)
@@ -676,6 +676,7 @@ namespace SMESH
             anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, deltaV );
           else
             anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, deltaF );
+          anActor->SetRelativeTopologyOffsetParameters(2, 2, 1, 3);
         }
       }
     }