Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

120 lines
3.2 KiB
C++

#pragma once
#include "KTModelLayoutXData.h"
#include "entityfilter.h"
#include "AcGiViewDraw.h"
#ifdef EARTHWORM_EXPORT
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP __declspec(dllimport)
#endif
#define DEF_VALUE_FUNC(func, name, type)\
static BOOL getHlr##func##_##name(type &dW);\
static void setHlr##func##_##name(const type &dW);\
static void removeHlr##func##_##name()
#define DEF_CHECK_FUNC(func, name)\
static BOOL getHlr##func##_##name();\
static void setHlr##func##_##name(const BOOL &b);\
class DLLIMPEXP HlrCutOption
{
public:
template <class T>
static const AcDbVoidPtrArray* get3dBuffer(const AcDbEntity *pEnt)
{
T *pT = CEntityProperty::getThisClass<T>(pEnt);
if (pT)
{
if (!pT->Has3DBuffer())
{
AcGiViewDraw dc;
pT->Draw3d(dc);
}
return &pT->Get3DBuffer();
}
return NULL;
}
public:
static int init();
DEF_VALUE_FUNC(LW, Wall, double);
DEF_VALUE_FUNC(LW, Slab, double);
DEF_VALUE_FUNC(LW, Beam, double);
DEF_VALUE_FUNC(LW, Column, double);
DEF_VALUE_FUNC(LW, EnvCut, double);
// 2025.10.29 管道+配件+阀门 变为统一线宽
DEF_VALUE_FUNC(LW, PipeSys, double);
DEF_VALUE_FUNC(LW, HvacSys, double);
DEF_VALUE_FUNC(LW, ElecSys, double);
DEF_CHECK_FUNC(BLK, OPEN);
DEF_CHECK_FUNC(BLK, FITTING);
DEF_CHECK_FUNC(BLK, EQU);
DEF_CHECK_FUNC(BLK, PARAEQU);
DEF_CHECK_FUNC(BLK, YGDT);
DEF_CHECK_FUNC(BLK, STAIR);
DEF_CHECK_FUNC(STYLE2D, VALVE);
DEF_CHECK_FUNC(STYLE2D, OPEN);
DEF_CHECK_FUNC(STYLE2D, HOLE);
DEF_CHECK_FUNC(MERGE, Wall);
DEF_CHECK_FUNC(MERGE, Beam);
DEF_CHECK_FUNC(MERGE, Slab);
DEF_CHECK_FUNC(MERGE, Column);
DEF_CHECK_FUNC(ZX, SameDir);
DEF_CHECK_FUNC(ZX, Parallel);
DEF_VALUE_FUNC(LW, Envelope, double);
DEF_VALUE_FUNC(LY, Envelope, AcDbObjectId);
DEF_VALUE_FUNC(LT, Envelope, AcDbObjectId);
DEF_VALUE_FUNC(CL, Envelope, int);
static bool getHlrMERGE_Envelope();
static bool isEnvelopeEntity(LPCTSTR dxf);
static resbuf* getEnvelopeFilter();
static void ProcessHlrResult(const AcDbEntity *pEnt
, const BOOL &bBlod
, const double &dW
, const BOOL &bBlock
, const AcArray<AcDbEntity *> &ar
, const std::map<AcDbEntity *, AcArray<AcDbEntity *>> &preAr
, AcArray<AcDbEntity *> &output
, const AecDbObjXDataMap *pXData = NULL);
static AcDbEntity* makeBlock(const AcDbEntity *pEnt
, const AcArray<AcDbEntity*> &output
, const AecDbObjXDataMap *pXData = NULL );
// 当时水平剖切时,剖切范围除了有水平的范围之外,还有垂直范围
// 水平范围可以通过选择集自动处理,但是垂直范围,需要单独的判读
// 下面两个函数可以判断
static bool isWithinHorizSection(const AcDbEntity *pEnt
,const AcGePoint3d &ptPlnO
, const AcGeVector3d &vtPlnN);
static bool isWithinHorizSection(const double &dMax
, const double &dMin
, const AcGePoint3d &ptPlnO
, const AcGeVector3d &vtPlnN);
static BOOL isHlrCalc(const AcDbEntity *pEnt);
static void setHlrCalc(const AcDbEntity *pEnt, const BOOL &bValue);
static bool isIntersectWithSection(const AcDbEntity *pEnt);
static void setIntersectWithSection(const AcDbEntity *pEnt, const AcGePlane &plnSection);
static BOOL getEnvCutLW(const AcDbEntity *pEnt, double &dW);
};