Constructors

TypeAssistant

#
protected TypeAssistant(string name)
Constructor for the base type assistant.
name (string)Name of type. Must be in lower-case, or rather the way it would appear in the middle of a sentence.

Fields

FormatMax

#
public static readonly NumberFormat FormatMax
A number format to be used for a high accuracy. If your formatted string contains only one number, this would be a good choice.

FormatMid

#
public static readonly NumberFormat FormatMid
A number format to be used for a medium accuracy. If your formatted string contains about 3 numbers, this would be a good choice.

FormatMin

#
public static readonly NumberFormat FormatMin
A number format to be used for a low accuracy. If your formatted string contains more than 4 numbers, this would be a good choice.

Properties

Constructors

#
public virtual IEnumerable<string> Constructors { get; }
Enumerate all defined constructors for this type.
Constructors

Icon

#
public virtual IIcon Icon { get; }
Gets the icon (if any) associated with this type.
Icon

IsReimplementation

#
public bool IsReimplementation { get; }
Gets whether or not this assistant is a type-safe re-implementation of a more generic assistant.
IsReimplementation

Name

#
public string Name { get; }
Gets the parameter description associated with this type.
Name

ReimplementationBase

#
public ITypeAssistant ReimplementationBase { get; }
Gets the base assistant (if any) this assistant is a re-implementation of.

Type

#
public Type Type { get; }
Gets the type associated with this assistant.
Type

ZupportsArea

#
public bool ZupportsArea { get; }
Gets whether this type assistant has support for Area metrics.
ZupportsArea

ZupportsAreaCentroid

#
public bool ZupportsAreaCentroid { get; }
Gets whether this type assistant has support for Area centroid metrics.

ZupportsBake

#
public bool ZupportsBake { get; }
Gets whether this type assistant has support for geometry baking.
ZupportsBake

ZupportsBoundingBox

#
public bool ZupportsBoundingBox { get; }
Gets whether this type assistant has support for BoundingBox metrics.

ZupportsClosestPoint

#
public bool ZupportsClosestPoint { get; }
Gets whether this type assistant has support for closest point resolution.

ZupportsDeform

#
public bool ZupportsDeform { get; }
Gets whether this type assistant has support for spatial morphs.
ZupportsDeform

ZupportsDraw

#
public bool ZupportsDraw { get; }
Gets whether this type assistant has support for geometry display.
ZupportsDraw

ZupportsFurthestPoint

#
public bool ZupportsFurthestPoint { get; }
Gets whether this type assistant has support for furthest point resolution.

ZupportsLength

#
public bool ZupportsLength { get; }
Gets whether this type assistant has support for Length metrics.
ZupportsLength

ZupportsPick

#
public bool ZupportsPick { get; }
Gets whether the assistants supports UI for specifying new values. Note that if the Pick(Pear<T>, Pear<T>) method hasn't been overwritten but the ZupportsRoundTripping is true, then values can be specified using the Format(T) and Parse(string, string, Pear<T>) methods.
ZupportsPick

ZupportsReadWrite

#
public bool ZupportsReadWrite { get; }
Gets whether this assistant supports (de)serializing instances of T.
ZupportsReadWrite

ZupportsRoundTripping

#
public bool ZupportsRoundTripping { get; }
Gets whether this assistant supports round-tripping from T to string to T. For this to be true, both Format(T) and Parse(string, string, Pear<T>) must be implemented.

ZupportsTransform

#
public bool ZupportsTransform { get; }
Gets whether this type assistant has support for transformations.
ZupportsTransform

ZupportsTransformBox

#
public bool ZupportsTransformBox { get; }
Gets whether this type assistant has support for aligned BoundingBox metrics.

ZupportsVolume

#
public bool ZupportsVolume { get; }
Gets whether this type assistant has support for Volume metrics.
ZupportsVolume

ZupportsVolumeCentroid

#
public bool ZupportsVolumeCentroid { get; }
Gets whether this type assistant has support for Volume centroid metrics.

Methods

Area

#
public virtual bool Area(T instance, out double area)
Measure the area of an instance.
instance (T)Instance to measure.
area (out double)Measured area.
Success or failure.
Area

AreaCentroid

#
public virtual bool AreaCentroid(T instance, out double area, out Point3d centroid)
Measure the area of an instance.
instance (T)Instance to measure.
area (out double)Measured area.
centroid (out Point3d)Area centroid.
Success or failure.
AreaCentroid

BoundingBox

