#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>
#include <QColor>
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity )
IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity )
HYDROData_LandCover::HYDROData_LandCover()
+: HYDROData_Entity( Geom_2d )
{
}
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
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 )
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()