From: dmv Date: Fri, 2 Oct 2009 12:13:34 +0000 (+0000) Subject: 0020504: EDF 1078 GEOM: Point color is not good at study loading X-Git-Tag: V4_1_0_maintainance_FINAL~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c3303ede869ef645740c2e07f45c7ddb23ff1fe2;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 bce32c746..cde59bfc5 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -591,7 +591,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, } 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 fa40ae257..19080d753 100644 --- a/src/GEOM/GEOM_Object.cxx +++ b/src/GEOM/GEOM_Object.cxx @@ -326,9 +326,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 0cc4a5bf9..343abb37d 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -686,7 +686,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 = (bool)(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(); @@ -729,6 +729,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 ); + } } } }