Table of Contents

Class FuncRangeColorGuide

Namespace
Hi.Coloring
Assembly
HiMech.dll

A color guide that uses a function to get a numeric value and maps it to a color using a range color rule.

public class FuncRangeColorGuide : IColorGuide, IMakeXmlSource, IGetColorGuide, IGetRangeColorRule
Inheritance
FuncRangeColorGuide
Implements
Inherited Members
Extension Methods

Constructors

FuncRangeColorGuide(Func<object, double?>, RangeColorRule)

Initializes a new instance of the FuncRangeColorGuide class.

public FuncRangeColorGuide(Func<object, double?> colorIndexFunc, RangeColorRule rangeColorRule)

Parameters

colorIndexFunc Func<object, double?>

The function to get the numeric value for coloring.

rangeColorRule RangeColorRule

The rule that maps numeric values to colors.

FuncRangeColorGuide(XElement, Func<object, double?>)

Initializes a new instance of the FuncRangeColorGuide class from XML.

public FuncRangeColorGuide(XElement src, Func<object, double?> colorIndexFunc)

Parameters

src XElement

The XML element containing the color guide data.

colorIndexFunc Func<object, double?>

The function to get the numeric value for coloring.

Properties

ColorIndexFunc

Gets or sets the function that extracts a numeric value from the input object for coloring.

public Func<object, double?> ColorIndexFunc { get; set; }

Property Value

Func<object, double?>

RangeColorRule

Gets or sets the rule that maps numeric values to colors.

public RangeColorRule RangeColorRule { get; set; }

Property Value

RangeColorRule

XName

Name for XML IO.

public static string XName { get; }

Property Value

string

Methods

GetColorGuide()

public IColorGuide GetColorGuide()

Returns

IColorGuide

IColorGuide

GetRangeColorRule()

Gets the range color rule.

public RangeColorRule GetRangeColorRule()

Returns

RangeColorRule

The range color rule.

GetRgb(object)

Get rgb bystep.

public Vec3d GetRgb(object step)

Parameters

step object

step

Returns

Vec3d

rgb

GetRgbWithPriority(object, out Vec3d, out double)

Get color with the showing priority if the showing area overlapped by shrinking. Only effect on CubeTree.

public void GetRgbWithPriority(object step, out Vec3d rgb, out double attachmentPriority)

Parameters

step object

step

rgb Vec3d

rgb

attachmentPriority double

priority

MakeXmlSource(string, string)

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)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

Returns

XElement

An XML element representing the object's state