perf: AcDbX3dSolid 几何改为懒重建

- 新增 m_bNeedCreate 标志与 EnsureCreated():dwgInFields 与拷贝构造
  不再立即 ReCreate,延迟到首次访问几何时重建
- 开图时不再对每个单元逐个走 SAT 临时文件(acisOut/acisIn),
  显著降低开图耗时;Clone 也省掉一次重建
- 所有读取 m_pSolid/m_pSubDMesh 的入口统一走 EnsureCreated:
  GetNative3dSolid / GetDraw3dSolid / GetNativeSubDMesh /
  GetDrawSubDMesh / GetDrawSubDMesh2D / GetCentoridPoint
- GetDrawSubDMesh 补 m_pSubDMesh 空指针保护
- TransformBy 保持原有行为(参数变更后必须重建)
This commit is contained in:
company-desktop-computer committed 2026-10-21 10:01:17 +08:00
1 parent fabaca58df
commit 81215c8fe1
2 files changed
+25 -6

No files matched your search

+3
View File
@@ -77,6 +77,8 @@ public:
//ext: Create(kBox,3,10.0,10.0,12.0);
bool Create(AcDbX3dSolid::Primitive eType,const AcGePoint3d& ptOrg,const AcGeVector3d& vtZ,int n,...);
Acad::ErrorStatus ReCreate();
//按需重建几何:m_bNeedCreate 为真时才调用 ReCreate,供所有读取 m_pSolid/m_pSubDMesh 的入口使用
void EnsureCreated() const;
//起点长度管廊段
bool CreateEarthWorm(const AcGePoint3d& ptOrg,const AcGeVector3d& vtZ,LPCTSTR pszScr,double dLen,const AcGeVector3d& vtLast,const AcGeVector3d& vtNext);
@@ -253,6 +255,7 @@ protected:
//以上数据创建的模型,->不序列化
AcDb3dSolid* m_pSolid; //原始solid元,不序列化
mutable bool m_bNeedCreate; //几何待重建标志,不序列化
AcDbVoidPtrArray m_arCurPtrs; //创建的二维曲线
#if ARX > 17