Salome HOME
Initial merge of branch 'BR_HYDRO_IMPS_2016' into BR_PORTING_OCCT_7
[modules/hydro.git] / src / HYDROData / HYDROData_LandCoverMap.h
index 15f293f7218075f239c3d96245a6b8c079f2dd87..e00eaebd9be20760f0dbfa058d8e1c6b3c77e3a0 100644 (file)
 #include <NCollection_IndexedDataMap.hxx>
 #include <QString>
 #include <TopoDS_Face.hxx>
+#include <TopExp_Explorer.hxx>
+#include <vector>
+#include <set>
 
-class Handle_HYDROData_StricklerTable;
+class HYDROData_StricklerTable;
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
 typedef NCollection_IndexedDataMap<TopoDS_Face, QString> 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 HYDROData_PolylineXY;
+class HYDROData_Object;
+class gp_XY;
 
 class HYDROData_LandCoverMap : public HYDROData_Entity
 {
@@ -53,12 +54,12 @@ protected:
   };
 
 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;
@@ -70,7 +71,7 @@ public:
     void SetStricklerType( const QString& );
 
   private:
-    TopoDS_Iterator* myIterator;
+    TopExp_Explorer* myExplorer;
     int              myIndex;
     Handle(TDataStd_ExtStringArray) myArray;
   };
@@ -89,12 +90,17 @@ public:
 
   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
 
+  HYDRODATA_EXPORT bool ImportSHP( const QString& theSHPFileName,
+                                   const QList<int>& theIndices = QList<int>() );
+  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<int>& theIndices = QList<int>() );
+
   HYDRODATA_EXPORT void ExportDBF( const QString& theDBFFileName,
                                    const QString& theFieldName, 
                                    const QStringList& theDBFValues,
@@ -102,11 +108,13 @@ public:
 
   HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName,
                                        double theDeflection,
-                                       const Handle_HYDROData_StricklerTable& theTable ) const;
+                                       const Handle(HYDROData_StricklerTable)& theTable,
+                                       QString& statMessage) const;
 
   HYDRODATA_EXPORT bool Add( const Handle( HYDROData_Object )&, const QString& theType );
   HYDRODATA_EXPORT bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType );
 
+  using HYDROData_Entity::Remove;
   HYDRODATA_EXPORT bool Remove( const TopoDS_Face& );
   HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& );
 
@@ -135,21 +143,35 @@ public:
   HYDRODATA_EXPORT void SetTransparency( double );
   HYDRODATA_EXPORT double GetTransparency() const;
 
-  HYDRODATA_EXPORT TopoDS_Shape RemoveInternal(const TopoDS_Shape& InSh);
+  HYDRODATA_EXPORT void RemoveInternal(TopoDS_Shape& ShToRebuild, NCollection_IndexedDataMap<TopoDS_Face, TopoDS_Face>* aF2FReplace);
+
+  HYDRODATA_EXPORT bool CheckLinear();
+
+  HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy );
+
+  HYDRODATA_EXPORT void ClassifyPoints( const std::vector<gp_XY>& thePoints, std::vector<std::set <QString> >& theTypes ) const;
+
+  HYDRODATA_EXPORT void ClassifyPoints( const std::vector<gp_XY>& thePoints,
+    Handle(HYDROData_StricklerTable) theTable, 
+    std::vector<double>& 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 );
+  DEFINE_STANDARD_RTTIEXT( HYDROData_LandCoverMap, HYDROData_Entity );
 
 private:
-  friend class Iterator;
+  friend class Explorer;
   friend class test_HYDROData_LandCoverMap;
 };