X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_LandCover.cxx;h=c9199eb32a41479079569b24d651b5ef5431b305;hb=f86cf7ecf17dbae2a1d84e0ebbab07c732208c2f;hp=4423c83fb60c915184a97e41bb6446e1716c6886;hpb=254bc4b391a60c6a0c49435711d48071be58f761;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index 4423c83f..c9199eb3 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 @@ -40,10 +42,10 @@ #include #include -IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity ) HYDROData_LandCover::HYDROData_LandCover() +: HYDROData_Entity( Geom_2d ) { } @@ -125,13 +127,13 @@ 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 ) { SetReferenceObjects( thePolylines, DataTag_Polylines ); - SetToUpdate( true ); + Changed( Geom_2d ); } HYDROData_SequenceOfObjects HYDROData_LandCover::GetPolylines() const @@ -141,7 +143,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 ) @@ -174,9 +187,10 @@ 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()