LineVisualizer Class
A visualizer that draws features as lines.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public class LineVisualizer : Visualizer
Remarks
A LineVisualizer renders features as lines. It can be applied to line and polygon features, all other feature types are ignored. When applied to a polygon feature, it draws lines both along the outline and all the holes.
The visualizer has properties for setting the line color, width, style, caps and more. Most of these can be set indirectly from attributes of the feature being rendered.
Line rendering in regular 3D layers is limited. Only color, and to some extent, width, is supported. Line styles, fill patterns, caps and joins are ignored. However, in the surface layers of a globe view, line rendering is fully supported.
![]() |
Example
// Sets up highway visualization with a center line.
// The center line will be 2 pixels wide dashed line.
// With an orthogonal offset of 5 pixels a left and right
// bounding line will be visualized.
public static void SetUpHighwayVisualizationWithCenterLine(
VisualizationOperator visualizationOperator)
{
// Create a LineVisualizer for the center line
LineVisualizer centerLineVisualizer = new LineVisualizer();
// Set the condition that the center line visualizers is only applied to RoadClass 1
centerLineVisualizer.Condition = new Condition("RoadClass = 1");
// Set the center line visualizer LengthUnit to pixels (Default is pixels).
centerLineVisualizer.LengthUnit = VisualizerLengthUnit.Pixels;
// Set the center line width to 2 pixels
centerLineVisualizer.Width = 2.0;
// Set the center line style to dashed
centerLineVisualizer.Style = LineStyle.Dashes1;
// Enable anti alias
centerLineVisualizer.AntiAlias = true;
// Set the color to red
centerLineVisualizer.Color = Color.Red;
// Create a LineVisualizer for the left bounding line
LineVisualizer leftBoundingLineVisualizer = new LineVisualizer();
// Set the condition that the bounding line visualizers is only applied to RoadClass 1
leftBoundingLineVisualizer.Condition = new Condition("RoadClass = 1");
// Set the left bounding line visualizer LengthUnit to pixels (Default is pixels).
leftBoundingLineVisualizer.LengthUnit = VisualizerLengthUnit.Pixels;
// Enable anti alias
leftBoundingLineVisualizer.AntiAlias = true;
// Set the color to red
leftBoundingLineVisualizer.Color = Color.Red;
// Set the orthogonal offset to 5 pixels to the left
leftBoundingLineVisualizer.OrthogonalOffset = 5.0;
// Clone the left bounding line visualizer and reuse it as right bounding visualizer
LineVisualizer rightBoundingLineVisualizer = leftBoundingLineVisualizer.Clone() as LineVisualizer;
// Set the orthogonal offset to 5 pixels to the right (-5)
rightBoundingLineVisualizer.OrthogonalOffset = -5.0;
// Add the line visualizers to the visualization operator
using (Guard guard = new Guard())
{
visualizationOperator.Visualizers.Add(centerLineVisualizer);
visualizationOperator.Visualizers.Add(leftBoundingLineVisualizer);
visualizationOperator.Visualizers.Add(rightBoundingLineVisualizer);
}
}
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
ResourceObject
Visualizer
LineVisualizer
Platforms
Windows, Linux, Android
LineVisualizer Members
The LineVisualizer type has the following members.
Constructors
Name | Description |
---|---|
LineVisualizer | Initializes a new instance of the LineVisualizer class. |
Properties
Name | Description |
---|---|
AntiAlias | Gets or sets a flag indicating if antialiasing should be used to remove aliasing artifacts by smoothing the pixels. |
AvoidableByLabels | Gets or sets a value that determines whether a LabelOrganizingLayer can avoid placing labels over the visualization. |
Color | Gets or sets the color of the line. |
Condition | Gets or sets a condition that must evaluate to true if the visualizer shall be applied to a feature. Inherited from Visualizer |
IsDisposed | Gets a value that tells whether the current LineVisualizer has been disposed. Inherited from EngineObject |
LengthUnit | Gets or sets a value specifying how length values are interpreted. |
LineCap | Gets or sets a value specifying how line ends are rendered. |
LineJoin | Gets or sets a value specifying how line joins are rendered. |
Name | Gets or sets the name of the LineVisualizer. Inherited from ResourceObject |
NativeHandle | Gets the native Carmenta Engine kernel object the current LineVisualizer represents. Inherited from EngineObject |
OrthogonalOffset | Gets or sets a value specifying that the line should be rendered a certain distance from the original line. |
Pattern | Gets or sets a fill pattern. |
PatternScale | Gets or sets a value used to scale the pattern symbol. |
PickingSupport | Gets or sets a value specifying how much information is maintained when the visualizer creates a PresentationObject for a feature. Inherited from Visualizer |
RenderingPriority | Get or sets how the visualization is prioritized. |
RingOrientation | Get or sets the desired orientation of polygon rings and closed line features. |
Style | Gets or sets the style used to draw the line. |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
Width | Gets or sets the width of the line. |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Draw | Draws a feature on a drawable. Inherited from Visualizer |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
FindChildObject | Overloaded. Finds the child object with the specified name. Inherited from Visualizer |
GetChildObjects | Overloaded. Gets the child objects of the current object. Inherited from Visualizer |