Package org.h2gis.functions.spatial.mesh

## Class Triangle

- java.lang.Object
- - org.h2gis.functions.spatial.mesh.Triangle

    public class Triangle
    extends Object

A triangle built from the combination of the 3 vertices index.

Author:
  Nicolas Fortin, UMRAE, Université Gustave Eiffel - Cerema

### Nested Class Summary

Nested Classes
`static class` `Triangle.TriangleBuilder` Generate a triangle from Tinfour structure

### Constructor Summary

Constructors
`Triangle​(int a, int b, int c)` Constructor
`Triangle​(int a, int b, int c, int attribute)` Constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `get​(int id)` Get vertex index
`int` `getA()`
`int` `getAttribute()`
`int` `getB()`
`int` `getC()`
`void` `set​(int id, int index)` Set the vertex index for one of the vertex of the triangle
`void` `setA​(int a)` Set the vertex index for one of the vertex of the triangle
`void` `setB​(int b)` Set the vertex index for one of the vertex of the triangle
`void` `setC​(int c)` Set the vertex index for one of the vertex of the triangle

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Triangle

    public Triangle​(int a,
                    int b,
                    int c,
                    int attribute)

Constructor

Parameters:
  `a` - Vertex index of the first vertex
  `b` - Vertex index of the second vertex
  `c` - Vertex index of the third vertex
  `attribute` - Attribute of the triangle

#### Triangle

    public Triangle​(int a,
                    int b,
                    int c)

Constructor

Parameters:
  `a` - Vertex index of the first vertex
  `b` - Vertex index of the second vertex
  `c` - Vertex index of the third vertex

### Method Detail

#### getA

    public int getA()

Returns:
  Vertex A index

#### get

    public int get​(int id)

Get vertex index

Parameters:
  `id` - Vertex number [0-2]
Returns:
  vertex index

#### getAttribute

    public int getAttribute()

Returns:
  Attribute associated with the triangle Currently 0 if the triangle is not bound to a polygonal constraint, 1 otherwise

#### set

    public void set​(int id,
                    int index)

Set the vertex index for one of the vertex of the triangle

Parameters:
  `id` - Triangle vertex [0-2]
  `index` - Vertex index to set (from the array of coordinates)

#### setA

    public void setA​(int a)

Set the vertex index for one of the vertex of the triangle

Parameters:
  `a` - Vertex index to set (from the array of coordinates)

#### getB

    public int getB()

Returns:
  Vertex B index

#### setB

    public void setB​(int b)

Set the vertex index for one of the vertex of the triangle

Parameters:
  `b` - Vertex index to set (from the array of coordinates)

#### getC

    public int getC()

Returns:
  Vertex C index

#### setC

    public void setC​(int c)

Set the vertex index for one of the vertex of the triangle

Parameters:
  `c` - Vertex index to set (from the array of coordinates)