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


Диапазоны Кода DXF-группы - часть 3


case AcDb::kDxfXCoord:

if (version == 1)

cen3d = asPnt3d(rb.resval.rpoint);

else

cen2d = asPnt2d(rb.resval.rpoint);

fieldsFlags |= 0x1;

break;

case AcDb::kDxfXCoord + 1:

if (version == 1)

sp3d = asPnt3d(rb.resval.rpoint);

else

sp2d = asPnt2d(rb.resval.rpoint);

fieldsFlags |= 0x2;

break;

case AcDb::kDxfInt32:

numSides = rb.resval.rlong;

fieldsFlags |= 0x4;

break;

case AcDb::kDxfNormalX:

planeNormal = asVec3d(rb.resval.rpoint);

fieldsFlags |= 0x8;

break;

case AcDb::kDxfText:

acutUpdString(rb.resval.rstring,pName);

fieldsFlags |= 0x11;

break;

case AcDb::kDxfHardPointerId:

acdbGetObjectId(textStyle, rb.resval.rlname);

fieldsFlags |= 0x12;

break;

case AcDb::kDxfReal:

if (version == 2)

{

fieldsFlags |= 0x10;

elevation = rb.resval.rreal;

break;

}

//fall through intentional

default:

// An unrecognized group. Push it back so that

// the subclass can read it again.

filer->pushBackItem();

es = Acad::eEndOfFile;

break;

}

}

// At this point, the es variable must contain eEndOfFile,

// either from readResBuf() or from pushbackBackItem(). If

// not, it indicates that an error happened and we should

// return immediately.

//

if (es != Acad::eEndOfFile)

return Acad::eInvalidResBuf;

// Now check to be sure all necessary group codes were

// present.

//

// Mandatory fields:

// - center

// - start point

// - normal

// - number of sides

// - elevation (if version > 1)

short required[] =

{AcDb::kDxfXCoord, AcDb::kDxfXCoord+1, AcDb::kDxfInt32,

AcDb::kDxfNormalX, AcDb::kDxfReal};

for (short i = 0; i < (version>1?4:3); i++) {

if (!fieldsFlags & 0x1) {

filer->setError(Acad::eMissingDxfField,

"\nMissing DXF group code: %d", 2, required[i]);

return Acad::eMissingDxfField;

} else

fieldsFlags >>= 1;

}

mPlaneNormal = planeNormal;

mNumSides = numSides;

mTextStyle = textStyle;

setName(pName);

acutDelString(pName);

if (version==1)

{

//convert data from old format

acdbWcs2Ecs(asDblArray(cen3d),asDblArray(cen3d),




Начало  Назад  Вперед



Книжный магазин