#19463 fix edges flickering with group of volumes

This commit is contained in:
Viktor UZLOV 2021-07-15 20:38:17 +03:00
parent 3dd8c23971
commit d790688908
4 changed files with 18 additions and 9 deletions

View 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

View 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;

View 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:

View 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);
}
}
}