ObjectARX学习笔记(二十三)---AcEdInputPointMonitor 反应器,用来重载CAD鼠标点处实体的提示信息
其他
2020-03-01 23:17:32
阅读次数: 0
-
<pre name=
"code" class="cpp"><pre name="code" class="cpp">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
class AsdkInputPointMonitor :
public AcEdInputPointMonitor
-
-
-
virtual Acad::ErrorStatus monitorInputPoint(const AcEdInputPoint& input, AcEdInputPointMonitorResult& output);
-
virtual bool excludeFromOsnapCalculation (const AcArray<AcDbObjectId>& nestedEntity, INT_PTR gsSelectionMark);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#if defined(_DEBUG) && !defined(AC_FULL_DEBUG)
-
#error _DEBUG should not be defined except in internal Adesk debug builds
-
-
-
-
-
-
-
-
-
-
-
-
-
-
AsdkInputPointMonitor::monitorInputPoint(
const AcEdInputPoint& input, AcEdInputPointMonitorResult& output)
-
-
if ( !input.pointComputed() )
-
-
-
-
-
if ( input.history() & Acad::eCyclingPt)
-
acutPrintf( _T(
"\nNo point computed, but new cycling osnap: %.2f, %.2f, %.2f\n"),
-
input.osnappedPoint()[X], input.osnappedPoint()[Y], input.osnappedPoint()[Z] );
-
-
-
-
-
-
-
#define HISTORY_CHECK(x) if (input.history() & Acad:: ## x) acutPrintf(_T("%s "), _T(#x))
-
-
acutPrintf( _T(
"\nHistory: %d, "), input.history() );
-
-
-
HISTORY_CHECK(eNotDigitizer);
-
-
-
HISTORY_CHECK(eCartSnapped);
-
-
HISTORY_CHECK(eCyclingPt);
-
HISTORY_CHECK(eOsnapped);
-
HISTORY_CHECK(ePolarAngle);
-
-
HISTORY_CHECK(eAppFiltered);
-
HISTORY_CHECK(eForcedPick);
-
HISTORY_CHECK(ePickMask);
-
HISTORY_CHECK(eDidNotPick);
-
HISTORY_CHECK(eUsedPickBox);
-
HISTORY_CHECK(eUsedOsnapBox);
-
HISTORY_CHECK(ePickAborted);
-
HISTORY_CHECK(eXPending);
-
HISTORY_CHECK(eYPending);
-
HISTORY_CHECK(eZPending);
-
HISTORY_CHECK(eCoordPending);
-
-
-
-
-
-
-
-
if ( input.history() & Acad::eLastPt )
-
acutPrintf( _T(
"Last point: %.2f, %.2f, %.2f\n"), input.lastPoint()[X], input.lastPoint()[Y], input.lastPoint()[Z] );
-
-
acutPrintf( _T(
"Raw point: %.2f, %.2f, %.2f\n"), input.rawPoint()[X], input.rawPoint()[Y], input.rawPoint()[Z] );
-
acutPrintf( _T(
"Computed point: %.2f, %.2f, %.2f\n"), input.computedPoint()[X], input.computedPoint()[Y], input.computedPoint()[Z] );
-
-
if ( input.history() & Acad::eGripped )
-
acutPrintf( _T(
"Gripped point: %.2f, %.2f, %.2f\n"), input.grippedPoint()[X], input.grippedPoint()[Y], input.grippedPoint()[Z] );
-
-
if ( input.history() & Acad::eCartSnapped )
-
acutPrintf( _T(
"Cartesian snapped point: %.2f, %.2f, %.2f\n"), input.cartesianSnappedPoint()[X], input.cartesianSnappedPoint()[Y], input.cartesianSnappedPoint()[Z] );
-
-
if ( input.history() & Acad::eOsnapped )
-
-
acutPrintf( _T(
"Osnapped point: %.2f, %.2f, %.2f\n"), input.osnappedPoint()[X], input.osnappedPoint()[Y], input.osnappedPoint()[Z] );
-
-
acutPrintf( _T(
"Object snap masks: ") );
-
-
#define OSMASK_CHECK(x) if (input.osnapMask() & AcDb:: ## x) acutPrintf(_T("%s "), _T(#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);
-
-
-
-
if ( 0 == input.osnapMask() )
-
-
for ( int i = 0; i < input.customOsnapModes().length(); i++ )
-
acutPrintf( _T(
"%s\n"), input.customOsnapModes()[i]->globalModeString() );
-
-
-
-
-
-
-
if ( 0 != input.osnapOverrides() )
-
-
-
acutPrintf( _T(
"Object snap overrides: ") );
-
-
#define OSMASK_CHECK(x) if (input.osnapOverrides() & AcDb:: ## x) acutPrintf(_T("%s "), _T(#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);
-
-
-
-
-
-
-
-
-
if ( 0 != input.customOsnapOverrides().length() )
-
-
acutPrintf( _T(
"Custom object snap overrides: ") );
-
for ( int x = 0; x < input.customOsnapOverrides().length(); x++)
-
acutPrintf( _T(
"%s "), input.customOsnapOverrides()[x]->globalModeString() );
-
-
-
-
-
acutPrintf( _T(
"%d apertured entities, "), input.pickedEntities().length() );
-
acutPrintf( _T(
"%d nested apertured entities\n"), input.nestedPickedEntities().length() );
-
-
-
-
-
acutPrintf( _T(
"%d key point entities, "), input.keyPointEntities().length() );
-
acutPrintf( _T(
"%d nested key point entities\n"), input.nestedKeyPointEntities().length() );
-
acutPrintf( _T(
"%d alignment paths\n"), input.alignmentPaths().length() );
-
-
-
-
if ( NULL != input.tooltipString() )
-
-
output.setAdditionalTooltipString(_T(
", Additional comment!"));
-
acutPrintf( _T(
"Appending \"%s\" to \"%s\"\n"), _T(", Additional comment!"), input.tooltipString() );
-
-
-
acutPrintf( _T(
"Tooltip is NULL\n") );
-
-
-
-
-
-
-
AsdkInputPointMonitor::excludeFromOsnapCalculation (
const AcArray<AcDbObjectId>& nestedEntity, INT_PTR gsSelectionMark)
-
-
acutPrintf( _T(
"\nExcludeFromOsnapCalculation called on monitor...\n") );
-
acutPrintf( _T(
"%d nested entities under cursor\n"), nestedEntity.length() );
-
-
转载自www.cnblogs.com/mjgw/p/12392826.html