com.esri.arcgis.editor
Interface ISnapEnvironment

All Superinterfaces:
Serializable
All Known Subinterfaces:
ISnapEnvironment2, ISnapEnvironment3
All Known Implementing Classes:
Editor, ISnapEnvironment2Proxy, ISnapEnvironment3Proxy, ISnapEnvironmentProxy

public interface ISnapEnvironment
extends Serializable

Provides access to members that manage the snap agents used by the editor.

Superseded By

ISnapEnvironment3

Remarks

The ISnapEnvironment interface is on the Editor CoClass. You can access ISnapEnvironment from any other interface on the Editor CoClass.

When To Use

The ISnapEnvironment interface manages the collection of snap agents,
the snap tolerance, and the snap tolerance units

Product Availability

Available with ArcGIS Desktop.

See Also:
ISnapEnvironment, ISnapAgent, IEditProperties, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, esriSnapToleranceUnits, IEditSketch

Method Summary
 void addSnapAgent(ISnapAgent snapAgent)
          Adds a new snap agent to the snap environment.
 void clearSnapAgents()
          Removes all snap agents.
 ISnapAgent getSnapAgent(int index)
          A snap agent at the given index.
 int getSnapAgentCount()
          The number of active snap agents.
 double getSnapTolerance()
          The snap tolerance, measured in pixels or map units.
 int getSnapToleranceUnits()
          The units used for the snap tolerance.
 void removeSnapAgent(int index)
          Removes the snap agent at the given index.
 void setSnapTolerance(double tol)
          The snap tolerance, measured in pixels or map units.
 void setSnapToleranceUnits(int units)
          The units used for the snap tolerance.
 boolean snapPoint(IPoint point)
          Attempts to snap the point using the current snap environment.
 

Method Detail

snapPoint

boolean snapPoint(IPoint point)
                  throws IOException,
                         AutomationException
Attempts to snap the point using the current snap environment.

Description

SnapPoint passes the required point parameter to each of the added Snap Agents in the order that these agents were added. The agents attempt, in turn, to find point coordinates that fulfill its snap properties for the incoming point. If a new snap location is found, the relevant snap agent modifies the original point's coordinates to that of the new location. The same point is then returned to SnapPoint. Once a snap agent is found that satisfies the point subsequent snap agents are not tested.


Remarks

As an example: there may be several FeatureSnap agents present. Each receives a point from the current cursor location, which is passed to the agent via the SnapPoint method. If the conditions for a snap are met, the boolean value of the agent returns TRUE, the point's coordinates are updated based on the active FeatureSnap's conditions and the same point is returned to SnapPoint. In the Editor, the InvertAgent location is always set equal to this point. Thus, when snapping conditions are met, the InvertAgent (blue dot) is passed the point with altered coordinates, and the corresponding location shift is manifested as a "snap".

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
Returns:
The snapped
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapToleranceUnits

int getSnapToleranceUnits()
                          throws IOException,
                                 AutomationException
The units used for the snap tolerance.

Remarks

SnapToleranceUnits defines the method of type esriSnapToleranceUnits used to define the radius used by active snap agents. The default value is esriSnapTolerancePixels.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A com.esri.arcgis.editor.esriSnapToleranceUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapToleranceUnits

void setSnapToleranceUnits(int units)
                           throws IOException,
                                  AutomationException
The units used for the snap tolerance.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
units - A com.esri.arcgis.editor.esriSnapToleranceUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapTolerance

double getSnapTolerance()
                        throws IOException,
                               AutomationException
The snap tolerance, measured in pixels or map units.

Remarks

SnapTolerance this property is the size of the region bounding the input point location. It is given as a radius, measured in pixels, and the search for a potential snap point candidate is made within this region.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The tol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapTolerance

void setSnapTolerance(double tol)
                      throws IOException,
                             AutomationException
The snap tolerance, measured in pixels or map units.

Description

SnapTolerance this property is the size of the region bounding the input point location. It is given as a radius, measured in pixels, and the search for a potential snap point candidate is made within this region.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
tol - The tol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapAgentCount

int getSnapAgentCount()
                      throws IOException,
                             AutomationException
The number of active snap agents.

Description

SnapAgentCount returns the number of currently active snap agents.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapAgent

ISnapAgent getSnapAgent(int index)
                        throws IOException,
                               AutomationException
A snap agent at the given index.

Product Availability

Available with ArcGIS Desktop.

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.editor.ISnapAgent
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearSnapAgents

void clearSnapAgents()
                     throws IOException,
                            AutomationException
Removes all snap agents.

Remarks

ClearSnapAgents deactivates all snap agents and sets the SnapAgentCount to zero.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeSnapAgent

void removeSnapAgent(int index)
                     throws IOException,
                            AutomationException
Removes the snap agent at the given index.

Remarks

RemoveSnapAgent removes the Snap Agent represented by the value of the index number passed to the method.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addSnapAgent

void addSnapAgent(ISnapAgent snapAgent)
                  throws IOException,
                         AutomationException
Adds a new snap agent to the snap environment.

Remarks

AddSnapAgent activates and adds to the snap environment any valid snap agent, such as FeatureSnap, AnchorSnap, or PerpendicularSnap.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
snapAgent - A reference to a com.esri.arcgis.editor.ISnapAgent (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.