mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-30 03:30:34 +05:00
0020504: EDF 1078 GEOM: Point color is not good at study loading
This commit is contained in:
parent
2dddd7ebfd
commit
0bbe510fee
@ -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 + "))";
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user