diff --git a/src/AIS/AIS_InteractiveObject.cdl b/src/AIS/AIS_InteractiveObject.cdl index 8435d15fd3..18a4573e02 100755 --- a/src/AIS/AIS_InteractiveObject.cdl +++ b/src/AIS/AIS_InteractiveObject.cdl @@ -527,15 +527,6 @@ is ---C++: return const& SetRecomputeOk(me:mutable) is private; - -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets - Fill(me: mutable; - aPresentationManager: PresentationManager from PrsMgr; - aPresentation: mutable Presentation from PrsMgr; - aMode: Integer from Standard = 0) - is redefined protected; - -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets - - State(me:mutable;theState: Integer from Standard) ; ---C++: inline State(me) returns Integer from Standard ; diff --git a/src/AIS/AIS_InteractiveObject.cxx b/src/AIS/AIS_InteractiveObject.cxx index 3e1724e78d..f86fc46435 100755 --- a/src/AIS/AIS_InteractiveObject.cxx +++ b/src/AIS/AIS_InteractiveObject.cxx @@ -781,6 +781,7 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode, // TODO: Add methods for retrieving individual aspects from Graphic3d_Group aGrp->GroupPrimitivesAspect(aLineAsp, aTextAsp, aPntAsp, aFaceAsp); aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits); + // TODO: Issue 23118 - This line kills texture data in the group... aGrp->SetGroupPrimitivesAspect(aFaceAsp); } } @@ -812,38 +813,4 @@ void AIS_InteractiveObject::PolygonOffsets(Standard_Integer& aMode, if( HasPolygonOffsets() ) myDrawer->ShadingAspect()->Aspect()->PolygonOffsets( aMode, aFactor, aUnits ); } - -void AIS_InteractiveObject::Fill(const Handle(PrsMgr_PresentationManager)& aPresentationManager, - const Handle(PrsMgr_Presentation)& aPresentation, - const Standard_Integer aMode) -{ - PrsMgr_PresentableObject::Fill(aPresentationManager, aPresentation, aMode); - - // Update polygon offsets for using data - if ( !myDrawer->ShadingAspect().IsNull() ) - { - Standard_Integer aMode1 = Aspect_POM_Fill; - Standard_Real aFactor = 1., aUnits = 0.; - myDrawer->ShadingAspect()->Aspect()->PolygonOffsets( aMode1, aFactor, aUnits ); - - // Here we force this object to have default polygon offsets , if they are not - // turned on for this object explicitly - if ( ( aMode1 & Aspect_POM_None ) == Aspect_POM_None ) - { - aMode1 = Aspect_POM_Fill; - aFactor = 1.; - aUnits = 0.; - myDrawer->ShadingAspect()->Aspect()->SetPolygonOffsets( aMode1, aFactor, aUnits ); - } - } - - Handle(PrsMgr_Presentation3d) aPrs3d = - Handle(PrsMgr_Presentation3d)::DownCast( aPresentation ); - if ( !aPrs3d.IsNull() ) { - Handle(Graphic3d_Structure) aStruct = - Handle(Graphic3d_Structure)::DownCast( aPrs3d->Presentation() ); - if( !aStruct.IsNull() ) - aStruct->SetPrimitivesAspect( myDrawer->ShadingAspect()->Aspect() ); - } -} // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets diff --git a/src/AIS/AIS_TexturedShape.cxx b/src/AIS/AIS_TexturedShape.cxx index 31cd263ba0..d1d4e2ff01 100755 --- a/src/AIS/AIS_TexturedShape.cxx +++ b/src/AIS/AIS_TexturedShape.cxx @@ -328,6 +328,15 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t { Handle(Prs3d_ShadingAspect) aPrs3d_ShadingAspect = new Prs3d_ShadingAspect(); myAspect = aPrs3d_ShadingAspect->Aspect(); + + // Issue 23115: copy polygon offset settings passed through myDrawer + if (HasPolygonOffsets()) + { + Standard_Integer aMode; + Standard_Real aFactor, aUnits; + PolygonOffsets(aMode, aFactor, aUnits); + myAspect->SetPolygonOffsets(aMode, aFactor, aUnits); + } } if (!DoMapTexture) { diff --git a/src/Graphic3d/Graphic3d_AspectFillArea3d.cxx b/src/Graphic3d/Graphic3d_AspectFillArea3d.cxx index e28727e03a..c4877bc89a 100755 --- a/src/Graphic3d/Graphic3d_AspectFillArea3d.cxx +++ b/src/Graphic3d/Graphic3d_AspectFillArea3d.cxx @@ -86,7 +86,7 @@ DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFac // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets // By default, aspect do not change current polygon offset parameters - MyPolygonOffsetMode = Aspect_POM_None; + MyPolygonOffsetMode = Aspect_POM_Fill; MyPolygonOffsetFactor = 1.; MyPolygonOffsetUnits = 0.; // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets @@ -104,7 +104,7 @@ Aspect_AspectFillArea (InteriorStyle, InteriorColor, EdgeColor, EdgeLineType, Ed // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets // By default, aspect do not change current polygon offset parameters - MyPolygonOffsetMode = Aspect_POM_None; + MyPolygonOffsetMode = Aspect_POM_Fill; MyPolygonOffsetFactor = 1.; MyPolygonOffsetUnits = 0.; // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets diff --git a/src/Graphic3d/Graphic3d_Group_8.cxx b/src/Graphic3d/Graphic3d_Group_8.cxx index 4498f0decd..3dc269c032 100755 --- a/src/Graphic3d/Graphic3d_Group_8.cxx +++ b/src/Graphic3d/Graphic3d_Group_8.cxx @@ -266,13 +266,15 @@ void Graphic3d_Group::SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectFil /*** Texture map ***/ Handle(Graphic3d_TextureMap) GroupTextureMap = CTX->TextureMap(); - if (! GroupTextureMap.IsNull() ) + if (! GroupTextureMap.IsNull() ) { MyCGroup.ContextFillArea.Texture.TexId = GroupTextureMap->TextureId(); - else + MyCGroup.ContextFillArea.Texture.doTextureMap = + CTX->TextureMapState () ? 1 : 0; + } + else { MyCGroup.ContextFillArea.Texture.TexId = -1; - - MyCGroup.ContextFillArea.Texture.doTextureMap = - CTX->TextureMapState () ? 1 : 0; + MyCGroup.ContextFillArea.Texture.doTextureMap = 0; + } // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets Standard_Integer aPolyMode;