#include <HYDROData_Entity.h>
#include <TDataStd_ExtStringArray.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+#include <QString>
+#include <TopoDS_Face.hxx>
+#include <TopExp_Explorer.hxx>
+
+class Handle_HYDROData_StricklerTable;
+
+typedef NCollection_IndexedDataMap<TopoDS_Face, QString> HYDROData_MapOfFaceToStricklerType;
DEFINE_STANDARD_HANDLE( HYDROData_LandCoverMap, HYDROData_Entity )
-class TopoDS_Face;
class TopoDS_Shape;
+class TopoDS_Wire;
class TopoDS_Iterator;
class TopTools_ListOfShape;
-class Handle( HYDROData_Polyline );
+class Handle( HYDROData_PolylineXY );
class Handle( HYDROData_Object );
-class HYDROData_MapOfShapeToStricklerType;
+class gp_Pnt2d;
class HYDROData_LandCoverMap : public HYDROData_Entity
{
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,
};
- class Iterator
+public:
+ class Explorer
{
public:
- Iterator( const HYDROData_LandCoverMap& );
- ~Iterator();
+ Explorer( const HYDROData_LandCoverMap& );
+ HYDRODATA_EXPORT Explorer( const Handle( HYDROData_LandCoverMap )& );
+ HYDRODATA_EXPORT ~Explorer();
void Init( const HYDROData_LandCoverMap& );
- bool More() const;
- void Next();
+ HYDRODATA_EXPORT bool More() const;
+ HYDRODATA_EXPORT void Next();
- TopoDS_Face Face() const;
- QString StricklerType() const;
+ int Index() const;
+ HYDRODATA_EXPORT TopoDS_Face Face() const;
+ HYDRODATA_EXPORT QString StricklerType() const;
+ void SetStricklerType( const QString& );
private:
- TopoDS_Iterator* myIterator;
+ TopExp_Explorer* myExplorer;
int myIndex;
Handle(TDataStd_ExtStringArray) myArray;
};
- HYDROData_LandCoverMap();
- ~HYDROData_LandCoverMap();
+ enum DBFStatus
+ {
+ DBFStatus_OK,
+ DBFStatus_DIFF_SIZE_ERROR,
+ DBFStatus_OPEN_FILE_ERROR,
+ DBFStatus_NO_SUCH_FIELD_ERROR,
+ DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING
+ };
+
+ HYDRODATA_EXPORT HYDROData_LandCoverMap();
+ HYDRODATA_EXPORT virtual ~HYDROData_LandCoverMap();
+
+ 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,
+ const QStringList& theStricklerTypes ) 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 );
+
+ HYDRODATA_EXPORT bool Remove( const TopoDS_Face& );
+ 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 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& );
- bool ImportQGIS( const QString& theFileName );
- bool ExportQGIS( const QString& theFileName ) const;
- bool ExportTelemac( const QString& theFileName ) const;
+ HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
- bool Add( const Handle( HYDROData_Object )&, const QString& theType );
- bool Add( const Handle( HYDROData_Polyline )&, const QString& theType );
+ HYDRODATA_EXPORT void SetTransparency( double );
+ HYDRODATA_EXPORT double GetTransparency() const;
- bool Remove( const TopoDS_Face& );
+ HYDRODATA_EXPORT TopoDS_Shape RemoveInternal(const TopoDS_Shape& InSh);
- bool Split( const Handle( HYDROData_Polyline )& );
- bool Merge( const TopTools_ListOfShape&, const QString& theType );
+ HYDRODATA_EXPORT bool CheckLinear();
protected:
- TopoDS_Shape GetShape() const;
void SetShape( const TopoDS_Shape& );
+ bool Add( const TopoDS_Wire&, const QString& );
bool LocalPartition( const TopoDS_Shape&, const QString& theNewType );
- void StoreLandCovers( const HYDROData_MapOfShapeToStricklerType& );
+ static TopoDS_Shape MergeFaces(const TopTools_ListOfShape& theFaces,
+ bool IsToUnify, double theTolerance = 1E-5 );
public:
DEFINE_STANDARD_RTTI( HYDROData_LandCoverMap );
private:
- friend class Iterator;
+ friend class Explorer;
+ friend class test_HYDROData_LandCoverMap;
};
#endif