Show / Hide Table of Contents

    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);
    }
    
    Inheritance
    System.Object
    Element
    GeometricElement
    GridLine
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    GeometricElement.Bounds
    GeometricElement.Transform
    GeometricElement.Material
    GeometricElement.Representation
    GeometricElement.IsElementDefinition
    GeometricElement.ModifyVertexAttributes
    GeometricElement.UpdateRepresentations()
    GeometricElement.UpdateBoundsAndComputeSolid(Boolean)
    GeometricElement.CreateInstance(Transform, String)
    GeometricElement.ToMesh(Boolean)
    GeometricElement.HasGeometry()
    GeometricElement.Intersects(Plane, Dictionary<Guid, List<Polygon>>, Dictionary<Guid, List<Polygon>>, Dictionary<Guid, List<Line>>)
    Element.Id
    Element.Name
    Element.AdditionalProperties
    Element.PropertyChanged
    Element.RaisePropertyChanged(String)
    Element.SetMapping(String, MappingBase)
    Element.GetMapping(String)
    Element.GetMapping<T>(String)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    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.

    Overrides
    GeometricElement.TryToGraphicsBuffers(out List<GraphicsBuffers>, out String, out Nullable<MeshPrimitive.ModeEnum>)

    Implements

    System.ComponentModel.INotifyPropertyChanged

    Extension Methods

    ElementProxyExtensions.Proxy<T>(T, String)
    Identity.AddOverrideIdentity(Element, IOverride)
    Identity.AddOverrideIdentity(Element, String, String, Object)
    Identity.AddOverrideValue(Element, String, Object)
    Identity.OverrideIds<T>(Element, String)