#
public virtual BoundingBox BoundingBox(T instance)
Gets the world aligned boundingbox for an instance.
instance (T)Instance to measure.
BoundingBox.
BoundingBox

ClosestPoint

#
public virtual bool ClosestPoint(T instance, Point3d locus, out Point3d site)
Gets the point on an instance closest to a locus point.
instance (T)Instance to examine.
locus (Point3d)Locus (search) point.
site (out Point3d)Point on instance closest to locus.
Success or failure.
ClosestPoint

Copy

#
public abstract T Copy(T instance)
Create an exact duplicate of an instance.
instance (T)Instance to duplicate.
Duplicate.
Copy

CreateComparer

#
public IEqualityComparer<T> CreateComparer()
Create an equality comparer for this type. It depends on the implementation of Hash() and Same().

Deform

#
public virtual object Deform(T instance, SpaceMorph morph)
Morph an instance of T.
instance (T)Instance to morph.
morph (SpaceMorph)Morping class.
Morphed object.
Deform

DescribePrimary

#
public abstract string DescribePrimary(Pear<T> pear)
Give the primary description of a value. This does not need to yield a parsable string, the results are meant only for human consumption.
pear (Pear<T>)Pear to describe.
DescribePrimary

DescribeSecondary

#
public virtual string DescribeSecondary(Pear<T> pear)
Give the secondary description of a value. The secondary description may elaborate on the value. This method may always return null.
pear (Pear<T>)Pear th describe.
DescribeSecondary

Draw

#
public virtual void Draw(Pear<T> pear, DisplayBag bag)
Add a value to a display bag.
pear (Pear<T>)
bag (DisplayBag)
Draw

Format

#
public virtual string Format(T instance)
Format an instance partially so that it can be modified via text.
instance (T)Instance to format.
Format

FurthestPoint

#
public virtual bool FurthestPoint(T instance, Point3d locus, out Point3d site)
Gets the point on an instance furthest away from a locus point.
instance (T)Instance to examine.
locus (Point3d)Locus (search) point.
site (out Point3d)Point on instance furthest from locus.
Success or failure.
FurthestPoint
Explicit

ITypeAssistant.Area

#
bool ITypeAssistant.Area(object instance, out double area)
instance (object)
area (out double)
Area
Explicit

ITypeAssistant.AreaCentroid

#
bool ITypeAssistant.AreaCentroid(object instance, out double area, out Point3d centroid)
instance (object)
area (out double)
centroid (out Point3d)
AreaCentroid
Explicit

ITypeAssistant.BoundingBox

#
BoundingBox ITypeAssistant.BoundingBox(object instance)
instance (object)
BoundingBox
Explicit

ITypeAssistant.ClosestPoint

#
bool ITypeAssistant.ClosestPoint(object instance, Point3d locus, out Point3d site)
instance (object)
locus (Point3d)
site (out Point3d)
ClosestPoint
Explicit

ITypeAssistant.Copy

#
instance (object)
Copy
Explicit

ITypeAssistant.Deform

#
object ITypeAssistant.Deform(object instance, SpaceMorph morph)
instance (object)
morph (SpaceMorph)
Deform
Explicit

ITypeAssistant.DescribePrimary

#
string ITypeAssistant.DescribePrimary(IPear pear)
pear (IPear)
DescribePrimary
Explicit

ITypeAssistant.DescribeSecondary

#
string ITypeAssistant.DescribeSecondary(IPear pear)
pear (IPear)
DescribeSecondary
Explicit

ITypeAssistant.Draw

#
void ITypeAssistant.Draw(IPear pear, DisplayBag bag)
pear (IPear)
bag (DisplayBag)
Draw
Explicit

ITypeAssistant.Format

#
string ITypeAssistant.Format(object instance)
instance (object)
Format
Explicit

ITypeAssistant.FurthestPoint

#
bool ITypeAssistant.FurthestPoint(object instance, Point3d locus, out Point3d site)
instance (object)
locus (Point3d)
site (out Point3d)
FurthestPoint
Explicit

ITypeAssistant.Hash

#
int ITypeAssistant.Hash(object instance)
instance (object)
Hash
Explicit

ITypeAssistant.Length

#
bool ITypeAssistant.Length(object instance, out double length)
instance (object)
length (out double)
Length
Explicit

ITypeAssistant.ModifyBakeAttributes

#
ObjectAttributes ITypeAssistant.ModifyBakeAttributes(IPear pear, File3dm file, ObjectAttributes initial)
pear (IPear)
file (File3dm)
initial (ObjectAttributes)
Explicit

