-
<pre name="code" class="cpp"><pre name="code" class="cpp">// Copyright (C) 1998-2007 by Autodesk, Inc.
-
//
-
// Permission to use, copy, modify, and distribute this software
-
// for any purpose is restricted by the VIP Subscription program
-
// license agreement. This application was developed exclusively
-
// for distribution by the VIP subscription program and may not
-
// be posted pubicly, modified, copied, or distributed by any other
-
// methods.
-
//
-
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
-
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
-
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
-
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
-
// UNINTERRUPTED OR ERROR FREE.
-
//
-
// Use, duplication, or disclosure by the U.S. Government is subject to
-
// restrictions set forth in FAR 52.227-19 (Commercial Computer
-
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
-
// (Rights in Technical Data and Computer Software), as applicable.
-
//
-
-
#include "acedinpt.h"
-
-
class AsdkInputPointMonitor : public AcEdInputPointMonitor
-
{
-
public:
-
virtual Acad::ErrorStatus monitorInputPoint(const AcEdInputPoint& input, AcEdInputPointMonitorResult& output);
-
virtual bool excludeFromOsnapCalculation (const AcArray<AcDbObjectId>& nestedEntity, INT_PTR gsSelectionMark);
-
};
-
// Copyright (C) 1998-2007 by Autodesk, Inc.
-
//
-
// Permission to use, copy, modify, and distribute this software
-
// for any purpose is restricted by the VIP Subscription program
-
// license agreement. This application was developed exclusively
-
// for distribution by the VIP subscription program and may not
-
// be posted pubicly, modified, copied, or distributed by any other
-
// methods.
-
//
-
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
-
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
-
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
-
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
-
// UNINTERRUPTED OR ERROR FREE.
-
//
-
// Use, duplication, or disclosure by the U.S. Government is subject to
-
// restrictions set forth in FAR 52.227-19 (Commercial Computer
-
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
-
// (Rights in Technical Data and Computer Software), as applicable.
-
//
-
-
// AsdkInputPointMonitor methods
-
//
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Acad::ErrorStatus
-
AsdkInputPointMonitor::monitorInputPoint(const AcEdInputPoint& input, AcEdInputPointMonitorResult& output)
-
{
-
if ( !input.pointComputed() )
-
{
-
// Points cannot be computed in the Monitor
-
// Forced picking may be enabled
-
-
if ( input.history() & Acad::eCyclingPt)
-
acutPrintf( _T(" No point computed, but new cycling osnap: %.2f, %.2f, %.2f "),
-
input.osnappedPoint()[X], input.osnappedPoint()[Y], input.osnappedPoint()[Z] );
-
-
return Acad::eOk;
-
}
-
-
// Show historical point selection information
-
//
-
-
-
acutPrintf( _T(" History: %d, "), input.history() );
-
-
HISTORY_CHECK(eTablet);
-
HISTORY_CHECK(eNotDigitizer);
-
HISTORY_CHECK(eLastPt);
-
HISTORY_CHECK(eGripped);
-
HISTORY_CHECK(eCartSnapped);
-
HISTORY_CHECK(eOrtho);
-
HISTORY_CHECK(eCyclingPt);
-
HISTORY_CHECK(eOsnapped);
-
HISTORY_CHECK(ePolarAngle);
-
HISTORY_CHECK(eAligned);
-
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);
-
-
-
-
acutPrintf( _T(" ") );
-
-
// Show more point input information
-
//
-
if ( input.history() & Acad::eLastPt )
-
acutPrintf( _T("Last point: %.2f, %.2f, %.2f "), input.lastPoint()[X], input.lastPoint()[Y], input.lastPoint()[Z] );
-
-
acutPrintf( _T("Raw point: %.2f, %.2f, %.2f "), input.rawPoint()[X], input.rawPoint()[Y], input.rawPoint()[Z] );
-
acutPrintf( _T("Computed point: %.2f, %.2f, %.2f "), input.computedPoint()[X], input.computedPoint()[Y], input.computedPoint()[Z] );
-
-
if ( input.history() & Acad::eGripped )
-
acutPrintf( _T("Gripped point: %.2f, %.2f, %.2f "), input.grippedPoint()[X], input.grippedPoint()[Y], input.grippedPoint()[Z] );
-
-
if ( input.history() & Acad::eCartSnapped )
-
acutPrintf( _T("Cartesian snapped point: %.2f, %.2f, %.2f "), input.cartesianSnappedPoint()[X], input.cartesianSnappedPoint()[Y], input.cartesianSnappedPoint()[Z] );
-
-
if ( input.history() & Acad::eOsnapped )
-
{
-
acutPrintf( _T("Osnapped point: %.2f, %.2f, %.2f "), input.osnappedPoint()[X], input.osnappedPoint()[Y], input.osnappedPoint()[Z] );
-
-
acutPrintf( _T("Object snap masks: ") );
-
-
-
-
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 "), input.customOsnapModes()[i]->globalModeString() );
-
}
-
acutPrintf( _T(" ") );
-
}
-
-
// Show the object snap overrides
-
//
-
if ( 0 != input.osnapOverrides() )
-
{
-
-
acutPrintf( _T("Object snap overrides: ") );
-
-
-
-
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);
-
-
-
-
acutPrintf(_T(" "));
-
}
-
-
// Show custom object snap overrides
-
//
-
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(" ") );
-
}
-
-
// Show object snap or forced pick information: the entities in the aperture
-
acutPrintf( _T("%d apertured entities, "), input.pickedEntities().length() );
-
acutPrintf( _T("%d nested apertured entities "), input.nestedPickedEntities().length() );
-
-
// Show AutoSnap information
-
// Note: nestedKeyPointEntities.length() == keyPointGsSelectionMark.length()
-
//
-
acutPrintf( _T("%d key point entities, "), input.keyPointEntities().length() );
-
acutPrintf( _T("%d nested key point entities "), input.nestedKeyPointEntities().length() );
-
acutPrintf( _T("%d alignment paths "), input.alignmentPaths().length() );
-
-
// Add an additional comment to the tootip string
-
//
-
if ( NULL != input.tooltipString() )
-
{
-
output.setAdditionalTooltipString(_T(", Additional comment!"));
-
acutPrintf( _T("Appending "%s" to "%s" "), _T(", Additional comment!"), input.tooltipString() );
-
}
-
else
-
acutPrintf( _T("Tooltip is NULL ") );
-
-
acedPostCommandPrompt();
-
return Acad::eOk;
-
}
-
-
bool
-
AsdkInputPointMonitor::excludeFromOsnapCalculation (const AcArray<AcDbObjectId>& nestedEntity, INT_PTR gsSelectionMark)
-
{
-
acutPrintf( _T(" ExcludeFromOsnapCalculation called on monitor... ") );
-
acutPrintf( _T("%d nested entities under cursor "), nestedEntity.length() );
-
return false;
-
}