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



         

Фильтр Точки ввода и Пример Монитора - часть 4


IPF::processInputPoint(

bool& changedPoint,

AcGePoint3d& newPoint,

bool& changedTooltipStr,

char*& newTooltipString,

bool& retry,

AcGiViewportDraw* pDrawContext,

AcApDocument* document,

bool pointComputed,

int history,

const AcGePoint3d& lastPoint,

const AcGePoint3d& rawPoint,

const AcGePoint3d& grippedPoint,

const AcGePoint3d& cartesianSnappedPoint,

const AcGePoint3d& osnappedPoint,

// const AcArray<AcDbCustomOsnapMode>& customOsnapModes

const AcArray<AcDbObjectId>& pickedEntities,

const AcArray< AcDbObjectIdArray,

AcArrayObjectCopyReallocator< AcDbObjectIdArray > >&

nestedPickedEntities,

// Of 0th element in pickedEntities.

int gsSelectionMark,

// AutoSnap Info:

const AcArray<AcDbObjectId>& keyPointEntities,

const AcArray<AcGeCurve3d*>& alignmentPaths,

const AcGePoint3d& computedPoint,

const char* tooltipString)

{

// Change the computed point to an offset of (0.2, 0.2, 0.2)

// if the current computed point is an object snap point.

//

if (pointComputed && history & Acad::eOsnapped)

{

changedPoint = true;

newPoint = osnappedPoint + AcGeVector3d(0.2,0.2,0.0);

pDrawContext->geometry().circle(newPoint, 0.1,

AcGeVector3d::kZAxis);

}

return Acad::eOk;

}

// Input point monitor

IPM my_ipm;

// Input point filter

IPF my_ipf;

// Installs an input point monitor.

//

void testipm()

{

curDoc()->inputPointManager()->addPointMonitor(&my_ipm);

}

// Installs an input point filter.

//

void testipf()

{

curDoc()->inputPointManager()->registerPointFilter(&my_ipf);

}

// Turns on forced entity picking.

//

void testfp()

{

curDoc()->inputPointManager()->turnOnForcedPick();

}

// Disables the system cursor graphics.

//

void testcursor()

{

curDoc()->inputPointManager()->disableSystemCursorGraphics();

}

extern "C" __declspec(dllexport)

AcRx::AppRetCode

acrxEntryPoint(AcRx::AppMsgCode msg, void *p)

{

switch (msg)

{

case AcRx::kInitAppMsg:

acrxRegisterAppMDIAware(p);

acrxUnlockApplication(p);

acedRegCmds->addCommand("mkr", "testipm", "ipm",

ACRX_CMD_TRANSPARENT, testipm);

acedRegCmds->addCommand("mkr", "testipf", "ipf",

ACRX_CMD_TRANSPARENT, testipf);

acedRegCmds->addCommand("mkr", "testfp", "fp",

ACRX_CMD_TRANSPARENT, testfp);

acedRegCmds->addCommand("mkr", "testcursor", "cursor",

ACRX_CMD_TRANSPARENT, testcursor);

break;

case AcRx::kUnloadAppMsg:

acedRegCmds->removeGroup("mkr");

break;

}

return AcRx::kRetOK;

}




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