Class GridLine
An architectural or structural gridline.
Examples
var gridData = new List<(string name, Vector3 origin)>() {
("A", new Vector3()),
("B", new Vector3(10, 0, 0)),
("C", new Vector3(20, 0, 0)),
("D", new Vector3(30, 0, 0)),
};
var texts = new List<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)>();
var radius = 1;
var material = new Material("Red", Colors.Red);
foreach (var (name, origin) in gridData)
{
var gridline = new GridLine
{
Name = name,
Curve = new Line(origin, origin + new Vector3(25, 25, 0)),
Material = material,
Radius = radius
};
gridline.AddTextToCollection(texts, Colors.Black);
this.Model.AddElement(gridline);
}
Implements
Inherited Members
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
public class GridLine : GeometricElement, INotifyPropertyChanged
Fields
ExtensionBeginning
How far to extend the gridline from the beginning to the start of the circle.
Declaration
public double ExtensionBeginning
Field Value
Type | Description |
---|---|
System.Double |
ExtensionEnd
How far to extend the gridline past the end of the circle.
Declaration
public double ExtensionEnd
Field Value
Type | Description |
---|---|
System.Double |
Radius
Radius of the gridline head.
Declaration
public double Radius
Field Value
Type | Description |
---|---|
System.Double |
Properties
Curve
Curve that runs from the start of the gridline to its end.
Declaration
public BoundedCurve Curve { get; set; }
Property Value
Type | Description |
---|---|
BoundedCurve |
Geometry
The polyline that runs from the start of the gridline to its end.
Declaration
[Obsolete("We now use 'Curve' instead.")]
public Polyline Geometry { get; set; }
Property Value
Type | Description |
---|---|
Polyline |
Line
Line that runs from the start of the gridline to its end.
Declaration
[Obsolete("We now use 'Curve' instead.")]
public Line Line { get; set; }
Property Value
Type | Description |
---|---|
Line |
Methods
AddTextToCollection(List<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, String text, Nullable<Color> color)>, Nullable<Color>)
Add gridline's text data to a text collection for insertion into ModelText.
Declaration
public void AddTextToCollection(List<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)> texts, Color? color = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.ValueTuple<Vector3, Vector3, Vector3, System.String, System.Nullable<Color>>> | texts | Collection of texts to add to. |
System.Nullable<Color> | color | Color for this text. |
GetCircleTransform()
Get the transform of the circle created by the gridline.
Declaration
public Transform GetCircleTransform()
Returns
Type | Description |
---|---|
Transform |
TryToGraphicsBuffers(out List<GraphicsBuffers>, out String, out Nullable<MeshPrimitive.ModeEnum>)
Get graphics buffers and other metadata required to modify a GLB.
Declaration
public override bool TryToGraphicsBuffers(out List<GraphicsBuffers> graphicsBuffers, out string id, out MeshPrimitive.ModeEnum? mode)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GraphicsBuffers> | graphicsBuffers | |
System.String | id | |
System.Nullable<glTFLoader.Schema.MeshPrimitive.ModeEnum> | mode |
Returns
Type | Description |
---|---|
System.Boolean | True if there is graphicsbuffers data applicable to add, false otherwise. Out variables should be ignored if the return value is false. |