You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/GVision/FaultAmplitudeLib/FaultAmplitudeCreator.h

133 lines
3.9 KiB
C

1 month ago
#pragma once
#include <string>
#include <set>
#include <map>
#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; //ˮƽ<CBAE>Ͼ<EFBFBD>
double amplitude; //<2F><>ֱ<EFBFBD>Ͼ<EFBFBD>
double angle; // <20><><EFBFBD>ӽǶ<D3BD> -pi~pi
};
class AFX_EXT_CLASS CFaultAmplitudeCreator
{
public:
CFaultAmplitudeCreator();
virtual ~CFaultAmplitudeCreator(void);
void Clear(void);
bool ReadDfdMap(const char* strFile); //<2F><>ȡdfdͼ<64><CDBC>
bool ReadDfg(const char* strDfg); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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));
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>execute
virtual bool Execute();
GDfdMap* GetDfd(void);
GSurface* GetDfg(void);
bool GetFltAmplitudeInfo(GPline* pFlt, GPline* pSvy, FAmplitudeInfo& fmInfo);
//<2F><>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD>pt1<74><31>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2>ĵڶ<C4B5><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬pt1Ϊ<31>ϲ<EFBFBD><CFB2>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD>㣬angleΪ<65>Ƕȣ<C7B6>dstptΪĿ<CEAA><EFBFBD><EABDBB>
bool Get2rdPoint(GPline* pFlt, GPoint3D& pt1, double angle, GPoint3D& dstPt);
double GetAmplitude(const GPoint3D& pt1, const GPoint3D& pt2, GPline* pFlt = nullptr);// pt1 pt2Ϊ<32>ϵ<EFBFBD>
double GetAmplitude(const GPoint3D& pt, const GPoint3D& ptStart, const GPoint3D& ptEnd);// ptStart ptEndΪ<64>ϲ<EFBFBD><CFB2><EFBFBD>
protected:
GDfdMap* m_dfdMap;
GSurface* m_dfg;
CString m_strInputDfd;
CString m_strInputDfg;
CString m_strOutDfd;
CString m_strOutCsv;
//parameters
public:
CString m_strFltLayer; //<2F>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD>ڲ<EFBFBD>
CString m_strSurveyLayer; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>
CString m_strFltNameFile; //<2F>ϲ<EFBFBD><CFB2><EFBFBD>ɸѡ<C9B8>ļ<EFBFBD>
int m_iCalcMethod; // 0= <20>ȼ<EFBFBD><C8BC><EFBFBD> 1= <20><><EFBFBD><EFBFBD>
float m_pillarStep; // <20><><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD>
float m_thresholdValue; //<2F>Ͼ<EFBFBD><CFBE>ֽ<EFBFBD>ֵ
COLORREF m_clrLow; //Сֵ<D0A1><D6B5>ɫ
COLORREF m_clrHigh; //<2F><>ֵ<EFBFBD><D6B5>ɫ
float m_PillarWidth; //<2F><><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD>
float m_PillarHeightRatio; //<2F><><EFBFBD>Ӹ߶ȱ<DFB6>
float m_TextHeight; //<2F><><EFBFBD>ָ߶<D6B8>
CString m_strFltNames; // <20>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
bool m_bLocalFltDirect; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ
bool m_bWithIncline; // <20>Ƿ<EFBFBD><C7B7><EFBFBD>ע<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
double m_inclineScale; // <20><><EFBFBD>DZ<EFBFBD><C7B1><EFBFBD>
COLORREF m_clrIncline; // <20>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
protected:
//<2F>ɲ<EFBFBD><C9B2>߼<EFBFBD><DFBC><EFBFBD><EFBFBD>Ͼ<EFBFBD>
void CalcAmplitudeWithSurvey(void);
//<2F>ɲ<EFBFBD><C9B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͼ<EFBFBD>
void CalcAmplitudeWithStep(void);
void CalcAmplitudeWithStep(GPline* flt,std::vector<FAmplitudeInfo>* dstFAInfo = nullptr);
//д<><D0B4>dfd
virtual bool WriteDfd(void);
//д<><D0B4>csv
virtual bool WriteCsv(void);
//<2F><>ȡָ<C8A1><D6B8><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>
void ReadFltNames(void);
//<2F><>ȡ<EFBFBD><C8A1>ѡ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>
void GetCandidateFlts(void);
//<2F><>ȡ<EFBFBD><C8A1>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
void GetCandidateSurveys(void);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD>
int CreatePillarPolygons(void);
//<2F><>FAmplitudeInfo<66><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD>
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);
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>߻<EFBFBD><DFBB><EFBFBD> <20><>0-PI]
double GetSurveyAngle(GPline* psvy);
std::set<string> m_tarFltNames;
std::vector<GPline*> m_candidateFlts; //<2F><>ѡ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>
std::vector<GPline*> m_candidateSurveys; //<2F><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
std::vector<FAmplitudeInfo> m_ampResults; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
std::vector<GPline*> m_pillarPolygons;
std::map<GPline*,GPoint3D> m_pillarTexts; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
std::vector<GPline*> m_pillarPolygonsInc;
std::map<GPline*, GPoint3D> m_pillarTextsInc; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
private:
std::vector<GRect8> m_fltRects;
std::vector<GRect8> m_surveyRects;
CString m_strLayerPillarHigh; //<2F><>λ<EFBFBD><CEBB> <20>Ͼ<EFBFBD><CFBE><EFBFBD><EFBFBD><EFBFBD>\\<5C><>ֵ
CString m_strLayerPillarLow; //<2F>Ͼ<EFBFBD><CFBE><EFBFBD><EFBFBD><EFBFBD>\\<5C><>ֵ
CString m_strLayerPillarText; //<2F>Ͼ<EFBFBD><CFBE><EFBFBD><EFBFBD><EFBFBD>\\<5C><><EFBFBD><EFBFBD>
CString m_strLayerPillarIncline; // <20>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
CString m_strLayerTextIncline; // <20>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
double m_surveyAngle; //<2F><><EFBFBD>߻<EFBFBD><DFBB><EFBFBD>
};