|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.interop.Dispatch com.esri.arcgis.controls.IPointSnapperProxy
public class IPointSnapperProxy
IPointSnapper Interface
Field Summary | |
---|---|
boolean |
noncastable
|
Fields inherited from class com.esri.arcgis.interop.Dispatch |
---|
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef |
Constructor Summary | |
---|---|
|
IPointSnapperProxy()
|
|
IPointSnapperProxy(Object obj)
|
protected |
IPointSnapperProxy(Object obj,
String iid)
|
Method Summary | |
---|---|
void |
addListener(String iidStr,
Object theListener,
Object theSource)
|
int |
cacheShapes(IGeometryBag pShapes,
String name)
Adds a shape to the snapping cache. |
void |
clearCache()
Clears the underlying snapping cache. |
ISnappingResult |
fullSnap(IPoint point)
Fully attempts to snap the specified point without regard to time. |
void |
getExcludedLayers(ISet ppSet)
Returns a reference to the set of layers that will be excluded in snapping. |
IPoint |
getTangentInputPoint()
Sets the input point used for calculating tangent points along curves. |
void |
removeCachedShapes(int token)
Remove the shape from the cache. |
void |
removeListener(String iidStr,
Object theListener)
|
void |
setTangentInputPointByRef(IPoint point)
Sets the input point used for calculating tangent points along curves. |
ISnappingResult |
snap(IPoint point)
Attempts to snap the specified point. |
void |
updateCachedShapes(int token,
IGeometryBag pShapes)
Updates the shapes in the cache for the given token. |
Methods inherited from class com.esri.arcgis.interop.Dispatch |
---|
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean noncastable
Constructor Detail |
---|
public IPointSnapperProxy()
public IPointSnapperProxy(Object obj) throws IOException
IOException
protected IPointSnapperProxy(Object obj, String iid) throws IOException
IOException
Method Detail |
---|
public void addListener(String iidStr, Object theListener, Object theSource) throws IOException
addListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void removeListener(String iidStr, Object theListener) throws IOException
removeListener
in class com.esri.arcgis.interop.Dispatch
IOException
public ISnappingResult snap(IPoint point) throws IOException, AutomationException
Snap is the mechanism by which a test point (usually the cursor location) is evaluated against the snapping environment to determine whether any of the snapping criteria have been met. This information is returned in the form of a snap result. If the snapping criteria are not met, a null snap result is returned. If a valid snap location was determined, the snap result defines the snap location along with information about which snapping type was satisfied.
Evaluating Snap candidates
The snapping
environment honors the following layer settings:
Only features which match the criteria specified by these
settings are evaluated against the snap candidate.
In addition, only those snapping types specified on the snapping
environment are evaluated. These are evaluated in a specific
order. This snapping type order is fixed. It is
important to note that layer order is secondary when a snap
candidate is considered. This means that the point snapping type is
evaluated against all layers before any subsequent snapping types
are enabled. The closest snap result for a given snapping
type is always returned, regardless if other valid snap results
were identified.
Snapping Type Priority
snap
in interface IPointSnapper
point
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clearCache() throws IOException, AutomationException
While Snapping is enabled and calls to IPointSnapper.Snap are being made, a cache of the visible features is being actively maintained.
The cache is cleared in a number of instances for you; as a
developer you do not need to account for these situations.
The following list describes the cases when ClearCache is
called.
When any of the following events are fired, the snapping cache is cleared.
There is no method to build the cache explicitly; this is handled internally when a client issues a call to IPointSnapper.Snap, at which time it is determined whether the cache needs to be rebuilt.
clearCache
in interface IPointSnapper
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int cacheShapes(IGeometryBag pShapes, String name) throws IOException, AutomationException
CacheShapes provides a mechanism to snap to geometries that are not part of a feature associated with a featurelayer. For example, snapping to the edit sketch in the ArcMap editor utilizes this approach, and adds the current edit sketch into the snapping cache using this method.
As a developer, it is your responsibility to ensure that the
lifetime and currency of the cached shapes you inject are
maintained. Failure to do this will result in shapes being
orphaned in the cache, while may result in invalid snapping results
from a user perspective. Two other methods are used to manage
these caches, IPointSnapper.UpdateCachedShapes and
IPointSnapper.RemovedCachedShapes.
Managing these caches uses a token-based approach. When you
add geometries to the cache, CacheShapes returns a token that
corresponds to those shapes. This token can then be used in
the other methods to specify which shapes you want replaced
(UpdateCachedShapes) or removed (RemoveCachedShapes).
The Name argument is used when a snap result is returned after
snapping to a cached shape, this is returned in lieu of the layer
name in the SnapTip. Empty strings are considered valid, but
do not provide any real indication to about what was snapped
to.
cacheShapes
in interface IPointSnapper
pShapes
- A reference to a com.esri.arcgis.geometry.IGeometryBag (in)name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void updateCachedShapes(int token, IGeometryBag pShapes) throws IOException, AutomationException
UpdateCachedShapes updates the geometries associated with a given token. The snap cache is cleared when a call to UpdateCachedShapes is made; the next subsequent call to Snap will build the cache.
updateCachedShapes
in interface IPointSnapper
token
- The token (in)pShapes
- A reference to a com.esri.arcgis.geometry.IGeometryBag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeCachedShapes(int token) throws IOException, AutomationException
RemoveCachedShapes clears any shapes associated with a given token from the snapping cache. An exception is thrown when an invalid token provided. The snap cache is cleared when a call to RemoveCachedShapes is made; the next subsequent call to Snap will build the cache.
removeCachedShapes
in interface IPointSnapper
token
- The token (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setTangentInputPointByRef(IPoint point) throws IOException, AutomationException
setTangentInputPointByRef
in interface IPointSnapper
point
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IPoint getTangentInputPoint() throws IOException, AutomationException
TangentInputPoint defines the location from which points of tangency along curved segments are calculated. In most cases this is the last point in a polyline geometry. If the tangentInputPoint is not specified, no snapping to tangents of curved segments will occur. Once specified, set the tangentInputPoint to null to ensure any points of tangency are made from the correct point.
In practice, when writing a tool that utilizes snapping, it is the developer’s responsibility to ensure the tangentInputPoint is updated and its lifetime is maintained properly.
getTangentInputPoint
in interface IPointSnapper
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getExcludedLayers(ISet ppSet) throws IOException, AutomationException
getExcludedLayers
in interface IPointSnapper
ppSet
- A reference to a com.esri.arcgis.system.ISet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISnappingResult fullSnap(IPoint point) throws IOException, AutomationException
fullSnap
in interface IPointSnapper
point
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |