igeo
Class IFace

java.lang.Object
  extended by igeo.IFace

public class IFace
extends java.lang.Object

Class of a face of polygon mesh.

Author:
Satoru Sugihara

Field Summary
 boolean deleted
          used in deleting process
 IEdge[] edges
           
 IVec normal
           
 IVertex[] vertices
           
 
Constructor Summary
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
 double area()
           
 void calcNormal()
           
 IVec center()
           
 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
 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)
           
 int indexOf(IEdge e)
           
 void init(IEdge[] e)
           
 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

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

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