Class Triangle
The triangle data structure.
Inheritance
System.Object
Triangle
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.Experimental.U2D.TriangleNet.Topology
Syntax
public class Triangle : ITriangle
Constructors
Triangle()
Initializes a new instance of the Triangle class.
Declaration
public Triangle()
Properties
Area
Gets the triangle area constraint.
Declaration
public double Area { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Implements
ID
Gets or sets the triangle id.
Declaration
public int ID { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Implements
Label
Region ID the triangle belongs to.
Declaration
public int Label { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Implements
Methods
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Object.GetHashCode()
GetNeighbor(Int32)
Gets a triangles' neighbor.
Declaration
public ITriangle GetNeighbor(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The neighbor index (0, 1 or 2). |
Returns
Type | Description |
---|---|
ITriangle | The neigbbor opposite of vertex with given index. |
Implements
GetNeighborID(Int32)
Gets the ID of the neighbor triangle at given index.
Declaration
public int GetNeighborID(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The local index (0, 1 or 2). |
Returns
Type | Description |
---|---|
System.Int32 | The neighbor triangle ID. |
Implements
GetSegment(Int32)
Gets a triangles segment.
Declaration
public ISegment GetSegment(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The vertex index (0, 1 or 2). |
Returns
Type | Description |
---|---|
ISegment | The segment opposite of vertex with given index. |
Implements
GetVertex(Int32)
Gets the specified corners vertex.
Declaration
public Vertex GetVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type | Description |
---|---|
Vertex |
Implements
GetVertexID(Int32)
Declaration
public int GetVertexID(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type | Description |
---|---|
System.Int32 |
Implements
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()