Table of Contents

Class FilteredColorGuide

Namespace
Hi.Coloring
Assembly
HiMech.dll

A color guide that combines a filter color guide with a dictionary color guide.

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

Constructors

FilteredColorGuide()

Initializes a new instance of the FilteredColorGuide class.

public FilteredColorGuide()

FilteredColorGuide(XElement, string, IProgress<object>, Dictionary<string, object>)

Initializes a new instance of the FilteredColorGuide class from XML.

public FilteredColorGuide(XElement src, string baseDirectory, IProgress<object> progress, Dictionary<string, object> colorGuideCtorArgDictionary)

Parameters

src XElement

The XML element containing the color guide data.

baseDirectory string

The base directory for resolving relative paths.

progress IProgress<object>

Progress reporter for diagnostic messages emitted during construction.

colorGuideCtorArgDictionary Dictionary<string, object>

Dictionary containing constructor arguments for color guides.

Properties

DictionaryColorGuide

Gets or sets the dictionary color guide that is used when the filter color guide returns null.

public DictionaryColorGuide DictionaryColorGuide { get; set; }

Property Value

DictionaryColorGuide

FilterColorGuide

Gets or sets the filter color guide that is applied first.

public IColorGuide FilterColorGuide { get; set; }

Property Value

IColorGuide

XName

Name for XML IO.

public static string XName { get; }

Property Value

string

Methods

GetColorGuide()

public IColorGuide GetColorGuide()

Returns

IColorGuide

IColorGuide

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. Larger one takes priority.

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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

factory XFactory