ITypeAssistant.ModifyBakeAttributes

#
ObjectAttributes ITypeAssistant.ModifyBakeAttributes(IPear pear, RhinoDoc document, ObjectAttributes initial)
pear (IPear)
document (RhinoDoc)
initial (ObjectAttributes)
Explicit

ITypeAssistant.Parse

#
IResult ITypeAssistant.Parse(string constructor, string text, IPear existing)
constructor (string)
text (string)
existing (IPear)
Parse
Explicit

ITypeAssistant.Pick

#
bool ITypeAssistant.Pick(IPear existing, out IPear pear)
existing (IPear)
pear (out IPear)
Pick
Explicit

ITypeAssistant.Read

#
bool ITypeAssistant.Read(IReader reader, Name location, out object instance)
reader (IReader)
location (Name)
instance (out object)
Read
Explicit

ITypeAssistant.Same

#
a (object)
b (object)
Same
Explicit

ITypeAssistant.Show

#
pear (IPear)
Show
Explicit

ITypeAssistant.Sort

#
a (object)
b (object)
Sort
Explicit

ITypeAssistant.Test

#
bool ITypeAssistant.Test(object instance, out string invalidReason)
instance (object)
invalidReason (out string)
Test
Explicit

ITypeAssistant.Test

#
bool ITypeAssistant.Test(object instance)
instance (object)
Test
Explicit

ITypeAssistant.Text

#
instance (object)
Text
Explicit

ITypeAssistant.ToGeometry

#
pear (IPear)
ToGeometry
Explicit

ITypeAssistant.Transform

#
object ITypeAssistant.Transform(object instance, Transform matrix)
instance (object)
matrix (Transform)
Transform
Explicit

ITypeAssistant.TransformBox

#
BoundingBox ITypeAssistant.TransformBox(object instance, Transform transformation)
instance (object)
transformation (Transform)
TransformBox
Explicit

ITypeAssistant.Volume

#
bool ITypeAssistant.Volume(object instance, out double volume)
instance (object)
volume (out double)
Volume
Explicit

ITypeAssistant.VolumeCentroid

#
bool ITypeAssistant.VolumeCentroid(object instance, out double volume, out Point3d centroid)
instance (object)
volume (out double)
centroid (out Point3d)
VolumeCentroid
Explicit

ITypeAssistant.Write

#
bool ITypeAssistant.Write(IWriter writer, Name location, object instance)
writer (IWriter)
location (Name)
instance (object)
Write

Hash

#
public virtual int Hash(T instance)
Hash an instance of the object. The default implementation calls GetHash() on the instance.
instance (T)
Hash

HashUsingWriteMethod

#
protected int HashUsingWriteMethod(T instance)
Utility method for hashing a value based on the Write() implementation.
instance (T)

Length

#
public virtual bool Length(T instance, out double length)
Measure the length of an instance.
instance (T)Instance to measure.
length (out double)Measured length.
Success or failure.
Length

ModifyBakeAttributes

#
public virtual ObjectAttributes ModifyBakeAttributes(Pear<T> pear, File3dm file, ObjectAttributes initial)
By overriding this method, the type implementor may add modifications to the attributes of objects baked to Rhino files. For example, vectors when baked require an arrowhead to be set at the curve end, and this must be specified via the object attributes.
pear (Pear<T>)The pear associated with the attributes.
file (File3dm)The Rhino 3dm file into which the geometry will be baked.
initial (ObjectAttributes)The attributes to be used.
Modified attributes.

ModifyBakeAttributes

#
public virtual ObjectAttributes ModifyBakeAttributes(Pear<T> pear, RhinoDoc document, ObjectAttributes initial)
By overriding this method, the type implementor may add modifications to the attributes of objects baked to Rhino documents. For example, vectors when baked require an arrowhead to be set at the curve end, and this must be specified via the object attributes.
pear (Pear<T>)The pear associated with the attributes.
document (RhinoDoc)The Rhino document into which the geometry will be baked.
initial (ObjectAttributes)The attributes to be used.
Modified attributes.

Parse

#
public virtual Result<T> Parse(string constructor, string text, Pear<T> existing)
Parse a (possibly partial) description of a value.
constructor (string)Constructor name, if applicable.
text (string)Text to parse.
existing (Pear<T>)Pre-existing instance to modify, may be null.
Parse

Pick

