X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_LandCoverMap.h;h=e009351a2baa6e20176ca49c3baa0b7218103401;hb=f9d37ee66fa46871478d806faa54de237225d3c6;hp=f3492f17da8de64034bea85198b03f15afbdcf02;hpb=01c12054cd573c907306af4292e14b59f5a227d8;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_LandCoverMap.h b/src/HYDROData/HYDROData_LandCoverMap.h index f3492f17..e009351a 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@ -24,17 +24,24 @@ #include #include #include +#include +#include +#include + +class Handle_HYDROData_StricklerTable; +#include typedef NCollection_IndexedDataMap HYDROData_MapOfFaceToStricklerType; DEFINE_STANDARD_HANDLE( HYDROData_LandCoverMap, HYDROData_Entity ) class TopoDS_Shape; +class TopoDS_Wire; class TopoDS_Iterator; class TopTools_ListOfShape; class Handle( HYDROData_PolylineXY ); class Handle( HYDROData_Object ); -class gp_Pnt2d; +class gp_XY; class HYDROData_LandCoverMap : public HYDROData_Entity { @@ -46,15 +53,16 @@ protected: DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve DataTag_Shape, ///< the shape presentation of the land cover map DataTag_Types, + DataTag_Transparency, }; public: - class Iterator + class Explorer { public: - Iterator( const HYDROData_LandCoverMap& ); - HYDRODATA_EXPORT Iterator( const Handle( HYDROData_LandCoverMap )& ); - HYDRODATA_EXPORT ~Iterator(); + Explorer( const HYDROData_LandCoverMap& ); + HYDRODATA_EXPORT Explorer( const Handle( HYDROData_LandCoverMap )& ); + HYDRODATA_EXPORT ~Explorer(); void Init( const HYDROData_LandCoverMap& ); HYDRODATA_EXPORT bool More() const; @@ -66,7 +74,7 @@ public: void SetStricklerType( const QString& ); private: - TopoDS_Iterator* myIterator; + TopExp_Explorer* myExplorer; int myIndex; Handle(TDataStd_ExtStringArray) myArray; }; @@ -85,18 +93,25 @@ public: HYDRODATA_EXPORT virtual const ObjectKind GetKind() const; + HYDRODATA_EXPORT bool ImportSHP( const QString& theSHPFileName, + const QList& theIndices = QList() ); + + HYDRODATA_EXPORT bool ExportSHP( const QString& theSHPFileName, bool bUseDiscr = false, double theDefl = 0.1) const; + HYDRODATA_EXPORT DBFStatus ImportDBF( const QString& theDBFFileName, const QString& theFieldName, const QStringList& DBFValues, const QStringList& StricklerTypes, - const QList& theIndices ); - + const QList& theIndices = QList() ); + HYDRODATA_EXPORT void ExportDBF( const QString& theDBFFileName, const QString& theFieldName, const QStringList& theDBFValues, const QStringList& theStricklerTypes ) const; - HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName, double theDeflection ) const; + HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName, + double theDeflection, + const Handle_HYDROData_StricklerTable& theTable ) const; HYDRODATA_EXPORT bool Add( const Handle( HYDROData_Object )&, const QString& theType ); HYDRODATA_EXPORT bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType ); @@ -105,31 +120,59 @@ public: HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& ); HYDRODATA_EXPORT bool Split( const Handle( HYDROData_PolylineXY )& ); + HYDRODATA_EXPORT bool Split( const TopoDS_Shape& ); HYDRODATA_EXPORT bool Merge( const TopTools_ListOfShape&, const QString& theType ); + HYDRODATA_EXPORT bool ChangeType( const TopTools_ListOfShape&, const QString& theType ); + HYDRODATA_EXPORT TopoDS_Face FindByPoint( const gp_Pnt2d&, QString& theType ) const; HYDRODATA_EXPORT TopoDS_Shape GetShape() const; - HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const; + HYDRODATA_EXPORT QString StricklerType( const TopoDS_Face& ) const; + + HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath, + MapOfTreatedObjects& theTreatedObjects ) const; HYDRODATA_EXPORT int GetLCCount() const; HYDRODATA_EXPORT bool IsEmpty() const; HYDRODATA_EXPORT void StoreLandCovers( const HYDROData_MapOfFaceToStricklerType& ); + HYDRODATA_EXPORT virtual bool IsHas2dPrs() const; + + HYDRODATA_EXPORT void SetTransparency( double ); + HYDRODATA_EXPORT double GetTransparency() const; + + HYDRODATA_EXPORT void RemoveInternal(TopoDS_Shape& ShToRebuild, NCollection_IndexedDataMap* aF2FReplace); + + HYDRODATA_EXPORT bool CheckLinear(); + + HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy ); + + HYDRODATA_EXPORT void ClassifyPoints( const std::vector& thePoints, std::vector >& theTypes ) const; + + HYDRODATA_EXPORT void ClassifyPoints( const std::vector& thePoints, + Handle(HYDROData_StricklerTable) theTable, + std::vector& theCoeffs, double DefValue, bool UseMax ) const; + protected: void SetShape( const TopoDS_Shape& ); + bool Add( const TopoDS_Wire&, const QString& ); + bool LocalPartition( const TopoDS_Shape&, const QString& theNewType ); + static TopoDS_Shape MergeFaces(const TopTools_ListOfShape& theFaces, - bool IsToUnify, double theTolerance = 1E-5 ); + bool IsToUnify, + TopTools_IndexedDataMapOfShapeListOfShape* theShHistory = NULL, + double theTolerance = 1E-5 ); public: DEFINE_STANDARD_RTTI( HYDROData_LandCoverMap ); private: - friend class Iterator; + friend class Explorer; friend class test_HYDROData_LandCoverMap; };