From b8e59ec33403b4511937aaae69c6c6cc3332c29b Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 27 Jan 2012 14:55:50 +0000 Subject: [PATCH] Fix regression (after fix for PAL21179): 1) OCC viewer: get the correct default color for wireframe mode from preferences; 2) OCC viewer: change edges color for wireframe mode after change the color of the shape. --- src/GEOMGUI/GEOM_Displayer.cxx | 1 + src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 7 +++++-- src/OBJECT/GEOM_AISShape.cxx | 4 ++++ src/OBJECT/GEOM_AISShape.hxx | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index ad8b77511..31d7d4b0c 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -797,6 +797,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) anAspect = AISShape->Attributes()->UnFreeBoundaryAspect(); anAspect->SetColor( aColor ); AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect ); + AISShape->storeBoundaryColors(); // Set free boundaries aspect col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 5d2005cc0..bce39e1cc 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -340,8 +340,11 @@ void GEOMToolsGUI::OnColor() } io->SetColor( aColor ); - if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) - Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aColor ); + if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) { + Handle(GEOM_AISShape) aGAISShape = Handle(GEOM_AISShape)::DownCast( io ); + aGAISShape->SetShadingColor( aColor ); + aGAISShape->storeBoundaryColors(); + } appStudy->setObjectProperty(mgrId,It.Value()->getEntry(), COLOR_PROP, c); diff --git a/src/OBJECT/GEOM_AISShape.cxx b/src/OBJECT/GEOM_AISShape.cxx index dfd5bdb24..9313c6ee7 100644 --- a/src/OBJECT/GEOM_AISShape.cxx +++ b/src/OBJECT/GEOM_AISShape.cxx @@ -192,6 +192,10 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent restoreIsoNumbers(); shadingMode(aPresentationManager, aPrs, aMode); + + // Store wireframe edges colors + storeBoundaryColors(); + break; } case 3: //StdSelect_DM_HLR: diff --git a/src/OBJECT/GEOM_AISShape.hxx b/src/OBJECT/GEOM_AISShape.hxx index 1626936fb..387b3ef37 100644 --- a/src/OBJECT/GEOM_AISShape.hxx +++ b/src/OBJECT/GEOM_AISShape.hxx @@ -124,12 +124,13 @@ public: void restoreIsoNumbers(); void resetIsoNumbers(); + void storeBoundaryColors(); + protected: void shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPrs, const Standard_Integer aMode); - void storeBoundaryColors(); void restoreBoundaryColors(); Quantity_Color myShadingColor; -- 2.39.2