GridColorScheme Class Reference

A grid color scheme defines how a grid will be colored. More...

Collaboration diagram for GridColorScheme:
Collaboration graph

Public Member Functions

void ApplyColoringType (ColoringType ColoringType)
 A shortcut to apply new coloring type for each of the breaks of the colors scheme. More...
 
bool ApplyColors (tkColorSchemeType schemeType, ColorScheme scheme, bool gradientWithinCategories)
 Applies specified colors to the exiting breaks of GridColorScheme. More...
 
void ApplyGradientModel (GradientModel GradientModel)
 A shortcut to apply gradient model for each of the breaks of the colors scheme. More...
 
void Clear ()
 Clears all color breaks in the color scheme. More...
 
void DeleteBreak (int Index)
 Deletes the specified color break from the color scheme. More...
 
void Deserialize (string newVal)
 Restores the setings of the grid from the string generated by Grid.Serialize() method. More...
 
GridColorBreak get_Break (int Index)
 Gets a break from the color scheme using the specified index. More...
 
string get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code. More...
 
Vector GetLightSource ()
 Gets the direction the light source is pointing for the color scheme in the form of a vector which originates from the light source. This only applies to hillshaded breaks. More...
 
void InsertAt (int Position, GridColorBreak Break)
 Inserts a break at the specified position of the color scheme. More...
 
void InsertBreak (GridColorBreak BrkInfo)
 Adds a break to the color scheme. More...
 
bool ReadFromFile (string mwlegFilename, string nodeName)
 Reads color scheme from .mwleg XML file. More...
 
string Serialize ()
 Serializes the setting of the grid to the string. More...
 
void SetLightSource (double Azimuth, double Elevation)
 Sets the direction of the light source. More...
 
void UsePredefined (double LowValue, double HighValue, PredefinedColorScheme Preset)
 Loads the values into the color scheme from pre-defined color scheme. More...
 
bool WriteToFile (string mwlegFilename, string gridName="", int bandIndex=1)
 Writes color scheme to the specified file. More...
 

Properties

double AmbientIntensity [get, set]
 Gets or sets the intensity of the ambient lighting for the color scheme. Only applies when creating hillshaded breaks. More...
 
ICallback GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications. More...
 
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object. More...
 
int LastErrorCode [get]
 Retrieves the last error generated in the object. More...
 
double LightSourceAzimuth [get]
 Gets the azimuth, or compass heading of the light source. Only applies to hillshaded breaks. More...
 
double LightSourceElevation [get]
 Gets the elevation of the light source. Only applies to hillshaded breaks. More...
 
double LightSourceIntensity [get, set]
 Gets or sets the intensity of the light source for the color scheme. Only applies to hillshaded breaks. More...
 
uint NoDataColor [get, set]
 The color to use for the color scheme when drawing grid cells with a no-data value. More...
 
int NumBreaks [get]
 Gets the number of color breaks in the color scheme. More...
 

Detailed Description

A grid color scheme defines how a grid will be colored.

A grid color scheme may either contain grid color breaks created by the user, or may use a predefined color scheme.

Member Function Documentation

◆ ApplyColoringType()

void GridColorScheme.ApplyColoringType ( ColoringType  ColoringType)

A shortcut to apply new coloring type for each of the breaks of the colors scheme.

Parameters
ColoringTypeNew coloring type.
New API 4.9.1:
Added in version 4.9.1

◆ ApplyColors()

bool GridColorScheme.ApplyColors ( tkColorSchemeType  schemeType,
ColorScheme  scheme,
bool  gradientWithinCategories 
)

Applies specified colors to the exiting breaks of GridColorScheme.

Parameters
schemeTypeType of the scheme.
schemeColors to apply.
gradientWithinCategoriesIf true gradient within each category will be set.
Returns
True on suceess.
New API 4.9.4:
Added in version 4.9.4

◆ ApplyGradientModel()

void GridColorScheme.ApplyGradientModel ( GradientModel  GradientModel)

A shortcut to apply gradient model for each of the breaks of the colors scheme.

Parameters
GradientModelNew gradient model.
New API 4.9.1:
Added in version 4.9.1

◆ Clear()

void GridColorScheme.Clear ( )

Clears all color breaks in the color scheme.

◆ DeleteBreak()

void GridColorScheme.DeleteBreak ( int  Index)

Deletes the specified color break from the color scheme.

Parameters
IndexThe index of the color break to be removed.

◆ Deserialize()

