public CIMTinRenderer CreateRenderer( TinRendererDefinition rendererDefinition )
Public Function CreateRenderer( _ ByVal rendererDefinition As TinRendererDefinition _ ) As CIMTinRenderer
Parameters
- rendererDefinition
- A renderer definition object.
public CIMTinRenderer CreateRenderer( TinRendererDefinition rendererDefinition )
Public Function CreateRenderer( _ ByVal rendererDefinition As TinRendererDefinition _ ) As CIMTinRenderer
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
System.ArgumentException | Cannot create renderer for layer. The renderer definition is invalid. |
System.Exception | Failed to create renderer. There was a processing error. |
// applies to TIN layers only var nodeRendererDef = new TinNodeRendererDefinition(); nodeRendererDef.Description = "Nodes"; nodeRendererDef.Label = "Nodes"; nodeRendererDef.SymbolTemplate = nodeSymbol.MakeSymbolReference(); var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault(); if (tinLayer == null) return; if (tinLayer.CanCreateRenderer(nodeRendererDef)) { CIMTinRenderer renderer = tinLayer.CreateRenderer(nodeRendererDef); if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); }
// applies to TIN layers only var equalBreaksNodeRendererDef = new TinNodeClassBreaksRendererDefinition(); equalBreaksNodeRendererDef.BreakCount = 7; if (tinLayer.CanCreateRenderer(equalBreaksNodeRendererDef)) { CIMTinRenderer renderer = tinLayer.CreateRenderer(equalBreaksNodeRendererDef); if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges)) tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges); }
// applies to TIN layers only var defiendIntervalNodeRendererDef = new TinNodeClassBreaksRendererDefinition(); defiendIntervalNodeRendererDef.ClassificationMethod = ClassificationMethod.DefinedInterval; defiendIntervalNodeRendererDef.IntervalSize = 4; defiendIntervalNodeRendererDef.SymbolTemplate = nodeSymbol.MakeSymbolReference(); if (tinLayer.CanCreateRenderer(defiendIntervalNodeRendererDef)) { CIMTinRenderer renderer = tinLayer.CreateRenderer(defiendIntervalNodeRendererDef); if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges)) tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges); }
// applies to TIN layers only var stdDevNodeRendererDef = new TinNodeClassBreaksRendererDefinition(); stdDevNodeRendererDef.ClassificationMethod = ClassificationMethod.StandardDeviation; stdDevNodeRendererDef.DeviationInterval = StandardDeviationInterval.OneHalf; stdDevNodeRendererDef.ColorRamp = ColorFactory.Instance.GetColorRamp("Cyan to Purple"); if (tinLayer.CanCreateRenderer(stdDevNodeRendererDef)) { CIMTinRenderer renderer = tinLayer.CreateRenderer(stdDevNodeRendererDef); if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges)) tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges); }
// applies to TIN or LAS dataset layers only var edgeRendererDef = new TinEdgeRendererDefintion(); edgeRendererDef.Description = "Edges"; edgeRendererDef.Label = "Edges"; edgeRendererDef.SymbolTemplate = lineSymbol.MakeSymbolReference(); if (surfaceLayer.CanCreateRenderer(edgeRendererDef)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(edgeRendererDef); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges); }
var breaklineRendererDef = new TinBreaklineRendererDefinition(); // use default symbol for regular edge but specific symbols for hard,soft,outside breaklineRendererDef.HardEdgeSymbol = hardEdgeSymbol.MakeSymbolReference(); breaklineRendererDef.SoftEdgeSymbol = softEdgeSymbol.MakeSymbolReference(); breaklineRendererDef.OutsideEdgeSymbol = outsideEdgeSymbol.MakeSymbolReference(); if (surfaceLayer.CanCreateRenderer(breaklineRendererDef)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(breaklineRendererDef); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges); }
var contourDef = new TinContourRendererDefinition(); // now customize with a symbol contourDef.Label = "Contours"; contourDef.SymbolTemplate = contourLineSymbol.MakeSymbolReference(); contourDef.ContourInterval = 6; contourDef.IndexLabel = "Index Contours"; contourDef.IndexSymbolTemplate = indexLineSymbol.MakeSymbolReference(); contourDef.ContourFactor = 4; contourDef.ReferenceHeight = 7; if (surfaceLayer.CanCreateRenderer(contourDef)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(contourDef); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Contours)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Contours); }
var simpleFaceRendererDef = new TinFaceRendererDefinition(); simpleFaceRendererDef.SymbolTemplate = polySymbol.MakeSymbolReference(); if (surfaceLayer.CanCreateRenderer(simpleFaceRendererDef)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(simpleFaceRendererDef); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface); }
var aspectFaceRendererDef = new TinFaceClassBreaksAspectRendererDefinition(); aspectFaceRendererDef.SymbolTemplate = polySymbol.MakeSymbolReference(); // accept default color ramp if (surfaceLayer.CanCreateRenderer(aspectFaceRendererDef)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(aspectFaceRendererDef); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface); }
var slopeFaceClassBreaksEqual = new TinFaceClassBreaksRendererDefinition(TerrainDrawCursorType.FaceSlope); // accept default breakCount, symbolTemplate, color ramp if (surfaceLayer.CanCreateRenderer(slopeFaceClassBreaksEqual)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(slopeFaceClassBreaksEqual); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface); }
var slopeFaceClassBreaksQuantile = new TinFaceClassBreaksRendererDefinition(TerrainDrawCursorType.FaceSlope); slopeFaceClassBreaksQuantile.ClassificationMethod = ClassificationMethod.Quantile; // accept default breakCount, symbolTemplate, color ramp if (surfaceLayer.CanCreateRenderer(slopeFaceClassBreaksQuantile)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(slopeFaceClassBreaksQuantile); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface); }
var elevFaceClassBreaksEqual = new TinFaceClassBreaksRendererDefinition(); // accept default breakCount, symbolTemplate, color ramp if (surfaceLayer.CanCreateRenderer(slopeFaceClassBreaksEqual)) { CIMTinRenderer renderer = surfaceLayer.CreateRenderer(slopeFaceClassBreaksEqual); if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface)) surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface); }
// applies to Terrain layers only var dirtyAreaRendererDef = new TerrainDirtyAreaRendererDefinition(); // accept default labels, symbolTemplate var terrainLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TerrainLayer>().FirstOrDefault(); if (terrainLayer == null) return; if (terrainLayer.CanCreateRenderer(dirtyAreaRendererDef)) { CIMTinRenderer renderer = terrainLayer.CreateRenderer(dirtyAreaRendererDef); if (terrainLayer.CanSetRenderer(renderer, SurfaceRendererTarget.DirtyArea)) terrainLayer.SetRenderer(renderer, SurfaceRendererTarget.DirtyArea); }
// applies to Terrain layers only var terrainPointClassBreaks = new TerrainPointClassBreaksRendererDefinition(); // accept defaults if (terrainLayer.CanCreateRenderer(terrainPointClassBreaks)) { CIMTinRenderer renderer = terrainLayer.CreateRenderer(terrainPointClassBreaks); if (terrainLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) terrainLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); }
// applies to LAS dataset layers only var lasPointsClassificationRendererDef = new LasUniqueValueRendererDefinition(LasAttributeType.Classification); // accept the defaults for color ramp, symbolTemplate, symbol scale factor var lasDatasetLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<LasDatasetLayer>().FirstOrDefault(); if (lasDatasetLayer == null) return; if (lasDatasetLayer.CanCreateRenderer(lasPointsClassificationRendererDef)) { CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(lasPointsClassificationRendererDef); if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); }
// applies to LAS dataset layers only var lasPointsReturnsRendererDef = new LasUniqueValueRendererDefinition(LasAttributeType.ReturnNumber); lasPointsReturnsRendererDef.ModulateUsingIntensity = true; lasPointsReturnsRendererDef.SymbolScaleFactor = 1.0; // accept the defaults for color ramp, symbolTemplate if (lasDatasetLayer.CanCreateRenderer(lasPointsReturnsRendererDef)) { CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(lasPointsReturnsRendererDef); if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); }
// applies to LAS dataset layers only var elevLasStretchRendererDef = new LasStretchRendererDefinition(ArcGIS.Core.CIM.LASStretchAttribute.Elevation); // accept the defaults for color ramp, etc if (lasDatasetLayer.CanCreateRenderer(elevLasStretchRendererDef)) { CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(elevLasStretchRendererDef); if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); } // OR use a stretch renderer with stretchType standard Deviations var elevLasStretchStdDevRendererDef = new LasStretchRendererDefinition(ArcGIS.Core.CIM.LASStretchAttribute.Elevation); elevLasStretchStdDevRendererDef.StretchType = LASStretchType.StandardDeviations; elevLasStretchStdDevRendererDef.NumberOfStandardDeviations = 2; // accept the defaults for color ramp, etc if (lasDatasetLayer.CanCreateRenderer(elevLasStretchStdDevRendererDef)) { CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(elevLasStretchStdDevRendererDef); if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); }
// applies to LAS dataset layers only var lasPointsClassBreaksRendererDef = new LasPointClassBreaksRendererDefinition(); lasPointsClassBreaksRendererDef.ClassificationMethod = ClassificationMethod.NaturalBreaks; lasPointsClassBreaksRendererDef.ModulateUsingIntensity = true; // increase the symbol size by a factor lasPointsClassBreaksRendererDef.SymbolScaleFactor = 1.0; if (lasDatasetLayer.CanCreateRenderer(lasPointsClassBreaksRendererDef)) { CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(lasPointsClassBreaksRendererDef); if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points)) lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points); }
Target Platforms: Windows 11, Windows 10