#pragma once #ifndef __NEWDATASRUCT_H #define __NEWDATASRUCT_H #include #include #define ROW 12 //所能输入的最多点数 #define COL ROW using namespace std; struct Mat { Mat() { m_pArr=NULL; m_nRow=0; m_nCol=0; } Mat(int row,int col) { if(row>0&&col>0) { m_nRow=row; m_nCol=col; m_pArr=new double[row*col]; //自动选取 automatism 自动化 automatization 边沿 edge fringe 边缘 } else { m_nRow=0; m_nCol=0; m_pArr=NULL; } } Mat(Mat& mat) { m_nRow=mat.m_nRow; m_nCol=mat.m_nCol; int length=m_nRow*m_nCol; m_pArr=new double[length]; for(int i=0;i0&&m_nCol>0) m_pArr=new double[m_nRow*m_nCol]; } void SetCol(int col) { if(m_pArr) delete []m_pArr; m_nCol=col; if(m_nRow>0&&m_nCol>0) m_pArr=new double[m_nRow*m_nCol]; } BOOL SetData(int row,int col,double data) { if(row<0||row>=m_nRow||col<0||col>=m_nCol) return FALSE; m_pArr[row*m_nCol+col]=data; return TRUE; } double GetData(int row,int col) { return m_pArr[row*m_nCol+col]; } Mat TurnSet() { Mat temp(m_nCol,m_nRow); for(int i=0;ix=xPara; this->y=yPara; } PointInt operator+(PointInt& pot) { PointInt temp; temp.x=x+pot.x; temp.y=y+pot.y; return temp; } PointInt operator*(INT mul) { PointInt temp; temp.x=x*mul; temp.y=y*mul; return temp; } }; struct PointDB_New { double x; double y; PointDB_New() { x=0.0; y=0.0; } PointDB_New(double xPara,double yPara) { this->x=xPara; this->y=yPara; } PointDB_New operator+(PointDB_New& pot) { PointDB_New temp; temp.x=x+pot.x; temp.y=y+pot.y; return temp; } PointDB_New operator-(PointDB_New& pot) { PointDB_New temp; temp.x=x-pot.x; temp.y=y-pot.y; return temp; } PointDB_New operator+(CPoint& pot) { PointDB_New temp; temp.x=x+(double)pot.x; temp.y=y+(double)pot.y; return temp; } PointDB_New operator-(CPoint& pot) { PointDB_New temp; temp.x=x-(double)pot.x; temp.y=y-(double)pot.y; return temp; } PointDB_New operator*(double mul) { PointDB_New temp; temp.x=x*mul; temp.y=y*mul; return temp; } PointDB_New& operator=(CPoint& pot) { x=(double)pot.x; y=(double)pot.y; return *this; } PointDB_New& operator=(PointDB_New& pot) { x=pot.x; y=pot.y; return *this; } double Length() { return sqrt(x*x+y*y); } }; typedef struct tagdrawpoint { double X_COOR; double Y_COOR; }DRAWPoint; typedef struct{ double x; double y; double z; }MY3DPoint/*点*//*,MY3DVector向量*/; typedef struct Squ { double ppA[ROW][COL]; int row; int col; }Squ; typedef struct tagpoint { double X; double Y; double R; tagpoint operator=(tagpoint pot) { X=pot.X; Y=pot.Y; R=pot.R; return (*this); } }READPOINT; struct SetCtrl{ short THREAD_WIDTH; //线宽 short AVER_NUMS; //做一个平均值的个数 short RETURN_NUM_POINTS; //返回点数 short MIN_POINTS; //认为是曲线的最少点数 SetCtrl(void) {THREAD_WIDTH=5; AVER_NUMS=5; RETURN_NUM_POINTS=200; MIN_POINTS=100;} }; struct LinkVec{ vector vec; }; struct LinkVecDB{ vector vec; }; typedef struct{ int x; int y; int value; double r; }PointDBV; #endif