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

       

Now add the ellipse to


// At this time, mPromptCounter == 0.

//

setDispPrompt("\nEllipse major axis: ");

AcEdJig::DragStatus stat = drag();

// Get the ellipse’s radius ratio.

//

mPromptCounter++; // now == 1

setDispPrompt("\nEllipse minor axis: ");

stat = drag();

// Now add the ellipse to the database’s current space.

//

append();

}

// This function is called by the drag function to

// acquire a sample input.

//

AcEdJig::DragStatus

AsdkEllipseJig::sampler()

{

DragStatus stat;

setUserInputControls((UserInputControls)

(AcEdJig::kAccept3dCoordinates

| AcEdJig::kNoNegativeResponseAccepted

| AcEdJig::kNoZeroResponseAccepted));

if (mPromptCounter == 0) {

// Aquire the major axis endpoint.

//

// If the newly acquired point is the same as it was

// in the last sample, then we return kNoChange so the

// AsdkEllipseJig::update() function will not be called

// and the last update call will be able to finish, thus

// allowing the ellipse to fully elaborate.

//

static AcGePoint3d axisPointTemp;

stat = acquirePoint(mAxisPt, mCenterPt);

if (axisPointTemp != mAxisPt)

axisPointTemp = mAxisPt;

else if (stat == AcEdJig::kNormal)

return AcEdJig::kNoChange;

}

else if (mPromptCounter == 1) {

// Aquire the distance from ellipse center to minor

// axis endpoint. This will be used to calculate the

// radius ratio.

//

// If the newly acquired distance is the same as it was

// in the last sample, then we return kNoChange so the

// AsdkEllipseJig::update() function will not be called

// and the last update call will be able to finish, thus

// allowing the ellipse to fully elaborate.

//

static double radiusRatioTemp = -1;

stat = acquireDist(mRadiusRatio, mCenterPt);

if (radiusRatioTemp != mRadiusRatio)

radiusRatioTemp = mRadiusRatio;

else if (stat == AcEdJig::kNormal)

return AcEdJig::kNoChange;

}

return stat;

}

// This function is called to update the entity based on the

// input values.

//

Adesk::Boolean

AsdkEllipseJig::update()


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







Forekc.ru
Рефераты, дипломы, курсовые, выпускные и квалификационные работы, диссертации, учебники, учебные пособия, лекции, методические пособия и рекомендации, программы и курсы обучения, публикации из профильных изданий