2026-10-04 00:04:20 +08:00
|
|
|
#pragma once
|
2026-09-28 15:28:50 +08:00
|
|
|
#include "EntitySet.h"
|
|
|
|
|
|
|
|
|
|
class XBlock
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
XBlock();
|
|
|
|
|
|
|
|
|
|
XBlock(Entity entBlk);
|
|
|
|
|
virtual ~XBlock();
|
|
|
|
|
BOOL m_bInitSuccess;
|
|
|
|
|
BOOL IsBlockExist(const TCHAR* szBlkName, BOOL bLoadIt = FALSE);
|
|
|
|
|
const TCHAR* GetBlkName(){return m_szBlkName;};
|
|
|
|
|
AcDbBlockReference *GetBlockReference(){return m_pBlkRef;};
|
|
|
|
|
AcDbBlockTable *GetBlockTable(){return m_pBlockTable;};
|
|
|
|
|
AcDbBlockTableRecord *GetBlockTableRecord(){return m_pRecord;};
|
|
|
|
|
AcDbBlockTableRecordIterator *GetIterator(){return m_pIterator;};
|
|
|
|
|
AcGeMatrix3d GetMatrix3d(){return m_matrix;};
|
|
|
|
|
AcDbObjectId GetBlkId(){return m_eId;};
|
|
|
|
|
double GetEntBlkLength();
|
|
|
|
|
double GetEntBlkHeight();
|
|
|
|
|
void TransformBy(const AcGeMatrix3d& xform);
|
|
|
|
|
void GetBlkExtents(AcGePoint3d &pMax, AcGePoint3d &pMin);
|
|
|
|
|
void GetBlkBreakPt(Entity entBreak, double nBreLen, XPoint &ptBr1, XPoint &ptBr2);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
BOOL InitBlock();
|
|
|
|
|
void GetBlkBreakByLine(XLine l, double nBreLen, XPoint &ptBr1, XPoint &ptBr2);
|
|
|
|
|
void GetBlkBreakByArc(XArc xarc, double nBreLen, XPoint &ptBr1, XPoint &ptBr2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AcDbBlockReference *m_pBlkRef;
|
|
|
|
|
AcDbBlockTable* m_pBlockTable;
|
|
|
|
|
AcDbBlockTableRecord *m_pRecord;
|
|
|
|
|
AcDbBlockTableRecordIterator *m_pIterator;
|
|
|
|
|
|
|
|
|
|
AcDbObjectId m_eId;
|
|
|
|
|
AcGeMatrix3d m_matrix;
|
|
|
|
|
Entity m_entBlk;
|
|
|
|
|
TCHAR m_szBlkName[256];
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|