134 lines
3.0 KiB
C++
134 lines
3.0 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, SH Software Co. Ltd.
|
|
// = FileName : X3DFace类
|
|
// = Version : ver2.0
|
|
// = Author : zjq
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: X3DFace类声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _X3DFACE_H_
|
|
#define _X3DFACE_H_
|
|
|
|
#ifndef _XENTITY_H_
|
|
#include "XEntity.h"
|
|
#endif
|
|
|
|
#ifndef _XCURVESEGMENT_H_
|
|
#include "XCurveSegment.h"
|
|
#endif
|
|
|
|
#ifndef _DLIST_H_
|
|
#include "DList.h"
|
|
#endif
|
|
|
|
#ifndef _XPLANE_H_
|
|
#include "XPlane.h"
|
|
#endif
|
|
|
|
#ifndef _XPOINT_H_
|
|
#include "XPoint.h"
|
|
#endif
|
|
|
|
#ifndef _ENTITY_H_
|
|
#include "Entity.h"
|
|
#endif
|
|
|
|
class X3DFace3Pt;
|
|
|
|
#define FLAG_UNNORMAL 0x10
|
|
#define FLAG_TRIANGLE 0x20 //此时0、3两点相等
|
|
|
|
class GEOAPI X3DFace : public XEntity
|
|
{
|
|
public:
|
|
|
|
X3DFace(int tag = 0);
|
|
|
|
X3DFace(Entity &entFace, ads_matrix tranMat = NULL);
|
|
|
|
X3DFace(X3DFace3Pt &face1, X3DFace3Pt &face2);
|
|
|
|
X3DFace(const AcDbFace &face);
|
|
|
|
X3DFace(const X3DFace &face);
|
|
|
|
virtual ~X3DFace();
|
|
|
|
virtual bool IsKindOf(TEntityId entType) const;
|
|
virtual TEntityId Type() const;
|
|
virtual void CopyFrom(const XEntity* pImpSrc);
|
|
|
|
|
|
//如果是三角形,则移位使得首末点相同
|
|
virtual X3DFace & 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(Entity &entFace);
|
|
|
|
virtual void TransformBy(ads_matrix mat);
|
|
|
|
virtual void ExplodeEdge(DList<XCurveSegment> &lstSegs) const;
|
|
|
|
virtual void SetElevation(double nElev);
|
|
|
|
virtual XVector3D GetNormal() const;
|
|
|
|
virtual void Reverse();
|
|
|
|
virtual int GetFlag()const;
|
|
virtual void SetFlag(const int nFlag);
|
|
|
|
virtual XPoint& GetVertex(int nIndex);
|
|
virtual XPoint GetVertex(int nIndex)const;
|
|
virtual void SetVertex(int nIndex, XPoint pt);
|
|
|
|
AcDbFace *AsDbFace() const;
|
|
|
|
//0~3顶点向前/向后移位
|
|
void MoveShift(BOOL bForward);
|
|
|
|
// 对3dface进行切割
|
|
BOOL SectByPlane(const XPlane &plan, DList<X3DFace> &upFaces, DList<X3DFace> &downFaces) const;
|
|
|
|
//vtLight都必须是单位向量!
|
|
virtual XPoly3D GetPoly3D()const;
|
|
|
|
XPlane GetPlane()const;
|
|
|
|
int operator !() const;
|
|
|
|
X3DFace & operator= (const X3DFace &face);
|
|
|
|
X3DFace & operator << (int nBit);
|
|
|
|
X3DFace & operator >> (int nBit);
|
|
|
|
void SubSortVertex();
|
|
BOOL SubSectByX(double xSect, DList<X3DFace> &leftFaces, DList<X3DFace> &rightFaces) const;
|
|
public:
|
|
int m_nFlag;
|
|
XPoint m_ptVertex[4];
|
|
};
|
|
|
|
|
|
#endif
|