igeo

## Class IFace

- java.lang.Object
- - igeo.IFace

-     public class IFace
      extends java.lang.Object

  Class of a face of polygon mesh.
  Author:
    Satoru Sugihara

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IColor` | `clr`
    `boolean` | `deleted` used in deleting process
    `IEdge[]` | `edges`
    `boolean` | `invalid`
    `IVec` | `normal`
    `IVertex[]` | `vertices`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IFace(IEdge[] e)`
    `IFace(IEdge e1, IEdge e2, IEdge e3)`
    `IFace(IEdge e1, IEdge e2, IEdge e3, IEdge e4)`
    `IFace(IFace f)` Copis a face but shareing same vertices and edges with the original
    `IFace(IVertex[] v)`
    `IFace(IVertex v1, IVertex v2, IVertex v3)`
    `IFace(IVertex v1, IVertex v2, IVertex v3, IVertex v4)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `area()`
    `void` | `calcNormal()`
    `IVec` | `center()`
    `IColor` | `clr()`
    `IFace` | `clr(java.awt.Color c)`
    `IFace` | `clr(java.awt.Color c, double alpha)`
    `IFace` | `clr(java.awt.Color c, float alpha)`
    `IFace` | `clr(java.awt.Color c, int alpha)`
    `IFace` | `clr(double dgray)`
    `IFace` | `clr(double dgray, double dalpha)`
    `IFace` | `clr(double dr, double dg, double db)`
    `IFace` | `clr(double dr, double dg, double db, double da)`
    `IFace` | `clr(float fgray)`
    `IFace` | `clr(float fgray, float falpha)`
    `IFace` | `clr(float fr, float fg, float fb)`
    `IFace` | `clr(float fr, float fg, float fb, float fa)`
    `IFace` | `clr(IColor c)`
    `IFace` | `clr(IColor c, double alpha)` to set color, with alpha value overwritten
    `IFace` | `clr(IColor c, float alpha)` to set color, with alpha value overwritten
    `IFace` | `clr(IColor c, int alpha)` to set color, with alpha value overwritten
    `IFace` | `clr(IFace f)`
    `IFace` | `clr(int gray)`
    `IFace` | `clr(int gray, int alpha)`
    `IFace` | `clr(int r, int g, int b)`
    `IFace` | `clr(int r, int g, int b, int a)`
    `IFace` | `clr(IObject o)`
    `boolean` | `contains(IEdge e)` checks if the edge is inside face's edges array
    `boolean` | `contains(IVertex v)`
    `void` | `del()`
    `double` | `dist(IVecI pt)` calculate closest distance to face taking normal into consideration.
    `IFace` | `dup()`
    `IEdge` | `edge(int i)`
    `int` | `edgeNum()`
    `static boolean` | `eq(double v1, double v2)`
    `boolean` | `eq(IFace face)`
    `void` | `flipNormal()`
    `IVertex[]` | `getAdjacentVertices(IVertex v1, IVertex v2)`
    `IVec` | `getAverageNormal()` average normal
    `IVec[]` | `getBoundary()`
    `IVec` | `getCenter()` alias of center
    `IColor` | `getColor()`
    `IEdge` | `getEdge(int i)`
    `IEdge` | `getEdge(IVertex v1, IVertex v2)`
    `IEdge` | `getOtherEdge(IEdge e)`
    `IEdge` | `getOtherEdge(IVertex v)`
    `IEdge[]` | `getOtherEdges(IEdge e)`
    `IEdge[]` | `getOtherEdges(IVertex v)`
    `IEdge[]` | `getOtherEdges(IVertex v1, IVertex v2, IVertex... otherVtx)` returns edges which aren't a link between any two of given vertex variable vtx.
    `IVertex` | `getOtherVertex(IEdge e)`
    `IVertex` | `getOtherVertex(IVertex v1, IVertex v2)`
    `IVertex[]` | `getOtherVertices(IVertex v)`
    `IEdge` | `getSharedEdge(IFace f)`
    `IVertex[]` | `getSharedVertices(IFace f)`
    `IVertex` | `getVertex(int i)`
    `IFace` | `hsb(double dh, double ds, double db)`
    `IFace` | `hsb(double dh, double ds, double db, double da)`
    `IFace` | `hsb(float h, float s, float b)`
    `IFace` | `hsb(float h, float s, float b, float a)`
    `int` | `indexOf(IEdge e)`
    `void` | `init(IEdge[] e)`
    `boolean` | `isValid()`
    `boolean` | `loopDir(IEdge edge)` direction of edge based on the sequence of vertices array inside a face
    `IVec` | `nml()` returns normal.
    `IVec` | `normal()` alias of nml()
    `boolean` | `onFace(IEdge e)` checks if the edge is located on the edge of the face even if it's not inside face's edges array
    `void` | `replaceEdge(IEdge oldEdge, IEdge newEdge)`
    `void` | `replaceVertex(IVertex oldVertex, IVertex newVertex)`
    `boolean` | `sameLoopDir(IEdge e1, IEdge e2)`
    `void` | `setNormal(IVec n)`
    `java.util.ArrayList<java.lang.Object>` | `triangulate(boolean triangulateDirection, IMeshType creator)`
    `java.util.ArrayList<java.lang.Object>` | `triangulateAtCenter(IMeshType creator)`
    `IVertex` | `vertex(int i)`
    `int` | `vertexNum()`

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

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

- - ### Field Detail

    - #### vertices

          public IVertex[] vertices

    - #### edges

          public IEdge[] edges

    - #### normal

          public IVec normal

    - #### deleted

          public boolean deleted

      used in deleting process

    - #### invalid

          public boolean invalid

    - #### clr

          public IColor clr

  - ### Constructor Detail

    - #### IFace

          public IFace(IEdge[] e)

    - #### IFace

          public IFace(IEdge e1,
               IEdge e2,
               IEdge e3)

    - #### IFace

          public IFace(IEdge e1,
               IEdge e2,
               IEdge e3,
               IEdge e4)

    - #### IFace

          public IFace(IVertex[] v)

    - #### IFace

          public IFace(IVertex v1,
               IVertex v2,
               IVertex v3)

    - #### IFace

          public IFace(IVertex v1,
               IVertex v2,
               IVertex v3,
               IVertex v4)

    - #### IFace

          public IFace(IFace f)

      Copis a face but shareing same vertices and edges with the original

  - ### Method Detail

    - #### isValid

          public boolean isValid()

    - #### init

          public void init(IEdge[] e)

    - #### dup

          public IFace dup()

    - #### getVertex

          public IVertex getVertex(int i)

    - #### vertex

          public IVertex vertex(int i)

    - #### getEdge

          public IEdge getEdge(int i)

    - #### edge

          public IEdge edge(int i)

    - #### vertexNum

          public int vertexNum()

    - #### edgeNum

          public int edgeNum()

    - #### getEdge

          public IEdge getEdge(IVertex v1,
                      IVertex v2)

    - #### getOtherEdges

          public IEdge[] getOtherEdges(IVertex v1,
                              IVertex v2,
                              IVertex... otherVtx)

      returns edges which aren't a link between any two of given vertex variable vtx. matching only one is fine to be returned.

    - #### getOtherEdges

          public IEdge[] getOtherEdges(IVertex v)

    - #### getOtherEdge

          public IEdge getOtherEdge(IVertex v)

    - #### getOtherEdges

          public IEdge[] getOtherEdges(IEdge e)

    - #### getOtherEdge

          public IEdge getOtherEdge(IEdge e)

    - #### getOtherVertex

          public IVertex getOtherVertex(IVertex v1,
                               IVertex v2)

    - #### getOtherVertex

          public IVertex getOtherVertex(IEdge e)

    - #### getOtherVertices

          public IVertex[] getOtherVertices(IVertex v)

    - #### getSharedVertices

          public IVertex[] getSharedVertices(IFace f)

    - #### getSharedEdge

          public IEdge getSharedEdge(IFace f)

    - #### getAdjacentVertices

          public IVertex[] getAdjacentVertices(IVertex v1,
                                      IVertex v2)

    - #### loopDir

          public boolean loopDir(IEdge edge)

      direction of edge based on the sequence of vertices array inside a face
      Returns:
        true if it's same with vertices array sequence, otherwise false and also if edge is not included inside face, false.

    - #### sameLoopDir

          public boolean sameLoopDir(IEdge e1,
                            IEdge e2)

    - #### center

          public IVec center()

    - #### getCenter

          public IVec getCenter()

      alias of center

    - #### del

          public void del()

    - #### contains

          public boolean contains(IVertex v)

    - #### contains

          public boolean contains(IEdge e)

      checks if the edge is inside face's edges array

    - #### onFace

          public boolean onFace(IEdge e)

      checks if the edge is located on the edge of the face even if it's not inside face's edges array

    - #### indexOf

          public int indexOf(IEdge e)

    - #### replaceVertex

          public void replaceVertex(IVertex oldVertex,
                           IVertex newVertex)

    - #### replaceEdge

          public void replaceEdge(IEdge oldEdge,
                         IEdge newEdge)

    - #### area

          public double area()

    - #### nml

          public IVec nml()

      returns normal. if null, calculate average normal

    - #### normal

          public IVec normal()

      alias of nml()

    - #### getAverageNormal

          public IVec getAverageNormal()

      average normal

    - #### calcNormal

          public void calcNormal()

    - #### setNormal

          public void setNormal(IVec n)

    - #### flipNormal

          public void flipNormal()

    - #### triangulate

          public java.util.ArrayList<java.lang.Object> triangulate(boolean triangulateDirection,
                                                          IMeshType creator)

    - #### triangulateAtCenter

          public java.util.ArrayList<java.lang.Object> triangulateAtCenter(IMeshType creator)

    - #### eq

          public static boolean eq(double v1,
                   double v2)

    - #### eq

          public boolean eq(IFace face)

    - #### getBoundary

          public IVec[] getBoundary()

    - #### dist

          public double dist(IVecI pt)

      calculate closest distance to face taking normal into consideration. if input point is different side of normal vector, it returns negative value

    - #### clr

          public IColor clr()

    - #### clr

          public IFace clr(IColor c)

    - #### clr

          public IFace clr(IColor c,
                  int alpha)

      to set color, with alpha value overwritten

    - #### clr

          public IFace clr(IColor c,
                  float alpha)

      to set color, with alpha value overwritten

    - #### clr

          public IFace clr(IColor c,
                  double alpha)

      to set color, with alpha value overwritten

    - #### clr

          public IFace clr(IObject o)

    - #### clr

          public IFace clr(IFace f)

    - #### clr

          public IFace clr(java.awt.Color c)

    - #### clr

          public IFace clr(java.awt.Color c,
                  int alpha)

    - #### clr

          public IFace clr(java.awt.Color c,
                  float alpha)

    - #### clr

          public IFace clr(java.awt.Color c,
                  double alpha)

    - #### getColor

          public IColor getColor()

      Returns:
        returns whatever Color of any graphics member. (first found)

    - #### clr

          public IFace clr(int gray)

    - #### clr

          public IFace clr(double dgray)

    - #### clr

          public IFace clr(float fgray)

    - #### clr

          public IFace clr(int gray,
                  int alpha)

    - #### clr

          public IFace clr(double dgray,
                  double dalpha)

    - #### clr

          public IFace clr(float fgray,
                  float falpha)

    - #### clr

          public IFace clr(int r,
                  int g,
                  int b)

    - #### clr

          public IFace clr(double dr,
                  double dg,
                  double db)

    - #### clr

          public IFace clr(float fr,
                  float fg,
                  float fb)

    - #### clr

          public IFace clr(int r,
                  int g,
                  int b,
                  int a)

    - #### clr

          public IFace clr(double dr,
                  double dg,
                  double db,
                  double da)

    - #### clr

          public IFace clr(float fr,
                  float fg,
                  float fb,
                  float fa)

    - #### hsb

          public IFace hsb(double dh,
                  double ds,
                  double db,
                  double da)

    - #### hsb

          public IFace hsb(float h,
                  float s,
                  float b,
                  float a)

    - #### hsb

          public IFace hsb(double dh,
                  double ds,
                  double db)

    - #### hsb

          public IFace hsb(float h,
                  float s,
                  float b)