100 lines
3.6 KiB
C++
100 lines
3.6 KiB
C++
#ifndef __DBVERTSLAB_H
|
|
#define __DBVERTSLAB_H
|
|
//#include "DbEntity.h"
|
|
|
|
class TARCH_EXP TDbVertSlab: public TDbEntity
|
|
{
|
|
DECLARE_TENTBASE();
|
|
ACRX_DECLARE_MEMBERS(TDbVertSlab);
|
|
|
|
private:
|
|
const static Adesk::UInt8 g_nVersion;
|
|
|
|
protected:
|
|
XPoint m_ptStart, m_ptEnd;
|
|
double m_nThickness; //必须大于0
|
|
double m_nHeightS, m_nHeightE; //起点高度和终点高度, 必须全>0或<0
|
|
Adesk::UInt8 m_bShow2d; //是否显示二维
|
|
|
|
public:
|
|
TDbVertSlab();
|
|
~TDbVertSlab();
|
|
|
|
virtual BOOL IsValid() const;
|
|
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
|
|
|
// Overriden function from AcDbEntity
|
|
virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
|
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
|
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
|
|
AcDbIntArray& osnapModes,
|
|
AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray & stretchPoints) const;
|
|
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
|
|
// drived from TDbEntity
|
|
virtual bool IsModelEntity() const{return true;}
|
|
virtual Acad::ErrorStatus ExplodeOrDraw3d(XExplodeDraw &dc) const;
|
|
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
|
virtual void GetTips(DList<TObjInfoUnit> &) const; //取动态属性显示数据
|
|
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
|
virtual const TCHAR *GetDefaultLayer() const;
|
|
|
|
BOOL Is2DVisible() const;
|
|
double GetThickness() const;
|
|
double GetHeightS() const;
|
|
double GetHeightE() const;
|
|
XPoint GetStartPoint() const;
|
|
XPoint GetEndPoint() const;
|
|
|
|
void SetThickness(double h);
|
|
void SetHeightS(double s);
|
|
void SetHeightE(double e);
|
|
void Set2DVisible(BOOL bTrue);
|
|
void SetStartPoint(const XPoint &pt);
|
|
void SetEndPoint(const XPoint &pt);
|
|
|
|
// 工程量
|
|
double GetPerimeter() const;
|
|
double GetBottomArea() const;
|
|
double GetSideArea() const;
|
|
double GetVolume() const;
|
|
|
|
public:
|
|
// sg add 100925,支持竖板上开洞
|
|
// 如果是圆洞,dWidth为直径,dHeight为0
|
|
bool AddHole(TADSGePoint3d ptLoc, double dWidth, double dHeight);
|
|
|
|
// sg add 100927,设置洞口数量的动态数据
|
|
Adesk::UInt16 GetHolesNum() const;
|
|
|
|
// sg add 100926,获取所有洞口的轮廓线
|
|
void GetAllHoles(TDPtrList<TGGePoly2D> &lstHoles) const;
|
|
|
|
private:
|
|
// sg add 100926,根据传入的中间立面上的开洞位置点,以及洞口尺寸,返回中间立面上的洞口轮廓线
|
|
// 如果是圆洞,dWidth为直径,dHeight为0
|
|
void GetHolePline(TADSGePoint3d ptLoc, double dWidth, double dHeight, TGGePoly2D &poly) const;
|
|
|
|
// sg add 100926,增加洞口的动态数据
|
|
void SetHolePLine(const TGGePoly2D &polyHole);
|
|
|
|
// sg add 100927,设置洞口数量的动态数据增加的个数
|
|
void PlusHolesNum(Adesk::UInt16 nPlusNum);
|
|
|
|
private:
|
|
// sg add 100927,将polyHole投影到XLine(m_ptStart, m_ptEnd)上,获取外轮廓
|
|
void GetHolePtOnMidLine(const TGGePoly2D &polyHole, TADSGePoint3d &ptStart, TADSGePoint3d &ptEnd) const;
|
|
|
|
// sg add 100927,三维绘制,支持竖板上带洞
|
|
Acad::ErrorStatus Draw3dHole(XExplodeDraw &dc) const;
|
|
};
|
|
|
|
#endif |