#
public virtual bool Pick(Pear<T> existing, out Pear<T> pear)
Ask the user to specify (or pick) a new value. When this method is invoked, it is assumed that it will start a RhinoGet operation or otherwise pop some kind of UI on the screen.
existing (Pear<T>)Existing value to be overwritten, if any.
pear (out Pear<T>)Pear which was picked.
True if a value was picked.
Pick

Read

#
public virtual bool Read(IReader reader, Name location, out T instance)
Read an instance from a GrasshopperIO archive.
reader (IReader)Deserialization reader.
location (Name)Location of data. Whether the location points to an item or child node is up to the implementer to decide.
instance (out T)Deserialized instance.
Success or failure.
Read

RelinkMetaDataFromUserStrings

#
protected MetaData RelinkMetaDataFromUserStrings(MetaData metaOriginal, NameValueCollection userStrings, bool aggressive = true)
Utility method for updating metadata from userstrings after relinking a value.
metaOriginal (MetaData)Meta data of original value.
userStrings (NameValueCollection)User strings collection.
aggressive (bool = true)If true, all original data except the 'Rhino.Id' and 'Rhino.IdOrigin' will be wiped.
Updated metadata.

RelinkMetaDataFromUserStrings

#
protected MetaData RelinkMetaDataFromUserStrings(MetaData metaOriginal, ObjectAttributes attributes, bool aggressive = true)
Utility method for updating metadata from userstrings after relinking a value.
metaOriginal (MetaData)Meta data of original value.
attributes (ObjectAttributes)Rhino object attributes.
aggressive (bool = true)If true, all original data except the 'Rhino.Id', 'Rhino.IdOrigin', and 'Rhino.Index' will be wiped.
Updated metadata.

Same

#
public virtual bool Same(T a, T b)
Compare two instances for equality. If not implemented, this method will revert to Write/Read comparison, and then Text comparisons.
a (T)
b (T)
Same

Show

#
public virtual IValueDisplay Show(Pear<T> pear)
Create a Grasshopper display proxy.
pear (Pear<T>)(value, meta) pear to display.
Display proxy.
Show

Sort

#
public virtual int Sort(T a, T b)
Compare the sort order of two instances. If not implemented, this will resort to the default comparer as provided by System.Collections.Generic.Comparer.Default
a (T)
b (T)
Sort

Test

#
public virtual bool Test(T instance, out string invalidReason)
Determine the validity of an instance. This method always returns true unless overridden.
instance (T)Instance.
invalidReason (out string)If the instance is not valid, the problem description will be returned here.
True if the instance is valid, false if otherwise.
Test

Test

#
public bool Test(T instance)
Determine the validity of an instance.
instance (T)Instance.
True if the instance is valid, false if otherwise.
Test

Text

#
public virtual Prose.Text Text(T instance)
Create a string which can function as a sorting key for this value. If the value is null, a TypeAssistantServer.NullKey must be returned.
instance (T)Instance.
String to be used as a sorting key.
Text

ToGeometry

#
public virtual IEnumerable<GeometryBase> ToGeometry(Pear<T> pear)
Convert a pear into a collection of Rhino compliant geometries. This is used primarily for the standard baking of geometric data.
pear (Pear<T>)Pear to convert.
An collection of zero or more Rhino document compliant shapes.
ToGeometry

Transform

#
public virtual object Transform(T instance, Transform matrix)
Transform an instance of T.
instance (T)Instance to transform.
matrix (Transform)Transformation matrix.
Transformed object.
Transform

TransformBox

#
public virtual BoundingBox TransformBox(T instance, Transform transformation)
Gets the transformation aligned boundingbox for an instance.
instance (T)
transformation (Transform)
BoundingBox.
TransformBox

Volume

#
public virtual bool Volume(T instance, out double volume)
Measure the volume of an instance.
instance (T)Instance to measure.
volume (out double)Measured volume.
Success or failure.
Volume

VolumeCentroid

#
public virtual bool VolumeCentroid(T instance, out double volume, out Point3d centroid)
Measure the volume of an instance.
instance (T)Instance to measure.
volume (out double)Measured volume.
centroid (out Point3d)Volume centroid.
Success or failure.
VolumeCentroid

Write

#
public virtual bool Write(IWriter writer, Name location, T instance)
Write an instance to a GrasshopperIO archive.
writer (IWriter)Serialization writer.
location (Name)Location of data. Whether the location points to an item or child node is up to the implementer to decide.
instance (T)Instance to write.
Success or failure.
Write