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.
77 lines
2.5 KiB
C++
77 lines
2.5 KiB
C++
#ifndef COMMONDEFINES_H
|
|
#define COMMONDEFINES_H
|
|
|
|
#include "math.h"
|
|
|
|
class FACIESPOINT
|
|
{
|
|
public:
|
|
FACIESPOINT(double X=0.0,double Y=0.0,BYTE smooth1=0){x=X;y=Y;smooth=smooth1;flag=0;};
|
|
void operator=(const FACIESPOINT& point){x=point.x;y=point.y;flag=point.flag;smooth=point.smooth;};
|
|
void operator+=(CSize8& size){x+=size.cx;y+=size.cy;};
|
|
BOOL operator==(const FACIESPOINT& point){if(x==point.x && y==point.y) return TRUE;return FALSE;};
|
|
BOOL operator!=(const FACIESPOINT& point){if(x!=point.x || y!=point.y) return TRUE;return FALSE;};
|
|
void operator*=(double dValue){x*=dValue;y*=dValue;};
|
|
void operator+=(FACIESPOINT& point){x+=point.x;y+=point.y;};
|
|
POINT ConvertToPOINT(){POINT point;point.x=(int)x;point.y=(int)y;return point;};
|
|
double x;
|
|
double y;
|
|
BYTE smooth;//0x01 平滑标志 0x02 X方向单独移动
|
|
BYTE flag;
|
|
};
|
|
|
|
class POINTSERIESID
|
|
{
|
|
public:
|
|
POINTSERIESID(int i0=0,int i1=0,int ver=0){id0=i0;id1=i1;version=ver;};
|
|
void operator=(POINTSERIESID& id){id0=id.id0;id1=id.id1;version=id.version;};
|
|
void operator=(POINTSERIESID* id){id0=id->id0;id1=id->id1;version=id->version;};
|
|
BOOL operator==(POINTSERIESID* id){return memcmp(this,id,sizeof(POINTSERIESID))==0;};
|
|
BOOL operator==(POINTSERIESID& id){return memcmp(this,&id,sizeof(POINTSERIESID))==0;};
|
|
BOOL operator!=(POINTSERIESID& id){return memcmp(this,&id,sizeof(POINTSERIESID))!=0;};
|
|
UINT id0;
|
|
UINT id1;
|
|
UINT version;
|
|
};
|
|
|
|
class POINTINDEX
|
|
{
|
|
public:
|
|
POINTINDEX(POINTSERIESID ID,int i){id=ID;index=i;};
|
|
POINTINDEX(){};
|
|
POINTSERIESID id;
|
|
int index;
|
|
BOOL operator==(POINTINDEX& pointindex){return id==pointindex.id && index==pointindex.index;};
|
|
void operator=(POINTINDEX& pointindex){id=pointindex.id;index=pointindex.index;};
|
|
};
|
|
|
|
class INTERPOINT
|
|
{
|
|
public:
|
|
double index0;//线1上的位置索引
|
|
double index1;//线2上的位置索引
|
|
double x;//求交点时保存交点位置,求最近点时,保存是线1上的最近点的位置
|
|
double y;//求交点时保存交点位置,求最近点时,保存是线1上的最近点的位置
|
|
double x1;//求交点时未使用,求最近点时,保存是线2上的最近点的位置
|
|
double y1;//求交点时未使用,求最近点时,保存是线2上的最近点的位置
|
|
int iType;//02--左侧到右侧 20--右侧到左侧
|
|
//p2线穿越p1线时的位置变化关系,02表示从左侧穿越到右侧,20表示从右侧穿越到左侧
|
|
|
|
BOOL GetLeftToRight() { return (iType/10)==0 || (iType&10)==2; };
|
|
void SetLeftToRight(BOOL bValue){ iType=bValue?02:20;};
|
|
};
|
|
|
|
enum FACIESSEGMENTDIRECTION
|
|
{
|
|
segmentnodirection,
|
|
segmentforward,
|
|
segmentbackward
|
|
};
|
|
|
|
#define POINTATTRIBUTE_SMOOTH 0x01 //是否平滑
|
|
|
|
#define NULLCOLOR RGB(255,255,255)
|
|
|
|
#define CURVESTEP 32
|
|
|
|
#endif |