Constructors

TypeAssistant

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

Fields

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.
public static readonly NumberFormat FormatMax

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.
public static readonly NumberFormat FormatMid

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.
public static readonly NumberFormat FormatMin

Properties

Constructors

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

Icon

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

IsReimplementation

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

Name

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

ReimplementationBase

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

Type

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

ZupportsArea

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

ZupportsAreaCentroid

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

ZupportsBake

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

ZupportsBoundingBox

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

ZupportsClosestPoint

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

ZupportsDeform

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

ZupportsDraw

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

ZupportsFurthestPoint

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

ZupportsLength

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

ZupportsPick

#
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.
public bool ZupportsPick { get; }
ZupportsPick

ZupportsReadWrite

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

ZupportsRoundTripping

#
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.
public bool ZupportsRoundTripping { get; }

ZupportsTransform

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

ZupportsTransformBox

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

ZupportsVolume

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

ZupportsVolumeCentroid

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

Methods

Area

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

AreaCentroid

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

BoundingBox

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

ClosestPoint

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

Copy

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

CreateComparer

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

Deform

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

DescribePrimary

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

DescribeSecondary

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

Draw

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

Format

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

FurthestPoint

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

ITypeAssistant.Area

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

ITypeAssistant.AreaCentroid

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

ITypeAssistant.BoundingBox

#
BoundingBox ITypeAssistant.BoundingBox(
instance
)
BoundingBox
Explicit

ITypeAssistant.ClosestPoint

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

ITypeAssistant.Copy

#
Copy
Explicit

ITypeAssistant.Deform

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

ITypeAssistant.DescribePrimary

#
string ITypeAssistant.DescribePrimary(
pear
)
DescribePrimary
Explicit

ITypeAssistant.DescribeSecondary

#
string ITypeAssistant.DescribeSecondary(
pear
)
DescribeSecondary
Explicit

ITypeAssistant.Draw

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

ITypeAssistant.Format

#
string ITypeAssistant.Format(
instance
)
Format
Explicit

ITypeAssistant.FurthestPoint

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

ITypeAssistant.Hash

#
int ITypeAssistant.Hash(
instance
)
Hash
Explicit

ITypeAssistant.Length

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

ITypeAssistant.ModifyBakeAttributes

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

ITypeAssistant.ModifyBakeAttributes

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

ITypeAssistant.Parse

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

ITypeAssistant.Pick

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

ITypeAssistant.Read

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

ITypeAssistant.Same

#
Same
Explicit

ITypeAssistant.Show

#
Show
Explicit

ITypeAssistant.Sort

#
Sort
Explicit

ITypeAssistant.Test

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

ITypeAssistant.Test

#
bool ITypeAssistant.Test(
instance
)
Test
Explicit

ITypeAssistant.Text

#
Text
Explicit

ITypeAssistant.ToGeometry

#
ToGeometry
Explicit

ITypeAssistant.Transform

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

ITypeAssistant.TransformBox

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

ITypeAssistant.Volume

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

ITypeAssistant.VolumeCentroid

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

ITypeAssistant.Write

#
bool ITypeAssistant.Write(
writer,
location,
instance
)
Write

Hash

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

HashUsingWriteMethod

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

Length

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

ModifyBakeAttributes

#
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.
public virtual ObjectAttributes ModifyBakeAttributes(
Pear<T>
pear,
The pear associated with the attributes.
file,
The Rhino 3dm file into which the geometry will be baked.
initial
The attributes to be used.
)
Modified attributes.

ModifyBakeAttributes

#
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.
public virtual ObjectAttributes ModifyBakeAttributes(
Pear<T>
pear,
The pear associated with the attributes.
document,
The Rhino document into which the geometry will be baked.
initial
The attributes to be used.
)
Modified attributes.

Parse

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

Pick

#
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.
public virtual bool Pick(
Pear<T>
existing,
Existing value to be overwritten, if any.
out Pear<T>
pear
Pear which was picked.
)
True if a value was picked.
Pick

Read

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

RelinkMetaDataFromUserStrings

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

RelinkMetaDataFromUserStrings

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

Same

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

Show

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

Sort

#
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
public virtual int Sort(
T
a,
T
b
)
Sort

Test

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

Test

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

Text

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

ToGeometry

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

Transform

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

TransformBox

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

Volume

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

VolumeCentroid

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

Write

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