Class DictionaryColorGuide
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
DictionaryColorGuideThe 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
XElementThe XML element containing the color guide data.
baseDirectory
stringThe 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
SelectedColorGuide
Gets the currently selected color guide.
public IColorGuide SelectedColorGuide { get; }
Property Value
SelectedKey
Gets or sets the key of the currently selected color guide.
public string SelectedKey { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
GetColorGuide()
Get IColorGuide.
public IColorGuide GetColorGuide()
Returns
GetRgb(object)
Get rgb bystep
.
public Vec3d GetRgb(object step)
Parameters
step
objectstep
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
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
stringThe base directory for resolving relative paths
relFile
stringThe 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()