From: dmv Date: Fri, 2 Oct 2009 12:12:45 +0000 (+0000) Subject: 0020504: EDF 1078 GEOM: Point color is not good at study loading X-Git-Tag: V5_1_3rc1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0bbe510feec7eda53e3ee6275a18bc90d15b0d38;p=modules%2Fgeom.git 0020504: EDF 1078 GEOM: Point color is not good at study loading --- diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 436287cff..7a572ba1f 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -1194,7 +1194,7 @@ void AddObjectColors (const Handle(TDocStd_Document)& theDoc, } SALOMEDS::Color aColor = obj->GetColor(); - if ( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) + if ( aColor.R >= 0 && aColor.G >= 0 && aColor.B >= 0 ) { TCollection_AsciiString aCommand( "\n\t" ); aCommand += aName + ".SetColor(SALOMEDS.Color(" + aColor.R + "," + aColor.G + "," + aColor.B + "))"; diff --git a/src/GEOM/GEOM_Object.cxx b/src/GEOM/GEOM_Object.cxx index 9a5564765..b2ca175f4 100644 --- a/src/GEOM/GEOM_Object.cxx +++ b/src/GEOM/GEOM_Object.cxx @@ -338,9 +338,9 @@ SALOMEDS::Color GEOM_Object::GetColor() bool isFound = _label.FindChild(COLOR_LABEL).FindAttribute(TDataStd_RealArray::GetID(), anArray); SALOMEDS::Color aColor; - aColor.R = isFound ? anArray->Value( 1 ) : 0.f; - aColor.G = isFound ? anArray->Value( 2 ) : 0.f; - aColor.B = isFound ? anArray->Value( 3 ) : 0.f; + aColor.R = isFound ? anArray->Value( 1 ) : -1; + aColor.G = isFound ? anArray->Value( 2 ) : -1; + aColor.B = isFound ? anArray->Value( 3 ) : -1; return aColor; } diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index f8aaa621b..61b86c34c 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -680,7 +680,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) if ( !aGeomObject->_is_nil() ) { SALOMEDS::Color aSColor = aGeomObject->GetColor(); - bool hasColor = aSColor.R > 0 || aSColor.G > 0 || aSColor.B > 0; + bool hasColor = aSColor.R >= 0 && aSColor.G >= 0 && aSColor.B >= 0; if( !hasColor && aGeomObject->GetType() == GEOM_GROUP ) // auto color for group { GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen(); @@ -723,6 +723,13 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) Quantity_Color aQuanColor( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB ); AISShape->SetColor( aQuanColor ); AISShape->SetShadingColor( aQuanColor ); + if ( myShape.ShapeType() == TopAbs_VERTEX ) { + Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect(); + anAspect->SetColor( aQuanColor ); + anAspect->SetScale( myScaleOfMarker ); + anAspect->SetTypeOfMarker( myTypeOfMarker ); + AISShape->Attributes()->SetPointAspect( anAspect ); + } } } }