Class QuantityColorGuide
A color guide that maps numeric quantities to colors using a range color rule.
public class QuantityColorGuide : IColorGuide, IMakeXmlSource, IGetColorGuide, IGetRangeColorRule
- Inheritance
-
QuantityColorGuide
- Implements
- Inherited Members
- Extension Methods
Constructors
QuantityColorGuide()
Initializes a new instance of the QuantityColorGuide class.
public QuantityColorGuide()
QuantityColorGuide(string, RangeColorRule)
Initializes a new instance of the QuantityColorGuide class with specified quantity key and range color rule.
public QuantityColorGuide(string quantityKey, RangeColorRule rangeColorRule)
Parameters
quantityKeystringThe key used to retrieve quantity values.
rangeColorRuleRangeColorRuleThe rule that maps numeric values to colors.
QuantityColorGuide(XElement)
Initializes a new instance of the QuantityColorGuide class from XML.
public QuantityColorGuide(XElement src)
Parameters
srcXElementThe XML element containing the color guide data.
Properties
QuantityKey
Gets or sets the key used to retrieve the quantity value.
public string QuantityKey { get; set; }
Property Value
RangeColorRule
Gets or sets the rule that maps numeric values to colors.
public RangeColorRule RangeColorRule { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
GetColorGuide()
Get IColorGuide.
public IColorGuide GetColorGuide()
Returns
GetRangeColorRule()
Gets the range color rule.
public RangeColorRule GetRangeColorRule()
Returns
- RangeColorRule
The range color rule.
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.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
and chains Reg(factory) on dependents. Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory
TryGetRgb(object, out vec3d_t)
Get rgb bystep.
public bool TryGetRgb(object step, out vec3d_t rgb)
Parameters
Returns
- bool
True when this guide has a colour for
step; false when it has none
TryGetRgbWithPriority(object, out vec3d_t, out double)
Get color with the showing priority if the showing area overlapped by shrinking. Only effect on CubeTree.
public bool TryGetRgbWithPriority(object step, out vec3d_t rgb, out double attachmentPriority)
Parameters
stepobjectstep
rgbvec3d_trgb, when the method returns true
attachmentPrioritydoublepriority. Larger one takes priority. Set on either answer.
Returns
- bool
True when this guide has a colour for
step; false when it has none and the caller applies its own default