Show / Hide Table of Contents

    Class ModelText

    A collection of text tags which are visible in 3D.

    Examples
    var squareSize = 25.0;
    
    var texts = new List<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)>();
    var dir = Vector3.YAxis.Negate();
    
    for (var x = 0.0; x < squareSize; x += 1.0)
    {
        for (var y = 0.0; y < squareSize; y += 1.0)
        {
            var c = new Color(x / squareSize, y / squareSize, 0.0, 1.0);
            texts.Add((new Vector3(x, y), dir, Vector3.XAxis, $"[{x},{y}]", c));
        }
    }
    
    // Create a model text object.
    var modelText = new ModelText(texts, FontSize.PT36, 30);
    
    Inheritance
    System.Object
    Element
    GeometricElement
    MeshElement
    ModelText
    Implements
    System.ComponentModel.INotifyPropertyChanged
    ITessellate
    Inherited Members
    MeshElement._mesh
    MeshElement.Mesh
    MeshElement.Tessellate(Mesh, Transform, Color)
    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>>)
    GeometricElement.TryToGraphicsBuffers(List<GraphicsBuffers>, String, Nullable<MeshPrimitive.ModeEnum>)
    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 ModelText : MeshElement, INotifyPropertyChanged, ITessellate

    Constructors

    ModelText(IList<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, String text, Nullable<Color> color)>, FontSize, Double)

    Create a set of text

    Declaration
    public ModelText(IList<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)> texts, FontSize fontSize, double scale = 10)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<System.ValueTuple<Vector3, Vector3, Vector3, System.String, System.Nullable<Color>>> texts

    A collection of text data objects which specify the location, direction, and content of the text.

    FontSize fontSize

    The font size of the text.

    System.Double scale

    An additional scale to apply to the size of the text. Fonts will be drawn at the real world equivalent of 72 dpi at scale=1.0.

    Properties

    FontSize

    The font size of the model text.

    Declaration
    public FontSize FontSize { get; set; }
    Property Value
    Type Description
    FontSize

    Scale

    An additional scale to apply to the size of the text. Fonts will be drawn at the real world equivalent of 72 dpi at scale=1.0.

    Declaration
    public double Scale { get; set; }
    Property Value
    Type Description
    System.Double

    Texts

    A collection of text data objects which specify the location, direction, content, and color of the text.

    Declaration
    public IList<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)> Texts { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IList<System.ValueTuple<Vector3, Vector3, Vector3, System.String, System.Nullable<Color>>>

    Implements

    System.ComponentModel.INotifyPropertyChanged
    ITessellate

    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)