#pragma once #include #include #include #include "../BaseLib/BaseElements.h" class GDfdMap; class GSurface; //class FAmplitudeInfo; using namespace std; class AFX_EXT_CLASS FAmplitudeInfo { public: FAmplitudeInfo(); virtual ~FAmplitudeInfo(); string fltName; string surveyName; double x0; double y0; double x1; double y1; double xMid; double yMid; double horizontal_dist; //水平断距 double amplitude; //垂直断距 double angle; // 柱子角度 -pi~pi }; class AFX_EXT_CLASS CFaultAmplitudeCreator { public: CFaultAmplitudeCreator(); virtual ~CFaultAmplitudeCreator(void); void Clear(void); bool ReadDfdMap(const char* strFile); //读取dfd图件 bool ReadDfg(const char* strDfg); //读取背景曲面 bool CreateDfg(int numx, int numy, double x0, double y0, double dx, double dy, double* values); void SetZRange(double zmin, double zmax); void SetOutPaths(CString strOutDfd, CString strOutCsv); void InsertLayer(const string& strLayer); void InsertElement(GBaseObj* pobj, const string& strLayer, COLORREF color = RGB(0, 0, 0)); //设置其他参数后执行execute virtual bool Execute(); GDfdMap* GetDfd(void); GSurface* GetDfg(void); bool GetFltAmplitudeInfo(GPline* pFlt, GPline* pSvy, FAmplitudeInfo& fmInfo); //获去经过pt1的直线与断层的第二个交点,pt1为断层上测量点,angle为角度,dstpt为目标交点 bool Get2rdPoint(GPline* pFlt, GPoint3D& pt1, double angle, GPoint3D& dstPt); double GetAmplitude(const GPoint3D& pt1, const GPoint3D& pt2, GPline* pFlt = nullptr);// pt1 pt2为断点 double GetAmplitude(const GPoint3D& pt, const GPoint3D& ptStart, const GPoint3D& ptEnd);// ptStart ptEnd为断层段 protected: GDfdMap* m_dfdMap; GSurface* m_dfg; CString m_strInputDfd; CString m_strInputDfg; CString m_strOutDfd; CString m_strOutCsv; //parameters public: CString m_strFltLayer; //断层所在层 CString m_strSurveyLayer; //测线所在层 CString m_strFltNameFile; //断层名筛选文件 int m_iCalcMethod; // 0= 等间距 1= 测线 float m_pillarStep; // 柱子步长 float m_thresholdValue; //断距分界值 COLORREF m_clrLow; //小值颜色 COLORREF m_clrHigh; //大值颜色 float m_PillarWidth; //柱子宽度 float m_PillarHeightRatio; //柱子高度比 float m_TextHeight; //文字高度 CString m_strFltNames; // 断层名称列表 bool m_bLocalFltDirect; //柱子与断层局部方向垂直 bool m_bWithIncline; // 是否标注断层倾角 double m_inclineScale; // 倾角比例 COLORREF m_clrIncline; // 断层倾角颜色 protected: //由测线计算断距 void CalcAmplitudeWithSurvey(void); //由步长计算断距 void CalcAmplitudeWithStep(void); void CalcAmplitudeWithStep(GPline* flt,std::vector* dstFAInfo = nullptr); //写出dfd virtual bool WriteDfd(void); //写出csv virtual bool WriteCsv(void); //读取指定断层名 void ReadFltNames(void); //获取候选断层线 void GetCandidateFlts(void); //获取候选测线 void GetCandidateSurveys(void); //生成柱子多边形 int CreatePillarPolygons(void); //由FAmplitudeInfo生成柱子多边形 void CreatePillarPolygon(FAmplitudeInfo& fi, GPline* pline, GPline* plineInc); void ErasePillarPgns(void); virtual void WriteLayers(FILE* fw); void WritePillars(FILE* fw); virtual void WriteTextPoints(FILE* fw); //获取测线弧度 (0-PI] double GetSurveyAngle(GPline* psvy); std::set m_tarFltNames; std::vector m_candidateFlts; //候选断层线 std::vector m_candidateSurveys; //候选测线 std::vector m_ampResults; //计算结果 std::vector m_pillarPolygons; std::map m_pillarTexts; //柱子文字位置 std::vector m_pillarPolygonsInc; std::map m_pillarTextsInc; //柱子文字位置 private: std::vector m_fltRects; std::vector m_surveyRects; CString m_strLayerPillarHigh; //层位: 断距柱子\\高值 CString m_strLayerPillarLow; //断距柱子\\低值 CString m_strLayerPillarText; //断距柱子\\文字 CString m_strLayerPillarIncline; // 断层倾角 CString m_strLayerTextIncline; // 断层倾角 double m_surveyAngle; //测线弧度 };