Fix for the "0021580: GEOM EDF: SetColor does not work" issue.

This commit is contained in:
ana 2012-05-17 13:30:27 +00:00
parent 4b2d12773c
commit e6e039b1a4

View File

@ -644,12 +644,6 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
PropMap aPropMap; PropMap aPropMap;
PropMap aDefPropMap; PropMap aDefPropMap;
if(useStudy){
aPropMap = aStudy->getObjectPropMap(aMgrId,anEntry);
aDefPropMap = getDefaultPropertyMap(SOCC_Viewer::Type());
MergePropertyMaps(aPropMap, aDefPropMap);
}
//Handle(GEOM_AISShape) AISShape = new GEOM_AISShape( myShape, "" ); //Handle(GEOM_AISShape) AISShape = new GEOM_AISShape( myShape, "" );
Handle(GEOM_AISShape) AISShape; Handle(GEOM_AISShape) AISShape;
if (myType == GEOM_VECTOR) if (myType == GEOM_VECTOR)
@ -663,20 +657,27 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
// Temporary staff: vertex must be infinite for correct visualization // Temporary staff: vertex must be infinite for correct visualization
AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines) AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines)
// Setup shape properties here ..., e.g. display mode, color, transparency, etc if(useStudy){
if(useStudy) { aPropMap = aStudy->getObjectPropMap(aMgrId,anEntry);
AISShape->SetDisplayMode( aPropMap.value(DISPLAY_MODE_PROP).toInt() ); aDefPropMap = getDefaultPropertyMap(SOCC_Viewer::Type());
AISShape->SetDisplayVectors(aPropMap.value(VECTOR_MODE_PROP).toInt()); Quantity_Color quant_col;
if(aPropMap.contains(TOP_LEVEL_PROP)) {
AISShape->setTopLevel( aPropMap.value(TOP_LEVEL_PROP).value<Standard_Boolean>() );
}
if(aPropMap.contains(COLOR_PROP)) { if(aPropMap.contains(COLOR_PROP)) {
Quantity_Color quant_col = SalomeApp_Tools::color( aPropMap.value(COLOR_PROP).value<QColor>()); quant_col = SalomeApp_Tools::color( aPropMap.value(COLOR_PROP).value<QColor>());
AISShape->SetShadingColor( quant_col ); AISShape->SetShadingColor( quant_col );
} else } else
useObjColor = true; useObjColor = true;
MergePropertyMaps(aPropMap, aDefPropMap);
if(!useObjColor && aPropMap.contains(COLOR_PROP)) {
quant_col = SalomeApp_Tools::color( aPropMap.value(COLOR_PROP).value<QColor>());
AISShape->SetShadingColor( quant_col );
}
// Setup shape properties here ..., e.g. display mode, color, transparency, etc
AISShape->SetDisplayMode( aPropMap.value(DISPLAY_MODE_PROP).toInt() );
AISShape->SetDisplayVectors(aPropMap.value(VECTOR_MODE_PROP).toInt());
if(aPropMap.contains(TOP_LEVEL_PROP)) {
AISShape->setTopLevel( aPropMap.value(TOP_LEVEL_PROP).value<Standard_Boolean>() );
}
}else { }else {
MESSAGE("myDisplayMode = "<< myDisplayMode) MESSAGE("myDisplayMode = "<< myDisplayMode)
AISShape->SetDisplayMode( myDisplayMode ); AISShape->SetDisplayMode( myDisplayMode );
@ -705,11 +706,10 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect(); Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
anAspect->SetNumber( anUIsoNumber ); anAspect->SetNumber( anUIsoNumber );
anAspect->SetColor( aColor ); anAspect->SetColor( aColor );
if(HasIsosWidth()) if(HasIsosWidth())
anAspect->SetWidth( GetIsosWidth() ); anAspect->SetWidth( GetIsosWidth() );
AISShape->Attributes()->SetUIsoAspect( anAspect ); AISShape->Attributes()->SetUIsoAspect( anAspect );
anAspect = AISShape->Attributes()->VIsoAspect(); anAspect = AISShape->Attributes()->VIsoAspect();
anAspect->SetNumber( aVIsoNumber ); anAspect->SetNumber( aVIsoNumber );
if(HasIsosWidth()) if(HasIsosWidth())