public TileSharpSource(ILabelOverlapPreventer overlapPreventer, IFeatureCache featureCache, LayerConfig layerConfig) { IsAsync = true; _overlapPreventer = overlapPreventer; _featureCache = featureCache; _layerConfig = layerConfig; }
public FeatureEndpointSelector(FeatureRuntimeCompilationOptions options, IFeatureMetadataProvider metadataProvider, IFeatureCache featureCache, ILogger <FeatureEndpointSelector> logger) { _options = options; _metadataProvider = metadataProvider; _featureCache = featureCache; _logger = logger; }
public Renderer(ILabelOverlapPreventer labelOverlapPreventer, IFeatureCache featureCache) { LabelOverlapPreventer = labelOverlapPreventer; _featureCache = featureCache; _renderers = new Dictionary <Type, RendererPart> { { typeof(LineSymbolizer), new LineRenderer(this) }, { typeof(PointSymbolizer), new PointRenderer(this) }, { typeof(PolygonSymbolizer), new PolygonRenderer(this) }, { typeof(TextSymbolizer), new TextRenderer(this) }, }; }
public static T GetAndCache <T>( IFeatureCache cache, IFeatureCollection features, ref T cachedObject) { cache.CheckFeaturesRevision(); T obj = cachedObject; if (obj == null) { obj = features.Get <T>(); cachedObject = obj; } return(obj); }
public FeatureUpdater(IFeatureCache featureCache, IFeatureChangeTokenProvider featureTokenProvider, IFeatureApplicationPartManager featureAppPartManager, FeatureActionDescriptorChangeProvider actionDescriptorChangeProvider, ILogger <FeatureUpdater> logger) { _featureCache = featureCache; _featureTokenProvider = featureTokenProvider; _featureAppPartManager = featureAppPartManager; _actionDescriptorChangeProvider = actionDescriptorChangeProvider; _logger = logger; _throttlingTimer = new Timer(200) { AutoReset = false // fire once }; _throttlingTimer.Elapsed += StartProcessingUpdates; }
public static T GetOrCreateAndCache <T>( IFeatureCache cache, IFeatureCollection features, Func <IFeatureCollection, T> factory, ref T cachedObject) { cache.CheckFeaturesRevision(); T obj = cachedObject; if (obj == null) { obj = features.Get <T>(); if (obj == null) { obj = factory(features); cachedObject = obj; features.Set(obj); } } return(obj); }
public static T GetOrCreateAndCache <T>( IFeatureCache cache, IFeatureCollection features, HttpRequest request, Func <HttpRequest, T> factory, ref T cachedObject) where T : class { cache.CheckFeaturesRevision(); T obj = cachedObject; if (obj == null) { obj = features.Get <T>(); if (obj == null) { obj = factory(request); cachedObject = obj; features.Set(obj); } } return(obj); }
public void Shutdown() { m_engineeditor = null; m_featureCache = null; }
public bool Snap(ESRI.ArcGIS.Geometry.IGeometry geom, ESRI.ArcGIS.Geometry.IPoint point, double tolerance) { GetFeatureClass(); bool b_setNewFeatureCache = false; if (m_featureClass == null || m_engineeditor == null) { return(false); } if (m_featureClass.ShapeType != esriGeometryType.esriGeometryPoint) { return(false); } //Check if a feature cache has been created. if (!b_setNewFeatureCache) { m_featureCache = new FeatureCache(); b_setNewFeatureCache = true; } //Fill the cache with the geometries. //It is up to the developer to choose an appropriate value //given the map units and the scale at which editing will be undertaken. FillCache(m_featureClass, point, 10000); IProximityOperator proximityOp = point as IProximityOperator; double minDist = tolerance; IPoint cachePt = new PointClass(); IPoint snapPt = new PointClass(); IPolygon outPoly = new PolygonClass(); ITopologicalOperator topoOp; IFeature feature; int Index = 0; for (int Count = 0; Count < m_featureCache.Count; Count++) { feature = m_featureCache.get_Feature(Count); cachePt = feature.Shape as IPoint; topoOp = cachePt as ITopologicalOperator; //Set the buffer distance to an appropriate value //given the map units and data being edited outPoly = topoOp.Buffer(1000) as IPolygon; double Dist = proximityOp.ReturnDistance(outPoly); if (Dist < minDist) { Index = Count; minDist = Dist; } } //Make sure minDist is within the search tolerance. if (minDist >= tolerance) { return(false); } //Retrieve the feature and its part again. feature = m_featureCache.get_Feature(Index); cachePt = feature.Shape as IPoint; topoOp = cachePt as ITopologicalOperator; //Set the buffer distance to an appropriate value //given the map scale and data being edited outPoly = topoOp.Buffer(1000) as IPolygon; proximityOp = outPoly as IProximityOperator; snapPt = proximityOp.ReturnNearestPoint(point, esriSegmentExtension.esriNoExtension); //Since point was passed in ByValue, we have to modify its values instead. //of giving it a new address. point.PutCoords(snapPt.X, snapPt.Y); return(true); }
public bool SnapPoint(IPoint ipoint_0, IPoint ipoint_1) { bool result; if (!this.bool_0) { result = false; } else { double num = this.double_0; if (this._appContext != null && this.esriEngineSnapToleranceUnits_0 == esriEngineSnapToleranceUnits.esriEngineSnapTolerancePixels) { num = this.method_0(this._appContext.MapControl.Map as IActiveView, this.double_0); if (num == 0.0) { num = this.double_0; } } System.Collections.Hashtable hashtable = new System.Collections.Hashtable(); for (int i = 0; i < this.iarray_0.Count; i++) { IEngineSnapAgent engineSnapAgent = (IEngineSnapAgent)this.iarray_0.get_Element(i); IFeatureCache featureCache = null; if (engineSnapAgent is IFeatureSnapAgent) { IFeatureClass featureClass = (engineSnapAgent as IFeatureSnapAgent).FeatureClass; try { featureCache = (hashtable[featureClass] as IFeatureCache); goto IL_10F; } catch { goto IL_10F; } goto IL_C6; IL_E9: (engineSnapAgent as IFeatureSnapAgent).FeatureCache = featureCache; goto IL_F7; IL_10F: if (featureCache != null) { goto IL_E9; } IL_C6: featureCache = new FeatureCache(); featureCache.Initialize(ipoint_1, num); featureCache.AddFeatures(featureClass); hashtable.Add(featureClass, featureCache); goto IL_E9; } IL_F7: if (engineSnapAgent.Snap(ipoint_0, ipoint_1, num)) { result = true; return(result); } } hashtable.Clear(); result = false; } return(result); }
public bool Snap(ESRI.ArcGIS.Geometry.IGeometry geom, ESRI.ArcGIS.Geometry.IPoint point, double tolerance) { GetFeatureClass(); bool b_setNewFeatureCache = false; if (m_featureClass == null || m_engineeditor == null) return false; if (m_featureClass.ShapeType != esriGeometryType.esriGeometryPoint) return false; //Check if a feature cache has been created. if (!b_setNewFeatureCache) { m_featureCache = new FeatureCache(); b_setNewFeatureCache = true; } //Fill the cache with the geometries. //It is up to the developer to choose an appropriate value //given the map units and the scale at which editing will be undertaken. FillCache(m_featureClass, point, 10000); IProximityOperator proximityOp = point as IProximityOperator; double minDist = tolerance; IPoint cachePt = new PointClass(); IPoint snapPt = new PointClass(); IPolygon outPoly = new PolygonClass(); ITopologicalOperator topoOp; IFeature feature; int Index = 0; for (int Count = 0; Count < m_featureCache.Count; Count++) { feature = m_featureCache.get_Feature(Count); cachePt = feature.Shape as IPoint; topoOp = cachePt as ITopologicalOperator; //Set the buffer distance to an appropriate value //given the map units and data being edited outPoly = topoOp.Buffer(1000) as IPolygon; double Dist = proximityOp.ReturnDistance(outPoly); if (Dist < minDist) { Index = Count; minDist = Dist; } } //Make sure minDist is within the search tolerance. if (minDist >= tolerance) return false; //Retrieve the feature and its part again. feature = m_featureCache.get_Feature(Index); cachePt = feature.Shape as IPoint; topoOp = cachePt as ITopologicalOperator; //Set the buffer distance to an appropriate value //given the map scale and data being edited outPoly = topoOp.Buffer(1000) as IPolygon; proximityOp = outPoly as IProximityOperator; snapPt = proximityOp.ReturnNearestPoint(point,esriSegmentExtension.esriNoExtension); //Since point was passed in ByValue, we have to modify its values instead. //of giving it a new address. point.PutCoords(snapPt.X, snapPt.Y); return true; }
public FeatureSnapAgent() { this.ifeatureCache_0 = new FeatureCache(); }