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.

84 lines
1.6 KiB
C++

#pragma once
#include <float.h>
#include <math.h>
#include "CommonDefines.h"
class CScatteredTrace;
class CGDFObjectLine;
class SCATTEREDPOINTINDEX
{
public:
SCATTEREDPOINTINDEX(){m_iPointIndex=-1;m_dPointIndex=FLT_MAX;};
int m_iPointIndex;//该点在CScatteredTrace的点序列中的序号
double m_dPointIndex;//该点在边界线上的序号,只对边界点起作用
};
class CScatteredEdge
{
public:
CScatteredEdge();
int m_iTriangleIndex;//邻接的三角形序号
BYTE m_byteBorderIndex;//邻接的三角形边号0,1,2
CGDFObjectLine* m_pObject;
double m_dCutPosition;
CPoint2D m_CutPoint;//该边对应的插入点
SCATTEREDPOINTINDEX m_PointIndex0;
SCATTEREDPOINTINDEX m_PointIndex1;
BYTE m_byteType;//在ContourTracer中 0--正常 1--正方形的斜边
BYTE m_byteFlag;
void ClearFlag();
BYTE GetFlag();
void SetFlag(BYTE byteFlag);
BOOL IsValid();
BOOL IsBorderBorder();
int GetPointIndex(BYTE byteIndex);
};
class CScatteredTriangle
{
public:
CScatteredTriangle();
double m_dValue[3];
CScatteredEdge m_Border[3];
BYTE m_byteFlag;
CScatteredEdge* GetBorder(BYTE byteBorderIndex);
void GetPointIndex(int* piPointIndex);
int GetPointIndex(BYTE byteNodeIndex);
void GetBorderPointIndex(BYTE byteBorderIndex,int& iPointIndex0,int& iPointIndex1);
double GetValue(BYTE byteNodeIndex);
void SetValue(BYTE byteNodeIndex,double dValue);
void GetNeighbor(BYTE byteBorderIndex,int& iNeighborTriangleIndex,BYTE& byteNeighborBorderIndex);
BOOL IsBorderBorder(BYTE byteBorderIndex);
void ClearBorderFlag();
void SetBorderFlag(BYTE byteBorderIndex,BYTE byteFlag);
BYTE GetBorderFlag(BYTE byteBorderIndex);
void operator=(CScatteredTriangle& triangle);
};