|
|
#pragma once
|
|
|
#include <list>
|
|
|
#include <vector>
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
class AFX_EXT_CLASS RoseBar
|
|
|
{
|
|
|
public:
|
|
|
RoseBar(void);
|
|
|
float agl[2]; //开始,结束角度[agl0,agl1)
|
|
|
int count; //条数
|
|
|
};
|
|
|
|
|
|
class AFX_EXT_CLASS CFaultRosesCreator
|
|
|
{
|
|
|
public:
|
|
|
CFaultRosesCreator();
|
|
|
~CFaultRosesCreator();
|
|
|
//清空玫瑰图
|
|
|
void Clear();
|
|
|
//读取断层统计数据,TargetColumn = 走向列, iRowStart = 第几行开始
|
|
|
bool ReadFile(CString strInput, int TargetColumn,int iRowStart);
|
|
|
void CreateRoseBars(void);
|
|
|
//将玫瑰图写入dfd文件
|
|
|
void WriteDFD(CString strOutput);
|
|
|
|
|
|
//参数设置
|
|
|
public:
|
|
|
float m_fBarInterval; //玫瑰条间隔度数
|
|
|
int m_nBarMaxNumber; //最大条数
|
|
|
int m_nCircleTickInterval; //外框刻标间隔度数
|
|
|
BOOL m_bAutoCalc; //是否自动计算最大条数
|
|
|
double m_dCX; //中心点坐标x
|
|
|
double m_dCY; //中心点坐标y
|
|
|
double m_dR; //玫瑰图半径
|
|
|
COLORREF m_barColor; //玫瑰条颜色
|
|
|
int m_iRotateAngle; //坐标系旋转角度
|
|
|
protected:
|
|
|
|
|
|
void WriteDfdHead(FILE* fw);
|
|
|
void WriteLayers(FILE* fw);
|
|
|
void WriteBorder(FILE* fw); //输出圆框
|
|
|
void WriteTicks(FILE* fw); //输出刻线
|
|
|
void WriteText(FILE* fw); //输出文字
|
|
|
void WriteBars(FILE* fw); //输出花瓣
|
|
|
void WriteColor(FILE* fw,COLORREF clr);
|
|
|
void WriteOneBar(FILE* fw,RoseBar rb,COLORREF clr);
|
|
|
//写出一根刻线,angle正北坐标角度,factor为长度与半径的比例
|
|
|
void WriteOneTick(FILE* fw, double angle, double fs, double fe);
|
|
|
//写出一组文字 x0,y0为左上角坐标,width,height为宽高
|
|
|
void WriteOneText(FILE* fw, CString str,double x0, double y0, double width, double height);
|
|
|
//指定角度(顺时针方向,正北为0)和半径百分比获取园内部坐标
|
|
|
bool GetCoordiante(double degree, double factor, double& x, double& y);
|
|
|
//由角度和起止比例获取线段
|
|
|
bool GetSegment(double angle, double fstart, double fend, double*x, double* y);
|
|
|
|
|
|
double ConvertAngle(double angle); //坐标转换为正北坐标
|
|
|
double GetRealAngle(double angle); //正北坐标转换为笛卡尔坐标
|
|
|
int AutoCalcMapBarMaxNum(void);//自动计算图显示最大值
|
|
|
list<double> m_data;
|
|
|
|
|
|
vector<RoseBar> m_rosebars;
|
|
|
int m_nRealBarMax; //实际单瓣最大值
|
|
|
CString m_strLayerCircle;
|
|
|
CString m_strLayerTicks;
|
|
|
CString m_strLayerText;
|
|
|
CString m_strLayerBars; //花瓣层
|
|
|
|
|
|
|
|
|
};
|
|
|
|