Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

103 lines
2.5 KiB
C++

#pragma once
#include "GeEntity.h"
#include "GeCurveSegment.h"
#include "superList.h"
#include "GePlane.h"
#include "ADSGePoint3d.h"
#include "EntitySet.h"
#include "GePoly3D.h"
class Ge3DFace3Pt;
#define FLAG_UNNORMAL 0x10
#define FLAG_TRIANGLE 0x20 //此时0、3两点相等
class Ge3DFace : public GeEntity
{
public:
Ge3DFace(int tag = 0);
Ge3DFace(EntitySet &entFace, ads_matrix tranMat = NULL);
Ge3DFace(Ge3DFace3Pt &face1, Ge3DFace3Pt &face2);
Ge3DFace(const AcDbFace &face);
Ge3DFace(const Ge3DFace &face);
virtual ~Ge3DFace();
virtual bool IsKindOf(TEntityId entType) const;
virtual TEntityId Type() const;
virtual void CopyFrom(const GeEntity* pImpSrc);
//如果是三角形,则移位使得首末点相同
virtual Ge3DFace & MakeBetter();
virtual int IsLinear() const;
virtual int IsPoint() const;
virtual int IsRectangular(ads_real *x = NULL, ads_real *y = NULL) const;
// nMethod: 0-采用标记来判断,1-采用首没点是否相同来判断,2-采用任意相邻2点相等来判断
// 执行速度依次递减
virtual BOOL IsTriangle(int nMethod) const;
virtual BOOL IsVisible(int nSide) const;
virtual void SetVisible(int nSide, BOOL bTrue);
virtual int GetExtend(ads_point lowPt, ads_point upPt) const;
virtual int Make(LPCTSTR lay = NULL) const;
virtual int Modify(EntitySet &entFace);
virtual void TransformBy(ads_matrix mat);
virtual void ExplodeEdge(PtrList<GeCurveSegment> &lstSegs) const;
virtual void SetElevation(double nElev);
virtual TVector3D GetNormal() const;
virtual void Reverse();
virtual int GetFlag()const;
virtual void SetFlag(const int nFlag);
virtual ADSGePoint3d& GetVertex(int nIndex);
virtual ADSGePoint3d GetVertex(int nIndex)const;
virtual void SetVertex(int nIndex, ADSGePoint3d pt);
AcDbFace *AsDbFace() const;
//0~3顶点向前/向后移位
void MoveShift(BOOL bForward);
// 对3dface进行切割
BOOL SectByPlane(const GePlane &plan, PtrList<Ge3DFace> &upFaces, PtrList<Ge3DFace> &downFaces) const;
//vtLight都必须是单位向量!
virtual GePoly3D GetPoly3D()const;
GePlane GetPlane()const;
int operator !() const;
Ge3DFace & operator= (const Ge3DFace &face);
Ge3DFace & operator << (int nBit);
Ge3DFace & operator >> (int nBit);
void SubSortVertex();
BOOL SubSectByX(double xSect, PtrList<Ge3DFace> &leftFaces, PtrList<Ge3DFace> &rightFaces) const;
public:
int m_nFlag;
ADSGePoint3d m_ptVertex[4];
};