ObjectARX, AutoCAD. Среда программирования библиотеки C++


         

SubErase, subOpen, subClose, and subCancel - часть 4


mEllipseIds.append(objIds);

return Acad::eOk;

}

inline Adesk::Boolean

AsdkEllipse::removeId(const AcDbObjectId& objId)

{

assertWriteEnabled();

return mEllipseIds.remove(objId);

}

// This implementation of subErase opens and erases all

// objects that this entity has hard pointer references

// to. The effect is that when one AsdkEllipse is erased,

// all the others it has hard pointers to also erase as

// a "group".

//

Acad::ErrorStatus

AsdkEllipse::subErase(Adesk::Boolean pErasing)

{

Acad::ErrorStatus es = AcDbEllipse::subErase(pErasing);

if (es != Acad::eOk)

return es;

if (mInFlux == Adesk::kFalse) {

mInFlux = Adesk::kTrue;

AsdkEllipse *pEllipse;

int es;

for (int i = 0; i < mEllipseIds.length(); i++) {

es = acdbOpenObject(pEllipse, mEllipseIds[i],

AcDb::kForWrite, Adesk::kTrue);

if (es != Acad::eOk)

continue;

pEllipse->erase(pErasing);

pEllipse->close();

}

mInFlux = Adesk::kFalse;

}

return Acad::eOk;

}

Acad::ErrorStatus

AsdkEllipse::dwgInFields(AcDbDwgFiler* filer)

{

assertWriteEnabled();

AcDbEllipse::dwgInFields(filer);

mEllipseIds.setLogicalLength(0);

int idCount;

filer->readInt32((long*)&idCount);

AcDbHardPointerId objId;

for (int i = 0; i < idCount; i++) {

filer->readItem(&objId);

mEllipseIds.append(objId);

}

return filer->filerStatus();

}

Acad::ErrorStatus

AsdkEllipse::dwgOutFields(AcDbDwgFiler* filer) const

{

assertReadEnabled();

AcDbEllipse::dwgOutFields(filer);

filer->writeInt32(mEllipseIds.length());

for (int i = 0; i < mEllipseIds.length(); i++) {

filer->writeHardPointerId(mEllipseIds[i]);

}

return filer->filerStatus();

}

Acad::ErrorStatus

AsdkEllipse::dxfInFields(AcDbDxfFiler* filer)

{

assertWriteEnabled();

Acad::ErrorStatus es = AcDbEllipse::dxfInFields(filer);

if (es != Acad::eOk) {

return es;

}

// Check to see if we’re at the right subclass data

// marker.

//

if (!filer->atSubclassData("AsdkEllipse")) {

return Acad::eBadDxfSequence;




Содержание  Назад  Вперед