Table of Contents

Class DictionaryColorGuide

Namespace
Hi.Coloring
Assembly
HiMech.dll

A color guide that manages a dictionary of color guides and allows selection of one active guide.

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

Constructors

DictionaryColorGuide()

Initializes a new instance of the DictionaryColorGuide class.

public DictionaryColorGuide()

DictionaryColorGuide(DictionaryColorGuide)

Initializes a new instance of the DictionaryColorGuide class by copying from another instance.

public DictionaryColorGuide(DictionaryColorGuide src)

Parameters

src DictionaryColorGuide

The source color guide to copy from.

DictionaryColorGuide(XElement, string, Dictionary<string, object>)

Initializes a new instance of the DictionaryColorGuide class from XML.

public DictionaryColorGuide(XElement src, string baseDirectory, Dictionary<string, object> colorGuideCtorArgDictionary)

Parameters

src XElement

The XML element containing the color guide data.

baseDirectory string

The base directory for resolving relative paths.

colorGuideCtorArgDictionary Dictionary<string, object>

Dictionary containing constructor arguments for color guides.

Properties

KeyToColorGuide

Gets or sets the dictionary mapping keys to color guides.

public Dictionary<string, IColorGuide> KeyToColorGuide { get; set; }

Property Value

Dictionary<string, IColorGuide>

SelectedColorGuide

Gets the currently selected color guide.

public IColorGuide SelectedColorGuide { get; }

Property Value

IColorGuide

SelectedKey

Gets or sets the key of the currently selected color guide.

public string SelectedKey { get; set; }

Property Value

string

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

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

RefreshSelectedColorGuide()

Refreshes the selected color guide based on the current SelectedKey.

public void RefreshSelectedColorGuide()