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.

112 lines
3.0 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "item.h"
namespace NItem
{
#define MESH_DEFAULT 0
#define MESH_CREATE_CONTOUR 1
#define MESH_EDIT_NODE 2 //网格节点编辑
#define MESH_HISTOGRAM 3 //统计图
#define MESH_GET_RANGE 4 //获得Z值范围,用户可以指定无效值
#define MESH_GRID_SMOOTH 5 //对网格进行平滑
class CItemMesh : public CItem
{
public:
CItemMesh(CSigmaDoc* ppDoc);
virtual ~CItemMesh(void);
//CDC* m_pDrawDC;
//virtual void OnDraw(CXyDC* pDC);
void OnLButtonDown(CDC * pDC, UINT nFlags, CPoint point, int vk) override;
int OnMouseMove(CDC * pDC, UINT nFlags, CPoint point) override;
void SetPos(POSITION pos) override;
CMesh* GetMesh(void);
void SaveAs(COne* pOne, LPCTSTR filePath, int index);
void SaveAsOnlyData(COne* pOne, LPCTSTR filePath);
wchar_t * GetInformationForGeneratingContour();
bool CreateContour(COne* pOne, char * infoString);
//BOOL InitPropertyGridMesh(CXTPPropertyGrid& grid);
bool GridPointNoExist(UINT nFlags, CPoint point);
CString GetGridValue(UINT nFlags, CPoint point);
//平滑操作
bool GridSmooth(COne* pOne, double coefficient, int smoothNumber);
void OnDraw(CXyDC* pDC) override;
void OnDraw(CXyDC* pXyDC, CDC* pDC) override;
void EditNode(CSigmaView* pView, CDC *pDC, CRect rt);
bool FindNodeLocation(CDC *pDC, CPoint point, int& locationX, int& locationY);
void Histogram(void);
void ConfirmGridBtn();
int GetEditMode(void);
CPositionList m_posAddList;
//for histogram
void SetHistogramRange(double zmin, double zmax);
int DeleteSelected(void);
void DrawNode(CXyDC* pDC);
void DrawNode(CXyDC* pDC, CRect rect);
void SetZValueOfNodeSelected(double v);
bool SetZOfGridPoint(double z, int row, int column);
void GetAreaAndValueForSelected(double minZ, double maxZ, double * areaOut, double * volumeOut);
protected:
CDC * pDrawerDC;
//for histogram
void DrawHistogram(CXyDC* pDC);
bool ParseInformationOfCreatingContour(char * infoStr);
CSize8 m_zrange; //Z值范围
BOOL m_bDrawRangeZ;
//CDlgHistogram *m_pHistogramDlg;
CColorBase color;
int typeIndex; //背景显示类型:透明等
long m_levelAlpha; //透明度设置0-255
CString name;
int modeFun; //偏导等
int GetFunctionIdea(DWORD nFunMode);
DWORD GetFunctionMode(int nFunIdea);
int m_nDimensionSel; //维数0=2D1=3D
BOOL m_bReversal = FALSE;
BOOL m_bRuler = FALSE;
BOOL m_bUpdateRuler = FALSE;
CPoint2D m_point;
BOOL m_bShowColorPane;
int m_RulerIdea; //如水平平滑,水平方格,垂直平滑,垂直方格
int GetRulerIdea(DWORD nMode);
DWORD GetRulerMode(int nIdea);
int m_nSelect;
//for create contour
double m_contourStep;
long m_contourMarkStep;
CString m_strLayerMark;
CString m_strLayerOther;
int m_nFaultageMode;
CString m_strFaultageFile;
CString m_strFaultageLayer;
//for node edit
BOOL m_bDrawPrevPoint;
CPoint2D m_ptPrevPoint;
void DrawFocus(CPoint2D point);
//for get Z range
CSize8 m_szInvalidateValueZ;
BOOL m_bResetZ = FALSE;
//for smooth
double m_smoothcoef; //平滑系数
long m_smthtimes; //平滑次数
CRect clientRect;
};
};