//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TGGe3DFace类 // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TGGe3DFace类声明 // = Maintainers: // //-----------------------------------------------------------------------------+ #ifndef _TGGE3DFACE_H_ #define _TGGE3DFACE_H_ #ifndef _TGGEENTITY_H_ #include "TGGeEntity.h" #endif #ifndef _TGGECURVESEGMENT_H_ #include "TGGeCurveSegment.h" #endif #ifndef _TDPTRLIST_H_ #include "TDPtrList.h" #endif #ifndef _TGGEPLANE_H_ #include "TGGePlane.h" #endif #ifndef _TADSGEPOINT3D_H_ #include "TADSGePoint3d.h" #endif #ifndef _TENTITYSET_H_ #include "TEntitySet.h" #endif class TGGe3DFace3Pt; #define FLAG_UNNORMAL 0x10 #define FLAG_TRIANGLE 0x20 //此时0、3两点相等 class GEOAPI TGGe3DFace : public TGGeEntity { public: TGGe3DFace(int tag = 0); TGGe3DFace(TEntitySet &entFace, ads_matrix tranMat = NULL); TGGe3DFace(TGGe3DFace3Pt &face1, TGGe3DFace3Pt &face2); TGGe3DFace(const AcDbFace &face); TGGe3DFace(const TGGe3DFace &face); virtual ~TGGe3DFace(); virtual bool IsKindOf(TEntityId entType) const; virtual TEntityId Type() const; virtual void CopyFrom(const TGGeEntity* pImpSrc); //如果是三角形,则移位使得首末点相同 virtual TGGe3DFace & 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(TEntitySet &entFace); virtual void TransformBy(ads_matrix mat); virtual void ExplodeEdge(TDPtrList &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 TADSGePoint3d& GetVertex(int nIndex); virtual TADSGePoint3d GetVertex(int nIndex)const; virtual void SetVertex(int nIndex, TADSGePoint3d pt); AcDbFace *AsDbFace() const; //0~3顶点向前/向后移位 void MoveShift(BOOL bForward); // 对3dface进行切割 BOOL SectByPlane(const TGGePlane &plan, TDPtrList &upFaces, TDPtrList &downFaces) const; //vtLight都必须是单位向量! virtual TGGePoly3D GetPoly3D()const; TGGePlane GetPlane()const; int operator !() const; TGGe3DFace & operator= (const TGGe3DFace &face); TGGe3DFace & operator << (int nBit); TGGe3DFace & operator >> (int nBit); void SubSortVertex(); BOOL SubSectByX(double xSect, TDPtrList &leftFaces, TDPtrList &rightFaces) const; public: int m_nFlag; TADSGePoint3d m_ptVertex[4]; }; #endif