288 lines
9.2 KiB
C++
288 lines
9.2 KiB
C++
/**************************************
|
||
门窗套实体定义
|
||
必须首先确定门窗套所属墙的内外侧
|
||
暂时不支持任意洞、转角窗和弧窗
|
||
***************************************/
|
||
/****************************************************
|
||
|
||
门窗套类型: 标准样式、垂直通高、水平通长
|
||
窗套线侧类型:墙外侧有、墙内侧有、两侧都有、两侧都没有
|
||
檐板窗台类型:没有檐板和窗台、有檐板和窗台、只有檐台、只有窗台
|
||
|
||
****************************************************/
|
||
#ifndef __DBOPENINGSLOT_H
|
||
#define __DBOPENINGSLOT_H
|
||
|
||
//#include "dbentity.h"
|
||
|
||
#define CMF_SHOWSHAPE 0x01
|
||
#define CMF_NO2D 0x02
|
||
#define CMF_NO3D 0x04
|
||
|
||
//檐板、窗台内外侧无
|
||
#define SIDE_NOBI 0x01
|
||
#define SIDE_NOBO 0x02
|
||
#define SIDE_NOSI 0x04
|
||
#define SIDE_NOSO 0x08
|
||
|
||
|
||
class TARCH_EXP TDbOpeningSlot:public TDbEntity {
|
||
DECLARE_TENTBASE();
|
||
ACRX_DECLARE_MEMBERS(TDbOpeningSlot);
|
||
public:
|
||
//门窗套类型:0-标准样式、1-垂直通高、2-水平通长
|
||
enum SlotKind { SLOT_STANDARD=0, SLOT_VERHEI=1, SLOT_HORLEN=2,};
|
||
|
||
//窗套线侧类型:0-墙外侧有、1-墙内侧有、2-两侧都有、3-两侧都没有
|
||
enum SlotSide { SIDE_OUT=0, SIDE_IN=1, SIDE_BOTH=2, SIDE_NONE=3,};
|
||
|
||
//檐板窗台类型:0-没有檐板和窗台、1-有檐板和窗台、2-只有檐台、3-只有窗台
|
||
enum BoardKind { BS_NONE=0, BS_BOTH=1, BS_BOARD=2, BS_SILL=3,};
|
||
protected:
|
||
//截面形状必须是平面,位置可任意,以右下角为基点
|
||
XPoly2D m_polyShape;
|
||
AcDbSoftPointerId m_idOpening; //门窗套所在门窗
|
||
|
||
SlotKind m_enumSlotKind;
|
||
SlotSide m_enumSlotSide;
|
||
BoardKind m_enumBoardKind;
|
||
BOOL m_bHasSlot;
|
||
|
||
ads_real m_dInsideSlotW,m_dOutsideSlotW;
|
||
ads_real m_dSlotA,m_dSlotT;
|
||
ads_real m_dSlotBoardWid;
|
||
|
||
ads_real m_dBoardA,m_dBoardH,m_dBoardW;
|
||
ads_real m_dSillA,m_dSillH,m_dSillW;
|
||
|
||
//檐板窗台内外侧无
|
||
Adesk::UInt16 m_nBSSideFlag;
|
||
Adesk::UInt16 m_nCMFlag;//二维、三维和断面
|
||
|
||
AcDbHardPointerId m_idLayerBoard3d, m_idLayerSill3d; //檐板和窗台
|
||
|
||
public:
|
||
TDbOpeningSlot();
|
||
~TDbOpeningSlot();
|
||
public:
|
||
// SetMethod
|
||
// 门窗套线所属的门窗Id
|
||
void SetOpeningId(const AcDbObjectId idOpening);
|
||
|
||
//**************************窗套线*******************************
|
||
// 判断是否有窗套线
|
||
void SetHasSlot(BOOL bHas);
|
||
|
||
// 窗套线截面形状XPoly2D(平面)
|
||
void SetShapePoly(const XPoly2D &polyShape);
|
||
|
||
//门窗套类型:TDbOpeningSlot::SLOT_STANDARD-标准样式;
|
||
// TDbOpeningSlot::SLOT_VERHEI -垂直通高;
|
||
// TDbOpeningSlot::SLOT_HORLEN -水平通长;
|
||
void SetSlotKind(const SlotKind enumSlotKind) {
|
||
m_enumSlotKind = enumSlotKind;
|
||
};
|
||
|
||
//窗套线侧类型:TDbOpeningSlot::SIDE_OUT -墙外侧有;
|
||
// TDbOpeningSlot::SIDE_IN -墙内侧有;
|
||
// TDbOpeningSlot::SIDE_BOTH-两侧都有;
|
||
// TDbOpeningSlot::SIDE_NONE-两侧都没有
|
||
void SetSlotSide(const SlotSide enumSlotSide) {
|
||
m_enumSlotSide = enumSlotSide;
|
||
};
|
||
|
||
//当门窗套类型是垂直通高和水平通长时候的檐板宽度
|
||
void SetSlotBoardWid(const ads_real dWidth);
|
||
|
||
// 门窗套的内侧截面高度W1
|
||
void SetInsideSlotW(const ads_real dInsideSlotW);
|
||
|
||
// 门窗套的外侧截面高度W2
|
||
void SetOutsideSlotW(const ads_real dOutsideSlotW);
|
||
|
||
// 门窗套的A(截面宽度)和T参数
|
||
void SetSlotAT(const ads_real dSlotA,const ads_real dSlotT);
|
||
|
||
//**********************檐板和窗台*******************************
|
||
// 窗台的参数A()、H(厚度)、W(外挑长度)
|
||
void SetBoardSize(const ads_real dBoardA,const ads_real dBoardH,
|
||
const ads_real dBoardW);
|
||
|
||
// 窗台的参数A()、H(厚度)、W(外挑长度)
|
||
void SetSillSize(const ads_real dSillA,const ads_real dSillH,
|
||
const ads_real dSillW);
|
||
|
||
//檐板窗台类型:TDbOpeningSlot::BS_NONE -没有檐板和窗台;
|
||
// TDbOpeningSlot::BS_BOTH -有檐板和窗台;
|
||
// TDbOpeningSlot::BS_SILL -只有檐台;
|
||
// TDbOpeningSlot::BS_BOARD-只有窗台
|
||
void SetBoardKind(const BoardKind enumBoardKind){
|
||
m_enumBoardKind = enumBoardKind;
|
||
};
|
||
|
||
// 檐板哪一侧有(内外)
|
||
void SetBoardSide(BOOL bInside = TRUE, BOOL bOutside = TRUE);
|
||
// 窗台哪一侧有(内外)
|
||
void SetSillSide( BOOL bInside = TRUE, BOOL bOutside = TRUE);
|
||
void SetLayerBoard3d(AcDbObjectId id) {
|
||
assertWriteEnabled();
|
||
m_idLayerBoard3d=id;
|
||
}
|
||
void SetLayerSill3d(AcDbObjectId id) {
|
||
assertWriteEnabled();
|
||
m_idLayerSill3d=id;
|
||
}
|
||
|
||
//GetMethos
|
||
// 判断是否有窗套线
|
||
BOOL HasSlot() const;
|
||
|
||
// 门窗套线所属的门窗Id
|
||
AcDbObjectId GetOpeningId() const;
|
||
|
||
// 窗套线截面形状XPoly2D
|
||
const XPoly2D & GetShapePoly() const;
|
||
|
||
//门窗套类型:TDbOpeningSlot::SLOT_STANDARD-标准样式;
|
||
// TDbOpeningSlot::SLOT_VERHEI -垂直通高;
|
||
// TDbOpeningSlot::SLOT_HORLEN -水平通长;
|
||
SlotKind GetSlotKind() const;
|
||
|
||
//窗套线侧类型:TDbOpeningSlot::SIDE_OUT -墙外侧有;
|
||
// TDbOpeningSlot::SIDE_IN -墙内侧有;
|
||
// TDbOpeningSlot::SIDE_BOTH-两侧都有;
|
||
// TDbOpeningSlot::SIDE_NONE-两侧都没有
|
||
SlotSide GetSlotSide() const;
|
||
|
||
//檐板窗台类型:TDbOpeningSlot::BS_NONE -没有檐板和窗台;
|
||
// TDbOpeningSlot::BS_BOTH -有檐板和窗台;
|
||
// TDbOpeningSlot::BS_SILL -只有檐台;
|
||
// TDbOpeningSlot::BS_BOARD-只有窗台
|
||
BoardKind GetBoardKind() const;
|
||
|
||
void GetSlotAT(ads_real& dSlotA,ads_real& dSlotT) const;
|
||
ads_real GetSlotBoardWid() const;
|
||
|
||
ads_real GetInsideSlotW() const;
|
||
ads_real GetOutsideSlotW() const;
|
||
|
||
void GetBoardSize(ads_real& dBoardA,ads_real& dBoardH,ads_real& dBoardW) const;
|
||
void GetSillSize(ads_real& dSillA,ads_real& dSillH,ads_real& dSillW) const;
|
||
|
||
void GetBoardSide(BOOL &bInside, BOOL &bOutside) const;
|
||
void GetSillSide(BOOL &bInside, BOOL &bOutside) const;
|
||
AcDbObjectId GetLayerBoard3d() const {
|
||
return m_idLayerBoard3d;
|
||
}
|
||
AcDbObjectId GetLayerSill3d() const {
|
||
return m_idLayerSill3d;
|
||
}
|
||
|
||
//檐板窗台截面
|
||
XPoly2D GetBoardShape() const;
|
||
XPoly2D GetSillShape() const;
|
||
XPoly2D GetSlotTShape() const;
|
||
|
||
public:
|
||
// 1--- 显示属性(二维、三维和截面显示)
|
||
// 2--- 门窗套类型(标准...)
|
||
// 3--- 参数
|
||
virtual void CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag);
|
||
|
||
// Overriden function from AcDbEntity
|
||
Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
||
Acad::ErrorStatus subGetOsnapPoints(
|
||
AcDb::OsnapMode osnapMode,
|
||
INT_PTR gsSelectionMark,
|
||
const AcGePoint3d& ptPick,
|
||
const AcGePoint3d& lastPoint,
|
||
const AcGeMatrix3d& viewXform,
|
||
AcGePoint3dArray& snapPoints,
|
||
AcDbIntArray& geomIds) const;
|
||
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
||
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
||
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
|
||
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
||
// derived from AcDbObject, Reactor函数
|
||
virtual void erased(const AcDbObject* pDbObj, Adesk::Boolean erasing = Adesk::kTrue);
|
||
virtual void modified(const AcDbObject* pDbObj);
|
||
|
||
// drived from TEntityBase
|
||
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 subGetGripPoints(
|
||
AcGePoint3dArray& gripPoints,
|
||
AcDbIntArray& osnapModes,
|
||
AcDbIntArray& geomIds) const;
|
||
virtual Acad::ErrorStatus subMoveGripPointsAt(
|
||
const AcDbIntArray& indices,
|
||
const AcGeVector3d& offset);
|
||
virtual Acad::ErrorStatus GetGripText(int i, CString &cs) const;
|
||
virtual int GetFirstVersion()const{return 6;}//ok
|
||
|
||
public:
|
||
virtual BOOL IsValid() const;
|
||
|
||
void ShowShape(BOOL bFlag);
|
||
void SetHas2D(BOOL bFlag);
|
||
void SetHas3D(BOOL bFlag);
|
||
|
||
BOOL IsShapeShow() const;
|
||
BOOL Has2D() const;
|
||
BOOL Has3D() const;
|
||
|
||
protected:
|
||
Acad::ErrorStatus DrawShape(const XPoint &ptBase,XExplodeDraw &dc) const;
|
||
|
||
private:
|
||
//普通窗(也可普通门、字母门、凸窗、矩形洞)
|
||
void GetWinSlotUints(const BOOL bHasSlot,
|
||
const BOOL bNoLow,
|
||
const BoardKind enumBoardKind,
|
||
const XPoly2D& polySlotPlane,
|
||
const double dSlotW,
|
||
DList<XPoly2D>& lstSlot,
|
||
XPoly2D& polyBoard,
|
||
XPoly2D& polyBoardT,
|
||
XPoly2D& polySill,
|
||
XPoly2D& polySillT,
|
||
XPoly2D& polyBoardSlot,
|
||
XPoly2D& polyBoardSlotT) const;
|
||
void GetDoorWinSlotUints(const BOOL bHasSlot,
|
||
const BOOL bNoLow,
|
||
const BoardKind enumBoardKind,
|
||
const XPoly2D& polySlotPlane,
|
||
const double dSlotW,
|
||
DList<XPoly2D>& lstSlot,
|
||
DList<XPoly2D>& lstSlotT,
|
||
XPoly2D& polyBoard,
|
||
XPoly2D& polyBoardT,
|
||
XPoly2D& polySill,
|
||
XPoly2D& polySillT,
|
||
XPoly2D& polyBoardSlot,
|
||
XPoly2D& polyBoardSlotT) const;//门联窗
|
||
Acad::ErrorStatus Draw3D(XExplodeDraw &dc,
|
||
const DList<XPoly2D>& lstSlot,//窗套线路径
|
||
const DList<XPoly2D>& lstSlotT,
|
||
const XPoly2D& polyBoard,//檐板路径
|
||
const XPoly2D& polyBoardT,
|
||
const XPoly2D& polySill,//窗台路径
|
||
const XPoly2D& polySillT,
|
||
const XPoly2D& polyBoardSlot,//窗套线檐板路径
|
||
const XPoly2D& polyBoardSlotT,
|
||
const XPoly2D& polyShapeT,
|
||
const XVector3D& vtNormal,
|
||
const BOOL bOutside=TRUE,
|
||
const BOOL bLeftExt=TRUE,
|
||
const BOOL bQuadrant=FALSE) const;
|
||
|
||
private:
|
||
const static Adesk::UInt8 g_nVersion;
|
||
};
|
||
|
||
#endif
|