Files
envi-code/SourceCode/Code2026/tg_shs/inc/TArch/DbOpeningSlot.h
T

287 lines
9.9 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
/**************************************
门窗套实体定义
必须首先确定门窗套所属墙的内外侧
暂时不支持任意洞、转角窗和弧窗
2026-09-28 15:28:50 +08:00
***************************************/
/****************************************************
2026-10-04 00:04:20 +08:00
门窗套类型: 标准样式、垂直通高、水平通长
窗套线侧类型:墙外侧有、墙内侧有、两侧都有、两侧都没有
檐板窗台类型:没有檐板和窗台、有檐板和窗台、只有檐台、只有窗台
2026-09-28 15:28:50 +08:00
****************************************************/
#ifndef __DBOPENINGSLOT_H
#define __DBOPENINGSLOT_H
//#include "dbentity.h"
#define CMF_SHOWSHAPE 0x01
#define CMF_NO2D 0x02
#define CMF_NO3D 0x04
2026-10-04 00:04:20 +08:00
//檐板、窗台内外侧无
2026-09-28 15:28:50 +08:00
#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:
2026-10-04 00:04:20 +08:00
//门窗套类型:0-标准样式、1-垂直通高、2-水平通长
2026-09-28 15:28:50 +08:00
enum SlotKind { SLOT_STANDARD=0, SLOT_VERHEI=1, SLOT_HORLEN=2,};
2026-10-04 00:04:20 +08:00
//窗套线侧类型:0-墙外侧有、1-墙内侧有、2-两侧都有、3-两侧都没有
2026-09-28 15:28:50 +08:00
enum SlotSide { SIDE_OUT=0, SIDE_IN=1, SIDE_BOTH=2, SIDE_NONE=3,};
2026-10-04 00:04:20 +08:00
//檐板窗台类型:0-没有檐板和窗台、1-有檐板和窗台、2-只有檐台、3-只有窗台
2026-09-28 15:28:50 +08:00
enum BoardKind { BS_NONE=0, BS_BOTH=1, BS_BOARD=2, BS_SILL=3,};
protected:
2026-10-04 00:04:20 +08:00
//截面形状必须是平面,位置可任意,以右下角为基点
2026-09-28 15:28:50 +08:00
XPoly2D m_polyShape;
2026-10-04 00:04:20 +08:00
AcDbSoftPointerId m_idOpening; //门窗套所在门窗
2026-09-28 15:28:50 +08:00
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;
2026-10-04 00:04:20 +08:00
//檐板窗台内外侧无
2026-09-28 15:28:50 +08:00
Adesk::UInt16 m_nBSSideFlag;
2026-10-04 00:04:20 +08:00
Adesk::UInt16 m_nCMFlag;//二维、三维和断面
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
AcDbHardPointerId m_idLayerBoard3d, m_idLayerSill3d; //檐板和窗台
2026-09-28 15:28:50 +08:00
public:
TDbOpeningSlot();
~TDbOpeningSlot();
public:
// SetMethod
2026-10-04 00:04:20 +08:00
// 门窗套线所属的门窗Id
2026-09-28 15:28:50 +08:00
void SetOpeningId(const AcDbObjectId idOpening);
2026-10-04 00:04:20 +08:00
//**************************窗套线*******************************
// 判断是否有窗套线
2026-09-28 15:28:50 +08:00
void SetHasSlot(BOOL bHas);
2026-10-04 00:04:20 +08:00
// 窗套线截面形状XPoly2D(平面)
2026-09-28 15:28:50 +08:00
void SetShapePoly(const XPoly2D &polyShape);
2026-10-04 00:04:20 +08:00
//门窗套类型:TDbOpeningSlot::SLOT_STANDARD-标准样式;
// TDbOpeningSlot::SLOT_VERHEI -垂直通高;
// TDbOpeningSlot::SLOT_HORLEN -水平通长;
2026-09-28 15:28:50 +08:00
void SetSlotKind(const SlotKind enumSlotKind) {
m_enumSlotKind = enumSlotKind;
};
2026-10-04 00:04:20 +08:00
//窗套线侧类型:TDbOpeningSlot::SIDE_OUT -墙外侧有;
// TDbOpeningSlot::SIDE_IN -墙内侧有;
// TDbOpeningSlot::SIDE_BOTH-两侧都有;
// TDbOpeningSlot::SIDE_NONE-两侧都没有
2026-09-28 15:28:50 +08:00
void SetSlotSide(const SlotSide enumSlotSide) {
m_enumSlotSide = enumSlotSide;
};
2026-10-04 00:04:20 +08:00
//当门窗套类型是垂直通高和水平通长时候的檐板宽度
2026-09-28 15:28:50 +08:00
void SetSlotBoardWid(const ads_real dWidth);
2026-10-04 00:04:20 +08:00
// 门窗套的内侧截面高度W1
2026-09-28 15:28:50 +08:00
void SetInsideSlotW(const ads_real dInsideSlotW);
2026-10-04 00:04:20 +08:00
// 门窗套的外侧截面高度W2
2026-09-28 15:28:50 +08:00
void SetOutsideSlotW(const ads_real dOutsideSlotW);
2026-10-04 00:04:20 +08:00
// 门窗套的A(截面宽度)和T参数
2026-09-28 15:28:50 +08:00
void SetSlotAT(const ads_real dSlotA,const ads_real dSlotT);
2026-10-04 00:04:20 +08:00
//**********************檐板和窗台*******************************
// 窗台的参数A()、H(厚度)、W(外挑长度)
2026-09-28 15:28:50 +08:00
void SetBoardSize(const ads_real dBoardA,const ads_real dBoardH,
const ads_real dBoardW);
2026-10-04 00:04:20 +08:00
// 窗台的参数A()、H(厚度)、W(外挑长度)
2026-09-28 15:28:50 +08:00
void SetSillSize(const ads_real dSillA,const ads_real dSillH,
const ads_real dSillW);
2026-10-04 00:04:20 +08:00
//檐板窗台类型:TDbOpeningSlot::BS_NONE -没有檐板和窗台;
// TDbOpeningSlot::BS_BOTH -有檐板和窗台;
// TDbOpeningSlot::BS_SILL -只有檐台;
// TDbOpeningSlot::BS_BOARD-只有窗台
2026-09-28 15:28:50 +08:00
void SetBoardKind(const BoardKind enumBoardKind){
m_enumBoardKind = enumBoardKind;
};
2026-10-04 00:04:20 +08:00
// 檐板哪一侧有(内外)
2026-09-28 15:28:50 +08:00
void SetBoardSide(BOOL bInside = TRUE, BOOL bOutside = TRUE);
2026-10-04 00:04:20 +08:00
// 窗台哪一侧有(内外)
2026-09-28 15:28:50 +08:00
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
2026-10-04 00:04:20 +08:00
// 判断是否有窗套线
2026-09-28 15:28:50 +08:00
BOOL HasSlot() const;
2026-10-04 00:04:20 +08:00
// 门窗套线所属的门窗Id
2026-09-28 15:28:50 +08:00
AcDbObjectId GetOpeningId() const;
2026-10-04 00:04:20 +08:00
// 窗套线截面形状XPoly2D
2026-09-28 15:28:50 +08:00
const XPoly2D & GetShapePoly() const;
2026-10-04 00:04:20 +08:00
//门窗套类型:TDbOpeningSlot::SLOT_STANDARD-标准样式;
// TDbOpeningSlot::SLOT_VERHEI -垂直通高;
// TDbOpeningSlot::SLOT_HORLEN -水平通长;
2026-09-28 15:28:50 +08:00
SlotKind GetSlotKind() const;
2026-10-04 00:04:20 +08:00
//窗套线侧类型:TDbOpeningSlot::SIDE_OUT -墙外侧有;
// TDbOpeningSlot::SIDE_IN -墙内侧有;
// TDbOpeningSlot::SIDE_BOTH-两侧都有;
// TDbOpeningSlot::SIDE_NONE-两侧都没有
2026-09-28 15:28:50 +08:00
SlotSide GetSlotSide() const;
2026-10-04 00:04:20 +08:00
//檐板窗台类型:TDbOpeningSlot::BS_NONE -没有檐板和窗台;
// TDbOpeningSlot::BS_BOTH -有檐板和窗台;
// TDbOpeningSlot::BS_SILL -只有檐台;
// TDbOpeningSlot::BS_BOARD-只有窗台
2026-09-28 15:28:50 +08:00
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;
}
2026-10-04 00:04:20 +08:00
//檐板窗台截面
2026-09-28 15:28:50 +08:00
XPoly2D GetBoardShape() const;
XPoly2D GetSillShape() const;
XPoly2D GetSlotTShape() const;
public:
2026-10-04 00:04:20 +08:00
// 1--- 显示属性(二维、三维和截面显示)
// 2--- 门窗套类型(标准...)
// 3--- 参数
2026-09-28 15:28:50 +08:00
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;
2026-10-04 00:04:20 +08:00
// derived from AcDbObject, Reactor函数
2026-09-28 15:28:50 +08:00
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;
2026-10-04 00:04:20 +08:00
virtual void GetTips(DList<TObjInfoUnit> &) const; //取动态属性显示数据
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
//可改变截面形状(夹点操作)
2026-09-28 15:28:50 +08:00
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:
2026-10-04 00:04:20 +08:00
//普通窗(也可普通门、字母门、凸窗、矩形洞)
2026-09-28 15:28:50 +08:00
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,
2026-10-04 00:04:20 +08:00
XPoly2D& polyBoardSlotT) const;//门联窗
2026-09-28 15:28:50 +08:00
Acad::ErrorStatus Draw3D(XExplodeDraw &dc,
2026-10-04 00:04:20 +08:00
const DList<XPoly2D>& lstSlot,//窗套线路径
2026-09-28 15:28:50 +08:00
const DList<XPoly2D>& lstSlotT,
2026-10-04 00:04:20 +08:00
const XPoly2D& polyBoard,//檐板路径
2026-09-28 15:28:50 +08:00
const XPoly2D& polyBoardT,
2026-10-04 00:04:20 +08:00
const XPoly2D& polySill,//窗台路径
2026-09-28 15:28:50 +08:00
const XPoly2D& polySillT,
2026-10-04 00:04:20 +08:00
const XPoly2D& polyBoardSlot,//窗套线檐板路径
2026-09-28 15:28:50 +08:00
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