137 lines
4.8 KiB
C++
137 lines
4.8 KiB
C++
#ifndef __DBAPRON_H
|
|
#define __DBAPRON_H
|
|
|
|
#ifndef _TDBPOLYCURVEENT_H_
|
|
#include "TDbPolyCurveEnt.h"
|
|
#endif
|
|
|
|
// 散水自定义对象,8.0为起始版本,2008-8-13 sg add
|
|
class TARCH_EXP TDbApron : public TDbPolyCurveEnt
|
|
{
|
|
DECLARE_TENTBASE();
|
|
ACRX_DECLARE_MEMBERS(TDbApron);
|
|
|
|
private:
|
|
const static Adesk::UInt8 g_nVersion;
|
|
|
|
private:
|
|
double m_dInHeight; // 截面内侧高度
|
|
double m_dOutHeight; // 截面外侧高度
|
|
Array<double> m_aryDist; // 散水各边宽度数组
|
|
|
|
Adesk::UInt32 m_nFlag; // 备用数据
|
|
// sg add 090521,外边界点,不保存,提速及对象捕捉时,使用
|
|
mutable AcDbVoidPtrArray m_entSet;
|
|
|
|
public:
|
|
TDbApron();
|
|
~TDbApron();
|
|
|
|
public: // Set/Get函数
|
|
void SetInHeight(double dHeight);
|
|
double GetInHeight() const;
|
|
|
|
void SetOutHeight(double dHeight);
|
|
double GetOutHeight() const;
|
|
|
|
void SetDistArray(const Array<double> &aryDist);
|
|
void GetDistArray(Array<double> &aryDist) const;
|
|
|
|
public:
|
|
// 统一设置各边宽度,先清空数组,新数组的长度由lLength决定,-1表示使用路径段数
|
|
void SetAllDists(double dDist, long lLength = -1);
|
|
BOOL SetDistAt(long lIndex, double dDist); // lIndex小于0或者大于数组长度,返回FALSE
|
|
double GetDistAt(long lIndex) const; // lIndex小于0或者大于数组长度,返回-1
|
|
|
|
BOOL InsertDistAt(long lIndex, double dDist);
|
|
BOOL RemoveDistAt(long lIndex);
|
|
|
|
int GetDistNum() const; // 获取m_aryDist数组的长度
|
|
|
|
public: // 工程量
|
|
double GetPathLength() const; // 路径长度
|
|
double GetSideArea() const; // 表面积
|
|
double GetVolume() const; // 体积
|
|
double GetShapePerimeter(long lIndex) const; // 指定段截面周长
|
|
double GetShapeArea(long lIndex) const; // 指定段截面面积
|
|
|
|
public: // 注:Z坐标已清0
|
|
void Get2DInPoly(XPoly2D &poly2d) const; // 内侧Poly,即:路径点
|
|
BOOL Get2DOutPoly(XPoly2D &poly2d, Array<int> &aryIndex,
|
|
Array<int> &aryShow) const; // 外侧Poly
|
|
|
|
// 取得二维平面投影区域,只处理normal为(0,0,1)以及路径不封闭的情况,否则返回FALSE
|
|
BOOL Get2DRegion(XPoly2D &poly2d) const;
|
|
BOOL GetShapePoly(long lIndex, XPoly2D &poly) const; // 获取指定段截面Poly,Z坐标未清0
|
|
|
|
public:
|
|
// Overriden function from TDbPolyCurveEnt
|
|
// 向“路径曲线”中添加点,“逆时针”顺序排列
|
|
BOOL AddNewVertex(XPoint ptAdd);
|
|
// add 081016,“布尔并集运算”后,散水变为单线的BUG
|
|
virtual Acad::ErrorStatus SetPathPoly(const XPoly2D &polyPath, const AcGeVector3d&normal);
|
|
|
|
#if ADS>15
|
|
virtual void CreateGrip();
|
|
virtual Acad::ErrorStatus EntityToDim(long iGrip, long iDim,
|
|
const AcDbEntity *pEnt);
|
|
virtual Acad::ErrorStatus DimToEntity(long iGrip, long iDim,
|
|
double newValue, const AcGeVector3d& offset);
|
|
#endif
|
|
|
|
// Overriden function from TEntityBase
|
|
virtual BOOL IsValid() const;
|
|
virtual bool IsClipMe(const TEntityBase* pEnt = NULL) 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 subTransformBy(const AcGeMatrix3d& xform);
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
|
|
AcDbIntArray& osnapModes,
|
|
AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
|
|
const AcGeVector3d& offset);
|
|
// sg add 090521,解决散水对象外侧边界线,对象捕捉问题
|
|
virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
|
|
INT_PTR gsSelectionMark, const AcGePoint3d& pickPoint, const AcGePoint3d& lastPoint,
|
|
const AcGeMatrix3d& viewXform, AcGePoint3dArray& snapPoints,
|
|
AcDbIntArray& geomIds) const;
|
|
|
|
virtual Acad::ErrorStatus getSplitCurves(const AcGeDoubleArray& params,
|
|
AcDbVoidPtrArray& curveSegments) const;
|
|
virtual Acad::ErrorStatus getSplitCurves(const AcGePoint3dArray& points,
|
|
AcDbVoidPtrArray& curveSegments) const;
|
|
|
|
virtual Acad::ErrorStatus getOffsetCurves(double offsetDist,
|
|
AcDbVoidPtrArray& offsetCurves) const;
|
|
#if ADS>14
|
|
virtual Acad::ErrorStatus getOffsetCurvesGivenPlaneNormal(
|
|
const AcGeVector3d& normal, double offsetDist,
|
|
AcDbVoidPtrArray& offsetCurves) const;
|
|
#endif
|
|
|
|
// drived from TDbEntity
|
|
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 bool IsModelEntity() const { return true; }
|
|
virtual int GetFirstVersion() const { return 8; }
|
|
|
|
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet,
|
|
BOOL *bErase); // sg add 081021
|
|
|
|
virtual CString GetXml(const AcGeMatrix3d& mat) const; // cet 2013.3.20 add
|
|
|
|
private:
|
|
// 按照原实体的宽度值,修改新实体,用在类似BREAK操作
|
|
void ModifyAllDistByOld(TDbApron *pNewApron) const;
|
|
};
|
|
|
|
#endif |