Salome HOME
Merge remote-tracking branch 'origin/master' into BR_LAND_COVER_MAP
[modules/hydro.git] / src / HYDROData / HYDROData_LandCover.cxx
index d17b52430ac43d87f6a1f3e5be0e33cbeab25e31..98fadcf4755e40cf719e468bf2fccc7eaf89c0c4 100644 (file)
@@ -24,8 +24,6 @@
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <TDataStd_AsciiString.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Wire.hxx>
@@ -128,7 +126,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 )
@@ -144,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 )
@@ -178,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()