com.esri.arcgis.controls
Interface IEngineSnapEnvironment

All Superinterfaces:
Serializable
All Known Implementing Classes:
EngineEditor

public interface IEngineSnapEnvironment
extends Serializable

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

Description

The IEngineSnapEnvironment interface manages the snap agent collection and the snap tolerance properties.

Product Availability

Available with ArcGIS Engine.

See Also:
IEngineFeatureSnapAgent

Method Summary
 void addSnapAgent(IEngineSnapAgent snapAgent)
          Adds a new snap agent to the snap environment.
 void clearSnapAgents()
          Removes all snap agents.
 IEngineSnapAgent 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.

As an example: there may be several feature snap 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 feature snap conditions and the same point is returned to SnapPoint.

Product Availability

Available with ArcGIS Engine.

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.

Description

SnapToleranceUnits defines the units used to define the radius used by active snap agents. By default The default SnapToleranceUnits is esriSnapTolerancePixels.

Product Availability

Available with ArcGIS Engine.

Returns:
A com.esri.arcgis.controls.esriEngineSnapToleranceUnits 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 Engine.

Parameters:
units - A com.esri.arcgis.controls.esriEngineSnapToleranceUnits 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.

Description

SnapTolerance determines 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. By default SnapTolerance is 7.

Product Availability

Available with ArcGIS Engine.

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.

Product Availability

Available with ArcGIS Engine.

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 Engine.

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

getSnapAgent

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

Product Availability

Available with ArcGIS Engine.

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.controls.IEngineSnapAgent
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.

Description

ClearSnapAgents removes all feature snap agents, but not snap agents such as edit sketch vertices.

Product Availability

Available with ArcGIS Engine.

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.

Description

RemoveSnapAgent removes the feature snap agent at the specified index; this does not apply to non-feature snap agents such as edit sketch vertices.

Product Availability

Available with ArcGIS Engine.

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

addSnapAgent

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

Description

AddSnapAgent activates and adds to the snap environment any valid snap agent. Snap agents which have already been added are not changed by this method. Snap agents are identified by their SnapAgent.Name and GUID.

Product Availability

Available with ArcGIS Engine.

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