TypeAssistant<T>
ReferencesNothing matches.
Fundamental abstract, generic implementation of ITypeAssistant. Inherit from this class if you wish to provide functionality for a specific type.
Type parameters:
| T | Type to assist. |
Constructors
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.
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
#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
IsReimplementation
#Gets whether or not this assistant is a type-safe re-implementation of a more generic assistant.
Implements: IsReimplementation
ReimplementationBase
#Gets the base assistant (if any) this assistant is a re-implementation of.
Implements: ReimplementationBase
ZupportsAreaCentroid
#Gets whether this type assistant has support for Area centroid metrics.
Implements: ZupportsAreaCentroid
ZupportsBake
#Gets whether this type assistant has support for geometry baking.
Implements: ZupportsBake
ZupportsBoundingBox
#Gets whether this type assistant has support for BoundingBox metrics.
Implements: ZupportsBoundingBox
ZupportsClosestPoint
#Gets whether this type assistant has support for closest point resolution.
Implements: ZupportsClosestPoint
ZupportsDeform
#Gets whether this type assistant has support for spatial morphs.
Implements: ZupportsDeform
ZupportsDraw
#Gets whether this type assistant has support for geometry display.
Implements: ZupportsDraw
ZupportsFurthestPoint
#Gets whether this type assistant has support for furthest point resolution.
Implements: ZupportsFurthestPoint
ZupportsLength
#Gets whether this type assistant has support for Length metrics.
Implements: ZupportsLength
ZupportsLink
#Gets whether this type assistant has support for geometry referencing.
Implements: ZupportsLink
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.
Implements: ZupportsPick
ZupportsReadWrite
#Gets whether this assistant supports (de)serializing instances of T.
Implements: 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.
Implements: ZupportsRoundTripping
ZupportsTransform
#Gets whether this type assistant has support for transformations.
Implements: ZupportsTransform
ZupportsTransformBox
#Gets whether this type assistant has support for aligned BoundingBox metrics.
Implements: ZupportsTransformBox
ZupportsVolume
#Gets whether this type assistant has support for Volume metrics.
Implements: ZupportsVolume
ZupportsVolumeCentroid
#Gets whether this type assistant has support for Volume centroid metrics.
Implements: ZupportsVolumeCentroid
Methods
Area
#Measure the area of an instance.
AreaCentroid
#Measure the area of an instance.
Parameters:
| instance (T) | Instance to measure. |
| area (out double) | Measured area. |
| centroid (out Point3d) | Area centroid. |
Returns: Success or failure.
Implements: AreaCentroid
ClosestPoint
#Gets the point on an instance closest to a locus point.
Parameters:
| instance (T) | Instance to examine. |
| locus (Point3d) | Locus (search) point. |
| site (out Point3d) | Point on instance closest to locus. |
Returns: Success or failure.
Implements: ClosestPoint
CreateComparer
#Create an equality comparer for this type. It depends on the implementation of Hash() and Same().
Deform
#Morph an instance of T.
Parameters:
| instance (T) | Instance to morph. |
| morph (SpaceMorph) | Morping class. |
Returns: Morphed object.
Implements: 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.
Parameters:
| pear (Pear<T>) | Pear to describe. |
Implements: DescribePrimary
DescribeSecondary
#Give the secondary description of a value. The secondary description may elaborate on the value. This method may always return null.
Parameters:
| pear (Pear<T>) | Pear th describe. |
Implements: DescribeSecondary
Format
#Format an instance partially so that it can be modified via text.
Parameters:
| instance (T) | Instance to format. |
Implements: Format
FurthestPoint
#Gets the point on an instance furthest away from a locus point.
Parameters:
| instance (T) | Instance to examine. |
| locus (Point3d) | Locus (search) point. |
| site (out Point3d) | Point on instance furthest from locus. |
Returns: Success or failure.
Implements: FurthestPoint
Implements: AreaCentroid
Parameters:
| instance (object) |
Implements: BoundingBox
Implements: ClosestPoint
Parameters:
| instance (object) | |
| morph (SpaceMorph) |
Implements: Deform
Parameters:
| pear (IPear) |
Implements: DescribePrimary
Parameters:
| pear (IPear) |
Implements: DescribeSecondary
Parameters:
| pear (IPear) | |
| bag (DisplayBag) |
Implements: Draw
Implements: FurthestPoint
ObjectAttributes ITypeAssistant.ModifyBakeAttributes(IPear pear, File3dm file, ObjectAttributes initial)
Parameters:
| pear (IPear) | |
| file (File3dm) | |
| initial (ObjectAttributes) |
Implements: ModifyBakeAttributes
ObjectAttributes ITypeAssistant.ModifyBakeAttributes(IPear pear, RhinoDoc document, ObjectAttributes initial)
Parameters:
| pear (IPear) | |
| document (RhinoDoc) | |
| initial (ObjectAttributes) |
Implements: ModifyBakeAttributes
Parameters:
| pear (IPear) |
Implements: ToGeometry
Implements: TransformBox
Implements: VolumeCentroid
Hash
#Hash an instance of the object. The default implementation calls GetHash() on the instance.
Parameters:
| instance (T) |
Implements: Hash
HashUsingWriteMethod
#Utility method for hashing a value based on the Write() implementation.
Parameters:
| instance (T) |
Length
#Measure the length of an instance.
Link
#Create a pear from a reference ID. This is primarily used to update Grasshopper data which links to shapes in the Rhino document.
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.
Parameters:
| 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. |
Returns: 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.
Parameters:
| 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. |
Returns: Modified attributes.
Implements: ModifyBakeAttributes
Parse
#Parse a (possibly partial) description of a value.
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.
Read
#Read an instance from a GrasshopperIO archive.
RelinkMetaDataFromUserStrings
#protected MetaData RelinkMetaDataFromUserStrings(MetaData metaOriginal, NameValueCollection userStrings, bool aggressive = true)
Utility method for updating metadata from userstrings after relinking a value.
Parameters:
| 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. |
Returns: Updated metadata.
RelinkMetaDataFromUserStrings
#protected MetaData RelinkMetaDataFromUserStrings(MetaData metaOriginal, ObjectAttributes attributes, bool aggressive = true)
Utility method for updating metadata from userstrings after relinking a value.
Parameters:
| 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. |
Returns: Updated metadata.
Same
#Compare two instances for equality. If not implemented, this method will revert to Write/Read comparison, and then Text comparisons.
Parameters:
| a (T) | |
| b (T) |
Implements: Same
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
Parameters:
| a (T) | |
| b (T) |
Implements: Sort
Test
#Determine the validity of an instance. This method always returns true unless overridden.
Test
#Determine the validity of an instance.
Parameters:
| instance (T) | Instance. |
Returns: True if the instance is valid, false if otherwise.
Implements: 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.
ToGeometry
#Convert a pear into a collection of Rhino compliant geometries. This is used primarily for the standard baking of geometric data.
Parameters:
| pear (Pear<T>) | Pear to convert. |
Returns: An collection of zero or more Rhino document compliant shapes.
Implements: ToGeometry
Volume
#Measure the volume of an instance.
VolumeCentroid
#Measure the volume of an instance.
Parameters:
| instance (T) | Instance to measure. |
| volume (out double) | Measured volume. |
| centroid (out Point3d) | Volume centroid. |
Returns: Success or failure.
Implements: VolumeCentroid
Write
#Write an instance to a GrasshopperIO archive.