Update AecDbMultiPartEntity.cpp
This commit is contained in:
1 parent
f39b4f9804
commit
b5c0ea3004
1 file changed
+51
-1
@@ -2,6 +2,7 @@
|
||||
#include "aecdbmultipartentity.h"
|
||||
#include "simpleproperty.h"
|
||||
#include "coretools.h"
|
||||
#include "dbacis.h"
|
||||
|
||||
IMP_XDATA_KEY(AecDbMultiPartEntity,_ptOrg_);
|
||||
IMP_XDATA_KEY(AecDbMultiPartEntity,_vtX_);
|
||||
@@ -11,7 +12,8 @@ IMP_XDATA_KEY(AecDbMultiPartEntity,_vtZ_);
|
||||
extern void DLLIMPEXP OrthoProjected3DSolid(AcDb3dSolid* pSolidClone,const AcGePlane& plan,AcGeMatrix3d& xformPlanToWorld,AcDbVoidPtrArray& arEntPtrs);
|
||||
extern void DLLIMPEXP OrthoProjected3DSubMesh(AcDbSubDMesh* pSubMesh,const AcGePlane& plan,AcGeMatrix3d& xformPlanToWorld,AcDbVoidPtrArray& arEntPtrs);
|
||||
|
||||
Adesk::UInt32 AecDbMultiPartEntity::kCurrentVersionNumber = 3;
|
||||
//Adesk::UInt32 AecDbMultiPartEntity::kCurrentVersionNumber = 3;
|
||||
Adesk::UInt32 AecDbMultiPartEntity::kCurrentVersionNumber = 4;
|
||||
|
||||
ACRX_DXF_DEFINE_MEMBERS (AecDbMultiPartEntity, AecDbBDPipeBase,
|
||||
AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent,
|
||||
@@ -330,6 +332,30 @@ Acad::ErrorStatus AecDbMultiPartEntity::dwgInFields (AcDbDwgFiler* pFiler)
|
||||
xMap.dwgInFields(pFiler);
|
||||
}
|
||||
|
||||
if (version > 3)
|
||||
{
|
||||
Adesk::Int32 len(0);
|
||||
pFiler->readInt32(&len);
|
||||
|
||||
int nModelerVer = -1;
|
||||
for (int i(0); i < len; ++i)
|
||||
{
|
||||
ENTITY* pAsm = NULL;
|
||||
acdbModelerRestoreEntityFromDwgFiler(pFiler, pAsm, &nModelerVer, kReadStrangerEntityDefault);
|
||||
if (pAsm)
|
||||
{
|
||||
AcDb3dSolid *pSolid(new AcDb3dSolid);
|
||||
if (pSolid->setASMBody(pAsm) == Acad::eOk)
|
||||
{
|
||||
Add3DBuffer(pSolid);
|
||||
}
|
||||
else
|
||||
DELETE_PTR(pSolid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return pFiler->filerStatus();
|
||||
}
|
||||
|
||||
@@ -346,6 +372,30 @@ Acad::ErrorStatus AecDbMultiPartEntity::dwgOutFields(AcDbDwgFiler* pFiler) const
|
||||
if ( (es =pFiler->writeUInt32 (AecDbMultiPartEntity::kCurrentVersionNumber)) != Acad::eOk )
|
||||
return (es) ;
|
||||
|
||||
const AcDbVoidPtrArray ar = Get3DBuffer();
|
||||
|
||||
pFiler->writeInt32(ar.length());
|
||||
|
||||
for (int i(0); i < ar.length(); ++i)
|
||||
{
|
||||
const AcDbEntity *pEnt((AcDbEntity *)ar[i]);
|
||||
if (!pEnt) continue;
|
||||
|
||||
AcDb3dSolid *pSolid = AcDb3dSolid::cast(pEnt);
|
||||
if (!pSolid) continue;
|
||||
|
||||
AcDbDatabase *pDb = pSolid->database();
|
||||
if (pDb == NULL)
|
||||
pDb = acdbHostApplicationServices()->workingDatabase();
|
||||
|
||||
ENTITY* pAsm = (ENTITY*)pSolid->getLockedASMBody();
|
||||
if (!pAsm) continue;
|
||||
|
||||
acdbModelerSaveEntityToDwgFiler(pFiler, pAsm, pDb, -1);
|
||||
|
||||
pSolid->unlockASMBody();
|
||||
}
|
||||
|
||||
return pFiler->filerStatus();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user