Class RangeColorRule
Defines a rule for mapping numeric values to colors based on a range.
public class RangeColorRule : IMakeXmlSource, IGetRangeColorRule
- Inheritance
-
RangeColorRule
- Implements
- Inherited Members
- Extension Methods
Constructors
RangeColorRule()
Ctor.
public RangeColorRule()
RangeColorRule(double, double, RatioRgbFuncEnum)
Constructor with range and color function specification.
public RangeColorRule(double floor, double ceiling, RatioRgbFuncEnum ratioRgbFuncEnum = RatioRgbFuncEnum.NormalizedPositiveErf)
Parameters
floordoubleThe lower bound of the range.
ceilingdoubleThe upper bound of the range.
ratioRgbFuncEnumRatioRgbFuncEnumThe function to map ratio values to RGB colors.
RangeColorRule(XElement)
Ctor.
public RangeColorRule(XElement src)
Parameters
srcXElementXML
Fields
RatioRgbFuncEnum
The function used to map ratio values to RGB colors.
public RatioRgbFuncEnum RatioRgbFuncEnum
Field Value
Properties
Ceiling
Gets or sets the upper bound of the range.
public double Ceiling { get; set; }
Property Value
Floor
Gets or sets the lower bound of the range.
public double Floor { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
GetRangeColorRule()
Gets the range color rule.
public RangeColorRule GetRangeColorRule()
Returns
- RangeColorRule
The range color rule.
GetRgb(double)
Gets the RGB color for a given value based on the range and color function.
public Vec3d GetRgb(double v)
Parameters
vdoubleThe value to convert to a color.
Returns
- Vec3d
RGB color vector.
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.