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.
This commit is contained in:
mkr 2012-01-27 14:55:50 +00:00
parent 0c1af31f54
commit b8e59ec334
4 changed files with 12 additions and 3 deletions

View File

@ -797,6 +797,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
anAspect = AISShape->Attributes()->UnFreeBoundaryAspect(); anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
anAspect->SetColor( aColor ); anAspect->SetColor( aColor );
AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect ); AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
AISShape->storeBoundaryColors();
// Set free boundaries aspect // Set free boundaries aspect
col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) ); col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );

View File

@ -340,8 +340,11 @@ void GEOMToolsGUI::OnColor()
} }
io->SetColor( aColor ); io->SetColor( aColor );
if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) {
Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aColor ); Handle(GEOM_AISShape) aGAISShape = Handle(GEOM_AISShape)::DownCast( io );
aGAISShape->SetShadingColor( aColor );
aGAISShape->storeBoundaryColors();
}
appStudy->setObjectProperty(mgrId,It.Value()->getEntry(), COLOR_PROP, c); appStudy->setObjectProperty(mgrId,It.Value()->getEntry(), COLOR_PROP, c);

View File

@ -192,6 +192,10 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
restoreIsoNumbers(); restoreIsoNumbers();
shadingMode(aPresentationManager, aPrs, aMode); shadingMode(aPresentationManager, aPrs, aMode);
// Store wireframe edges colors
storeBoundaryColors();
break; break;
} }
case 3: //StdSelect_DM_HLR: case 3: //StdSelect_DM_HLR:

View File

@ -124,12 +124,13 @@ public:
void restoreIsoNumbers(); void restoreIsoNumbers();
void resetIsoNumbers(); void resetIsoNumbers();
void storeBoundaryColors();
protected: protected:
void shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, void shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPrs, const Handle(Prs3d_Presentation)& aPrs,
const Standard_Integer aMode); const Standard_Integer aMode);
void storeBoundaryColors();
void restoreBoundaryColors(); void restoreBoundaryColors();
Quantity_Color myShadingColor; Quantity_Color myShadingColor;