X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_LandCover.cxx;h=d17b52430ac43d87f6a1f3e5be0e33cbeab25e31;hb=f9d37ee66fa46871478d806faa54de237225d3c6;hp=98fadcf4755e40cf719e468bf2fccc7eaf89c0c4;hpb=f709724a7a412254db7ee6ca094b01b6dc75e82b;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index 98fadcf4..d17b5243 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include #include @@ -126,7 +128,7 @@ void HYDROData_LandCover::Update() TCollection_AsciiString anErrorMsg; TopoDS_Shape aResShape = buildShape( GetPolylines(), anErrorMsg ); - SetShape( aResShape ); + setShape( aResShape ); } void HYDROData_LandCover::SetPolylines( const HYDROData_SequenceOfObjects& thePolylines ) @@ -142,7 +144,18 @@ HYDROData_SequenceOfObjects HYDROData_LandCover::GetPolylines() const TopoDS_Shape HYDROData_LandCover::GetShape() const { - return HYDROData_Entity::GetShape( DataTag_Shape ); + TopoDS_Shape aShape; + + TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); + if ( !aLabel.IsNull() ) + { + Handle(TNaming_NamedShape) aNamedShape; + if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) { + aShape = aNamedShape->Get(); + } + } + + return aShape; } void HYDROData_LandCover::SetFillingColor( const QColor& theColor ) @@ -165,19 +178,20 @@ QColor HYDROData_LandCover::GetBorderColor() const return GetColor( DefaultBorderColor(), DataTag_BorderColor ); } -QColor HYDROData_LandCover::DefaultFillingColor() const +QColor HYDROData_LandCover::DefaultFillingColor() { return QColor( Qt::magenta ); } -QColor HYDROData_LandCover::DefaultBorderColor() const +QColor HYDROData_LandCover::DefaultBorderColor() { return QColor( Qt::transparent ); } -void HYDROData_LandCover::SetShape( const TopoDS_Shape& theShape ) +void HYDROData_LandCover::setShape( const TopoDS_Shape& theShape ) { - HYDROData_Entity::SetShape( DataTag_Shape, theShape ); + TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) ); + aBuilder.Generated( theShape ); } void HYDROData_LandCover::removeShape()