X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_LandCover.cxx;h=98fadcf4755e40cf719e468bf2fccc7eaf89c0c4;hb=e744ba34fd38d6744d11b54cd15b6f86350695b2;hp=278f42c5f38fcc2f830c31bc84c440de00240b72;hpb=23a6f7b3e29e74735d71d7e1448465a9920f91dd;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index 278f42c5..98fadcf4 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #include #include @@ -46,6 +44,7 @@ IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity ) HYDROData_LandCover::HYDROData_LandCover() +: HYDROData_Entity( Geom_2d ) { } @@ -127,13 +126,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 @@ -143,18 +142,7 @@ HYDROData_SequenceOfObjects HYDROData_LandCover::GetPolylines() const TopoDS_Shape HYDROData_LandCover::GetShape() const { - 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; + return HYDROData_Entity::GetShape( DataTag_Shape ); } void HYDROData_LandCover::SetFillingColor( const QColor& theColor ) @@ -177,20 +165,19 @@ QColor HYDROData_LandCover::GetBorderColor() const return GetColor( DefaultBorderColor(), DataTag_BorderColor ); } -QColor HYDROData_LandCover::DefaultFillingColor() +QColor HYDROData_LandCover::DefaultFillingColor() const { return QColor( Qt::magenta ); } -QColor HYDROData_LandCover::DefaultBorderColor() +QColor HYDROData_LandCover::DefaultBorderColor() const { return QColor( Qt::transparent ); } -void HYDROData_LandCover::setShape( const TopoDS_Shape& theShape ) +void HYDROData_LandCover::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_Shape, theShape ); } void HYDROData_LandCover::removeShape()