205 lines
6.9 KiB
C++
205 lines
6.9 KiB
C++
#ifndef __DBAUTOSTAIR_H
|
||
#define __DBAUTOSTAIR_H
|
||
#include "DbPolyPathEnt.h"
|
||
#include "dbStair.h"
|
||
|
||
// 楼梯的标志
|
||
class TDbSymbArrow;
|
||
#define SFEX_SINGLESTAIR 0x10000 //单排,TdbAutoStair
|
||
#define SFEX_CROSSSTAIR 0x100000 //交叉放置,TdbAutoStair
|
||
#define SFEX_HASHOLE 0x40000 //顶层单梯或双梯并列开洞,TdbAutoStair
|
||
#define SFEX_SAMEDIR 0x80000 //上下梯段同向运行,TdbAutoStair
|
||
|
||
//双梯时起步侧
|
||
#define OFFSET_LEFT 0 //左边
|
||
#define OFFSET_RIGHT 1 //右边
|
||
|
||
// 自动扶梯
|
||
class TARCH_EXP TDbAutoStair: public TDbPolyPathEnt { //为支持栏杆的绊定
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbAutoStair);
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
protected:
|
||
double m_nStepHeight; //踏步高
|
||
double m_nStepWidth; //踏步宽
|
||
double m_nStairWidth; //梯段宽
|
||
double m_nSlabSize; //平台宽
|
||
XPoint m_ptLocation; //位置
|
||
double m_nRotation; //旋转角度
|
||
//Adesk::UInt8 m_nStepNum; //梯段步数
|
||
double m_nRailHeight; //扶手高度
|
||
double m_nRailWidth; //扶手宽度
|
||
double m_lSectPos; //左侧剖切位置
|
||
double m_rSectPos; //右侧剖切位置
|
||
double m_nStepDist; //平步伸出距离
|
||
Adesk::UInt8 m_nStairFlag; //楼层标记: 0--首层, 1--中间层, 2--顶层
|
||
double m_dFloorHeight; //楼层高
|
||
double m_dSlopeAngle; //坡角(角度值)(扶梯:30,35;坡道:0,10~12)
|
||
double m_dTextHeight; //字高
|
||
double m_dSlopeLength; //坡长
|
||
double m_dSpaceWidth; //双梯间距
|
||
Adesk::UInt8 m_nStartSide; //双梯起步的一侧
|
||
double m_dHoleLength; //洞口长度
|
||
|
||
Adesk::UInt32 m_nFlagEx;
|
||
double m_nSlabThick; //板厚或梁厚
|
||
|
||
AcDbHardPointerId m_idLayerStep3d;
|
||
AcDbHardPointerId m_idLayerText,m_idLayerArrow,m_idTextStyle;
|
||
|
||
Adesk::UInt8 m_nViewCtrl; //视图控制:0-自动(由楼层决定);1-禁止3D;2-禁止2D
|
||
public:
|
||
TDbAutoStair();
|
||
~TDbAutoStair();
|
||
int GetSectStairPos()const;
|
||
virtual BOOL IsValid() const;
|
||
virtual bool IsModelEntity() const{return true;}
|
||
virtual bool IsClipMe(const TEntityBase* pEnt=NULL)const;//ok
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
virtual Acad::ErrorStatus DownGradeSave(int nDrawMode, AcDbVoidPtrArray &entSet, BOOL *bErase);
|
||
// 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 Acad::ErrorStatus ExplodeOrDraw3d(XExplodeDraw &dc) const;
|
||
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
||
virtual const TCHAR *GetDefaultLayer() const;
|
||
virtual void GetTips(DList<TObjInfoUnit> &) const; //取动态属性显示数据
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual int GetFirstVersion()const{return 8;}
|
||
|
||
Acad::ErrorStatus ExplodeTo(TDbLineStair &stair1, TDbLineStair &stair2) const;
|
||
|
||
//扶手线
|
||
void DrawRailLine(XPoint ptS,XPoint ptE,double rot,double dWidth,XExplodeDraw &dc)const;
|
||
//内侧垫板线
|
||
void DrawInSlabLine(XPoint ptS,XPoint ptE,double rot,double dWidth,XExplodeDraw &dc)const;
|
||
//外侧垫板线
|
||
void DrawOutSlabLine(XPoint ptS,XPoint ptE,double rot,double dWidth,BOOL bConnect,XExplodeDraw &dc)const;
|
||
XDirectionCurve GetSideCurve2d(int nSide) const;
|
||
BOOL GetSectionPoly(double lSectionPos,double rSectionPos,int nSide,XPoly &polyDown, XPoly &polyUp, XPoly &polyMid) const;
|
||
|
||
//add by xlc on 090426 箭头文字,动态数据
|
||
CString GetTextUp() const;
|
||
void SetTextUp(const TCHAR *sVal);
|
||
CString GetTextDown() const;
|
||
void SetTextDown(const TCHAR *sVal);
|
||
|
||
// Attribute Access method
|
||
double GetLength()const;
|
||
double GetTotalLength()const{return GetLength()+m_nSlabSize*2;};
|
||
double GetTotalWidth()const
|
||
{
|
||
double dWidth=_AS_SYS_UNIT(205.5);
|
||
if(IsSingleStair())
|
||
{
|
||
return m_nStairWidth+dWidth*8/3;
|
||
}
|
||
else
|
||
{
|
||
return m_dSpaceWidth+m_nStairWidth*2+dWidth*16/3;
|
||
}
|
||
}
|
||
double GetHoleLength()const;
|
||
void SetHoleLength(double l);
|
||
double GetLSectPos()const;
|
||
double GetRSectPos()const;
|
||
void SetLSectPos(double l);
|
||
void SetRSectPos(double l);
|
||
double GetStepHeight() const;
|
||
Adesk::UInt8 GetStairFlag() const;
|
||
double GetSlabSize() const;
|
||
void SetSlabSize(double s);
|
||
double GetFloorHeight()const;
|
||
void SetFloorHeight(double h);
|
||
double GetSlopeAngle()const;
|
||
void SetSlopeAngle(double a);
|
||
double GetSlopeLength()const;
|
||
void SetSlopeLength(double l);
|
||
double GetTextHeight()const;
|
||
void SetTextHeight(double h);
|
||
double GetRailHeight() const;
|
||
double GetRailWidth() const;
|
||
double GetStepDist() const;
|
||
double GetSpaceWidth() const;
|
||
double GetStepWidth() const;
|
||
double GetStairWidth() const;
|
||
double GetElevation() const;
|
||
XPoint GetLocation() const;
|
||
XPoint GetUpRight2d() const;
|
||
XPoint GetUpLeft2d() const;
|
||
double GetRotation() const;
|
||
int GetStartSide() const;
|
||
void SetStartSide(int nSide);
|
||
void SetStepDist(double w);
|
||
void SetRailHeight(double l);
|
||
void SetRailWidth(double w);
|
||
void SetSpaceWidth(double w);
|
||
void SetStepWidth(double w);
|
||
void SetStairWidth(double w);
|
||
void SetElevation(double elev);
|
||
void SetLocation(const XPoint &pt);
|
||
void SetRotation(double rot);
|
||
void SetStepHeight(double h);
|
||
void SetStairFlag(Adesk::UInt8 flag);
|
||
|
||
void SetArrow(BOOL bTrue);
|
||
BOOL IsArrow() const; //是否显示箭头
|
||
|
||
BOOL IsHasHole()const;
|
||
void SetHasHole(BOOL bTrue);
|
||
BOOL IsCross()const;
|
||
void SetCross(BOOL bTrue);
|
||
BOOL IsSameDir()const;
|
||
void SetSameDir(BOOL bTrue);
|
||
BOOL IsSingleStair()const;
|
||
void SetSingleStair(BOOL bTrue);
|
||
|
||
BOOL IsAscent() const;
|
||
BOOL IsOnGround() const;
|
||
BOOL HasSlant() const;
|
||
double GetSlabThick() const;
|
||
AcDbObjectId GetLayerStep3d() const;
|
||
AcDbObjectId GetLayerText() const;
|
||
AcDbObjectId GetTextStyle() const;
|
||
AcDbObjectId GetLayerArrow() const;
|
||
//上楼箭头
|
||
void GetDefaultArrow(TDbSymbArrow*pArrowUp,TDbSymbArrow*pArrowUp2,
|
||
TDbSymbArrow*pArrowDown,TDbSymbArrow*pArrowDown2)const;
|
||
|
||
Adesk::UInt8 GetViewCtrl() const {
|
||
return m_nViewCtrl;
|
||
}
|
||
void SetViewCtrl(Adesk::UInt8 nCtrl) {
|
||
assertWriteEnabled();
|
||
m_nViewCtrl=nCtrl;
|
||
}
|
||
|
||
void SetAscent(BOOL bTrue);
|
||
void SetOnGround(BOOL bTrue);
|
||
void SetSlant(BOOL bTrue);
|
||
void SetSlabThick(double val);
|
||
void SetLayerStep3d(AcDbObjectId idLayer);
|
||
void SetLayerText(AcDbObjectId idLayer);
|
||
void SetTextStyle(AcDbObjectId idStyle);
|
||
void SetLayerArrow(AcDbObjectId idLayer);
|
||
};
|
||
|
||
#endif
|