void GridColorScheme.Deserialize ( string  newVal)

Restores the setings of the grid from the string generated by Grid.Serialize() method.

Parameters
newValThe string with grid settings.

◆ get_Break()

GridColorBreak GridColorScheme.get_Break ( int  Index)

Gets a break from the color scheme using the specified index.

Parameters
IndexThe index of the color break to be returned.
Returns
The color break specified by the index.

◆ get_ErrorMsg()

string GridColorScheme.get_ErrorMsg ( int  ErrorCode)

Retrieves the error message associated with the specified error code.

Parameters
ErrorCodeThe error code for which the error message is required.
Returns
The error message description for the specified error code.

◆ GetLightSource()

Vector GridColorScheme.GetLightSource ( )

Gets the direction the light source is pointing for the color scheme in the form of a vector which originates from the light source. This only applies to hillshaded breaks.

Returns
The direction the light source is pointing represented by a vector.

◆ InsertAt()

void GridColorScheme.InsertAt ( int  Position,
GridColorBreak  Break 
)

Inserts a break at the specified position of the color scheme.

Parameters
PositionThe position to insert the break at.
BreakThe grid color break.

◆ InsertBreak()

void GridColorScheme.InsertBreak ( GridColorBreak  BrkInfo)

Adds a break to the color scheme.

Parameters
BrkInfoThe grid color break.

◆ ReadFromFile()

bool GridColorScheme.ReadFromFile ( string  mwlegFilename,
string  nodeName 
)

Reads color scheme from .mwleg XML file.

Parameters
mwlegFilenameFilename to read color scheme from.
nodeNameThe name of node to read from (usually GridColoringScheme).
Returns
True on success.
New API 4.9.1:
Added in version 4.9.1

◆ Serialize()

string GridColorScheme.Serialize ( )

Serializes the setting of the grid to the string.

Returns
The string with serialized setting of empty string on failure.

◆ SetLightSource()

void GridColorScheme.SetLightSource ( double  Azimuth,
double  Elevation 
)

Sets the direction of the light source.

Parameters
AzimuthThe azimuth heading of the light source. Also known as the compass heading.
ElevationThe elevation of the light source.

◆ UsePredefined()

void GridColorScheme.UsePredefined ( double  LowValue,
double  HighValue,
PredefinedColorScheme  Preset 
)

Loads the values into the color scheme from pre-defined color scheme.

Parameters
LowValueThe lowest value in the grid.
HighValueThe highes value in the grid.
PresetOptional. The pre-defined color scheme to be used. The default is MapWinGIS.PredefinedColorScheme.SummerMountains.

◆ WriteToFile()

bool GridColorScheme.WriteToFile ( string  mwlegFilename,
string  gridName = "",
int  bandIndex = 1 
)

Writes color scheme to the specified file.

Parameters
mwlegFilenameFilename to write color scheme into.
gridNameThe name of the source grid without path (should be located in the same folder). Default value is empty string.
bandIndexBand index the color scheme was created for. Default value is 1.
Returns
True on success.
New API 4.9.1:
Added in version 4.9.1

Property Documentation

◆ AmbientIntensity

double GridColorScheme.AmbientIntensity
getset

Gets or sets the intensity of the ambient lighting for the color scheme. Only applies when creating hillshaded breaks.

◆ GlobalCallback

ICallback GridColorScheme.GlobalCallback
getset

The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.

Deprecated:
v4.9.3 Use GlobalSettings.ApplicationCallback instead.

◆ Key

string GridColorScheme.Key
getset

The key may be used by the programmer to store any string data associated with the object.

◆ LastErrorCode

int GridColorScheme.LastErrorCode
get

Retrieves the last error generated in the object.

◆ LightSourceAzimuth

double GridColorScheme.LightSourceAzimuth
get

Gets the azimuth, or compass heading of the light source. Only applies to hillshaded breaks.

◆ LightSourceElevation

double GridColorScheme.LightSourceElevation
get

Gets the elevation of the light source. Only applies to hillshaded breaks.

◆ LightSourceIntensity

double GridColorScheme.LightSourceIntensity
getset

Gets or sets the intensity of the light source for the color scheme. Only applies to hillshaded breaks.

◆ NoDataColor

uint GridColorScheme.NoDataColor
getset

The color to use for the color scheme when drawing grid cells with a no-data value.

◆ NumBreaks

int GridColorScheme.NumBreaks
get

Gets the number of color breaks in the color scheme.