// const AcArray<AcDbCustomOsnapMode>& customOsnapModes
const AcArray<AcDbObjectId>& apertureEntities,
const AcArray< AcDbObjectIdArray,
AcArrayObjectCopyReallocator< AcDbObjectIdArray > >&
nestedPickedEntities,
int gsSelectionMark,
const AcArray<AcDbObjectId>& keyPointEntities,
const AcArray<AcGeCurve3d*>& alignmentPaths,
const AcGePoint3d& computedPoint,
const char* tooltipString);
};
Acad::ErrorStatus
IPM::monitorInputPoint(
// Output. If changedTooltipStr is kTrue, then newTooltipString
// has the new ToolTip string in it.
//
bool& appendToTooltipStr,
char*& additionalTooltipString,
// Input/Output
//
AcGiViewportDraw* pDrawContext,
// Input parameters:
//
AcApDocument* document,
bool pointComputed,
int history,
const AcGePoint3d& lastPoint,
const AcGePoint3d& rawPoint,
const AcGePoint3d& grippedPoint,
const AcGePoint3d& cartesianSnappedPoint,
const AcGePoint3d& osnappedPoint,
AcDb::OsnapMask osnapMasks,
// const AcArray<AcDbCustomOsnapMode>& customOsnapModes
const AcArray<AcDbObjectId>& apertureEntities,
const AcArray< AcDbObjectIdArray,
AcArrayObjectCopyReallocator< AcDbObjectIdArray > >&
nestedPickedEntities,
int gsSelectionMark,
const AcArray<AcDbObjectId>& keyPointEntities,
const AcArray<AcGeCurve3d*>& alignmentPaths,
const AcGePoint3d& computedPoint,
const char* tooltipString)
{
acutPrintf("\nhistory: %d\n", history);
if (pointComputed)
{
acutPrintf(
"rawPoint: %.2f, %.2f, %.2f\n",
rawPoint[0],
rawPoint[1],
rawPoint[2]);
if (history & Acad::eGripped)
acutPrintf(
"grippedPoint: %.2f, %.2f, %.2f\n",
grippedPoint[0],
grippedPoint[1],
grippedPoint[2]);
if (history & Acad::eCartSnapped)
acutPrintf(
"cartesianSnappedPoint: %.2f, %.2f, %.2f\n",
cartesianSnappedPoint[0],
cartesianSnappedPoint[1],
cartesianSnappedPoint[2]);
if (history & Acad::eOsnapped)
{
acutPrintf(
"osnappedPoint: %.2f, %.2f, %.2f\n",
osnappedPoint[0],
osnappedPoint[1],
osnappedPoint[2]);
#define OSMASK_CHECK(x) if (osnapMasks & AcDb:: ## x)
acutPrintf("%s ", #x)
OSMASK_CHECK(kOsMaskEnd);
OSMASK_CHECK(kOsMaskMid);
OSMASK_CHECK(kOsMaskCen);
OSMASK_CHECK(kOsMaskNode);
OSMASK_CHECK(kOsMaskQuad);
OSMASK_CHECK(kOsMaskInt);
OSMASK_CHECK(kOsMaskIns);
OSMASK_CHECK(kOsMaskPerp);
OSMASK_CHECK(kOsMaskTan);
OSMASK_CHECK(kOsMaskNear);
OSMASK_CHECK(kOsMaskQuick);
OSMASK_CHECK(kOsMaskApint);
OSMASK_CHECK(kOsMaskImmediate);
OSMASK_CHECK(kOsMaskAllowTan);
OSMASK_CHECK(kOsMaskDisablePerp);
OSMASK_CHECK(kOsMaskRelCartesian);
OSMASK_CHECK(kOsMaskRelPolar);
#undef OSMASK_CHECK
acutPrintf("\n");
}
acutPrintf("%d apertureEntities: ", apertureEntities. length());
for (int i = 0; i < apertureEntities. length(); i++)
acutPrintf("<%x> ", apertureEntities[i].asOldId());
acutPrintf("\n");
}
else {
acutPrintf("No point computed");
if (history & Acad::eCyclingPt)
acutPrintf(", but new cycling osnap: %.2f, %.2f, %.2f\n",
osnappedPoint[0], osnappedPoint[1], osnappedPoint[2]);
else
acutPrintf(".\n");
}
if (NULL!= pDrawContext)
{
pDrawContext->subEntityTraits().setColor(2);
pDrawContext->geometry().circle(rawPoint, 1.0,
AcGeVector3d::kZAxis);
}
else
acutPrintf("ViewportDraw is NULL!\n");
if (history & Acad::eNotDigitizer)
acutPrintf("PICK!\n");
if (NULL!= tooltipString)
{
acutPrintf("TooltipString: %s\n", tooltipString);
additionalTooltipString = ", anotherString!";
appendToTooltipStr = true;
}
if (history & Acad::eOrtho)
{
acutPrintf("Ortho found at %.2f, %.2f, %.2f\n",
computedPoint[0], computedPoint[1], computedPoint[2]);
}
return Acad::eOk;
}
class IPF : public AcEdInputPointFilter {
public:
Acad::ErrorStatus
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,
AcDb::OsnapMask osnapMasks,
// 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);
};
Acad::ErrorStatus
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;
}
Глава 22. Конфигурация приложения
Эта глава обсуждает конфигурирование вашего приложения для конечного пользователя.
§ Менеджер профилей
Менеджер профилей
Менеджер профилей позволяет Вам исполнять все операции, обеспеченные в позиции табуляции Profiles Диалога Опций. Этот API состоит из двух классов, и несколько методов имели обыкновение управлять параметрами пользователя легко.
AcApProfileManager Класс
Имеется только один объект Profile Manager в сессию AutoCAD. ObjectARX обеспечивает глобальную функцию, чтобы получить доступ к этому объекту Profile Manager, названному acProfileManagerPtr(). Эта функция возвращает указатель на объект AcApProfileManager, который методы могут тогда быть вызваны.
AcApProfileManager класс обеспечивает контейнер для операций, обеспеченных окном Profiles. Не имеется никакого метода, обеспеченного, чтобы получить текущее имя профиля, так как это сохранено в переменной системы по имени CPROFILE и может быть получено, используя запрос к acutGetVar ().
AcApProfileManager класс обеспечивает следующие возможности
Возможности | Связанный Метод |
Отыщите путь системного реестра для указанного профили | AcApProfileManager:: ProfileRegistryKey |
Отыщите названия профилей которые в настоящее время существуют для конфигурации пользователя | AcApProfileManager:: ProfileListNames |
Экспортируйте данный профиль в файл профили системного реестра AutoCAD (.arg) в формате REGEDIT4 | AcApProfileManager:: ProfileExport |
Импортируйте файл профили системного реестра AutoCAD (.arg) в данный профиль | AcApProfileManager:: ProfileImport |
Удалите указанный профиль из системного реестра | AcApProfileManager:: ProfileDelete |
Сбросьте указанный профиль к настройкам по умолчанию AutoCAD | AcApProfileManager:: ProfileReset |
Делайте указанный профиль активным или текущим для сессии AutoCAD | AcApProfileManager:: ProfileSetCurrent |
Копируйте существующий профиль к новому профилю | AcApProfileManager:: ProfileCopy |
Переименуйте существующий профиль | AcApProfileManager:: ProfileRename |
Добавьте новый объект реактора профиля | AcApProfileManager:: addReactor |
Удалите существующий объект реактора профиля | AcApProfileManager:: removeReactor |
AcApProfileManagerReactor Класс
AcApProfileManagerReactor класс обеспечивает контейнер для различных события уведомлений, основанных на изменении параметров пользователем.
|
Из за большого объема этот материал размещен на нескольких страницах:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |


