PolygonVisualizer.Color Property
Gets or sets the color used to draw the polygons.
Syntax
public AttributeVariable< System.Drawing.Color > Color { get; set; }
Property Value
Default: Green, R: 0 G: 255 B: 0
The color of the polygons.
Remarks
An indirect color attribute variable can be used to create a color from a string attribute.
Example
// Sets up the color table for different vegetation
public static void SetUpVegetationColorTable(PolygonVisualizer polygonVisualizer)
{
// Create a keyed color attribute variable.
// Set the default value to brown.
// This means all vegetation which are missing the Vegetation attribute
// or not Vegetation Soil, Grass, Trees are visualized brown.
KeyedAttributeVariable<Color> keyedColorAttributeVariable =
new KeyedAttributeVariable<Color>("Vegetation", Color.Brown);
// Get the table from the keyed color attribute variable
KeyValueTable<Color> colorTable = keyedColorAttributeVariable.Table;
// Set the color sandyBrown for Vegetation = Soil
colorTable.Add("Soil", Color.SandyBrown);
// Set the color light green for Vegetation = Grass
colorTable.Add("Grass", Color.LightGreen);
// Set the color dark green for Vegetation = Trees
colorTable.Add("Trees", Color.DarkGreen);
// This property is a member of a type that might be referred to by a View
// or a GlobeView, either directly or indirectly through other objects, which means
// that you must use the Guard class to take the global configuration lock when it
// is modified to synchronize access with any running Carmenta Engine threads.
using (Guard guard = new Guard())
{
// Set the color table in the polygon visualizer
polygonVisualizer.Color = keyedColorAttributeVariable;
}
}
Platforms
Windows, Linux, Android