igeo.gui
Class ISubsurfaceMesh

java.lang.Object
  extended by igeo.gui.ISubsurfaceMesh

public class ISubsurfaceMesh
extends java.lang.Object

Rectangular cell of a surface with or without trim curve. This class is used by ISubsurfaceMesh to create drawable polygon mesh of NURBS surface.

Author:
Satoru Sugihara
See Also:
ISurfaceMesh

Nested Class Summary
static class ISubsurfaceMesh.EdgePoint
           
static class ISubsurfaceMesh.EdgePointComparator
           
static class ISubsurfaceMesh.SubsurfaceMatrix
           
 
Field Summary
 boolean outerTrimAdded
           
static double subsurfaceResolution
           
 java.util.ArrayList<IVec2[]> trimCurves
           
 java.util.ArrayList<IVec2[]> trimLoops
           
 double u1
           
 double u2
           
 int uindex
           
 double v1
           
 double v2
           
 int vindex
           
 
Constructor Summary
ISubsurfaceMesh(int uidx, int vidx)
           
ISubsurfaceMesh(int uidx, int vidx, double[] uvals, double[] vvals)
           
ISubsurfaceMesh(int uidx, int vidx, double u1, double u2, double v1, double v2)
           
 
Method Summary
 void addIfNoClosePoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts, ISubsurfaceMesh.EdgePoint pt, double resolutionDistance)
           
 void addTrimCurve(IVec2[] trimCrv)
           
 void addTrimLineAtBottomLeft(IVec2 pt1, IVec2 pt2)
           
 void addTrimLineAtBottomRight(IVec2 pt1, IVec2 pt2)
           
 void addTrimLineAtTopLeft(IVec2 pt1, IVec2 pt2)
           
 void addTrimLineAtTopRight(IVec2 pt1, IVec2 pt2)
           
 void addTrimLoop(IVec2[] trimLoop, boolean isOuterTrim)
           
 void addTrimPolyline(java.util.ArrayList<IVec2> polyline)
           
 void addUTrimLine(IVec2 pt1, IVec2 pt2)
           
 void addVTrimLine(IVec2 pt1, IVec2 pt2)
           
 boolean equals(int uidx, int vidx)
           
 ISubsurfaceMesh.EdgePoint extractEndPoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts, IVec2[] polyline)
           
 IVec2[] extractLoop(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts, ISubsurfaceMesh.EdgePoint loopStartPt)
           
 ISubsurfaceMesh.EdgePoint findStartPoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts)
           
 IVec2[][] getDefaultTriangles()
           
 java.util.ArrayList<ISubsurfaceMesh.EdgePoint> getNextStartPoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts, ISubsurfaceMesh.EdgePoint endPt, ISubsurfaceMesh.EdgePoint loopStartPt)
           
 IVec2[][] getTriangles()
           
static IVec2[][] getTrianglesOfQuadrilateral(IVec2[] pts)
           
 IVec2 intersectOnBottom(IVec2 linePt1, IVec2 linePt2)
           
 IVec2 intersectOnLeft(IVec2 linePt1, IVec2 linePt2)
           
 IVec2 intersectOnRight(IVec2 linePt1, IVec2 linePt2)
           
 IVec2 intersectOnTop(IVec2 linePt1, IVec2 linePt2)
           
 IVec2 intersectWithEdge(IVec2 pointInside, IVec2 pointOutside)
           
 boolean isCrossingBottom(IVec2 pt1, IVec2 pt2)
           
 boolean isCrossingLeft(IVec2 pt1, IVec2 pt2)
           
 boolean isCrossingRight(IVec2 pt1, IVec2 pt2)
           
 boolean isCrossingTop(IVec2 pt1, IVec2 pt2)
           
 boolean isCrossingXLine(IVec2 pt1, IVec2 pt2, double yOfXLine)
           
 boolean isCrossingYLine(IVec2 pt1, IVec2 pt2, double xOfYLine)
           
 boolean isDefaultTrim(IVec2[] pts)
           
 boolean isInside(IVec2 pt)
           
static boolean isOuterLoop(IVec2[] loop)
           
protected  boolean isPointBottomEdge(IVec2 pt)
           
protected  boolean isPointLeftEdge(IVec2 pt)
           
protected  boolean isPointOnAnyEdge(IVec2 pt)
           
protected  boolean isPointRightEdge(IVec2 pt)
           
 boolean isPointsOnlyTouchingEdge(java.util.ArrayList<IVec2> polyline)
           
protected  boolean isPointTopEdge(IVec2 pt)
           
static IVec2[] removeDuplicatedPoints(IVec2[] pts)
           
 void removeDuplicatedPointsInLoops()
           
 void setupLoop()
          create loop out of trimCurves and rectangular boundary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subsurfaceResolution

public static double subsurfaceResolution

uindex

public int uindex

vindex

public int vindex

u1

public double u1

u2

public double u2

v1

public double v1

v2

public double v2

outerTrimAdded

public boolean outerTrimAdded

trimCurves

public java.util.ArrayList<IVec2[]> trimCurves

trimLoops

public java.util.ArrayList<IVec2[]> trimLoops
Constructor Detail

ISubsurfaceMesh

public ISubsurfaceMesh(int uidx,
                       int vidx,
                       double u1,
                       double u2,
                       double v1,
                       double v2)

ISubsurfaceMesh

public ISubsurfaceMesh(int uidx,
                       int vidx,
                       double[] uvals,
                       double[] vvals)

ISubsurfaceMesh

public ISubsurfaceMesh(int uidx,
                       int vidx)
Method Detail

addTrimCurve

public void addTrimCurve(IVec2[] trimCrv)

addTrimLoop

public void addTrimLoop(IVec2[] trimLoop,
                        boolean isOuterTrim)

isPointsOnlyTouchingEdge

public boolean isPointsOnlyTouchingEdge(java.util.ArrayList<IVec2> polyline)

addTrimPolyline

public void addTrimPolyline(java.util.ArrayList<IVec2> polyline)
Parameters:
polyline - The first and the last points in polyline is outside of the region. Others are inside. The size of polyline needs to be more than 3.

addUTrimLine

public void addUTrimLine(IVec2 pt1,
                         IVec2 pt2)

addVTrimLine

public void addVTrimLine(IVec2 pt1,
                         IVec2 pt2)

addTrimLineAtBottomLeft

public void addTrimLineAtBottomLeft(IVec2 pt1,
                                    IVec2 pt2)

addTrimLineAtBottomRight

public void addTrimLineAtBottomRight(IVec2 pt1,
                                     IVec2 pt2)

addTrimLineAtTopLeft

public void addTrimLineAtTopLeft(IVec2 pt1,
                                 IVec2 pt2)

addTrimLineAtTopRight

public void addTrimLineAtTopRight(IVec2 pt1,
                                  IVec2 pt2)

intersectOnLeft

public IVec2 intersectOnLeft(IVec2 linePt1,
                             IVec2 linePt2)

intersectOnRight

public IVec2 intersectOnRight(IVec2 linePt1,
                              IVec2 linePt2)

intersectOnBottom

public IVec2 intersectOnBottom(IVec2 linePt1,
                               IVec2 linePt2)

intersectOnTop

public IVec2 intersectOnTop(IVec2 linePt1,
                            IVec2 linePt2)

isCrossingXLine

public boolean isCrossingXLine(IVec2 pt1,
                               IVec2 pt2,
                               double yOfXLine)

isCrossingYLine

public boolean isCrossingYLine(IVec2 pt1,
                               IVec2 pt2,
                               double xOfYLine)

isCrossingLeft

public boolean isCrossingLeft(IVec2 pt1,
                              IVec2 pt2)

isCrossingRight

public boolean isCrossingRight(IVec2 pt1,
                               IVec2 pt2)

isCrossingBottom

public boolean isCrossingBottom(IVec2 pt1,
                                IVec2 pt2)

isCrossingTop

public boolean isCrossingTop(IVec2 pt1,
                             IVec2 pt2)

isInside

public boolean isInside(IVec2 pt)

isPointOnAnyEdge

protected boolean isPointOnAnyEdge(IVec2 pt)

isPointLeftEdge

protected boolean isPointLeftEdge(IVec2 pt)

isPointRightEdge

protected boolean isPointRightEdge(IVec2 pt)

isPointBottomEdge

protected boolean isPointBottomEdge(IVec2 pt)

isPointTopEdge

protected boolean isPointTopEdge(IVec2 pt)

intersectWithEdge

public IVec2 intersectWithEdge(IVec2 pointInside,
                               IVec2 pointOutside)
Parameters:
pointInside - pointInside needs to be inside the subsurface region
pointOutside - pointOutside needs to be inside the subsurface region

equals

public boolean equals(int uidx,
                      int vidx)

addIfNoClosePoint

public void addIfNoClosePoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts,
                              ISubsurfaceMesh.EdgePoint pt,
                              double resolutionDistance)

setupLoop

public void setupLoop()
create loop out of trimCurves and rectangular boundary


findStartPoint

public ISubsurfaceMesh.EdgePoint findStartPoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts)

extractEndPoint

public ISubsurfaceMesh.EdgePoint extractEndPoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts,
                                                 IVec2[] polyline)

extractLoop

public IVec2[] extractLoop(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts,
                           ISubsurfaceMesh.EdgePoint loopStartPt)

getNextStartPoint

public java.util.ArrayList<ISubsurfaceMesh.EdgePoint> getNextStartPoint(java.util.ArrayList<ISubsurfaceMesh.EdgePoint> edgePts,
                                                                        ISubsurfaceMesh.EdgePoint endPt,
                                                                        ISubsurfaceMesh.EdgePoint loopStartPt)

getDefaultTriangles

public IVec2[][] getDefaultTriangles()

isDefaultTrim

public boolean isDefaultTrim(IVec2[] pts)

isOuterLoop

public static boolean isOuterLoop(IVec2[] loop)

getTrianglesOfQuadrilateral

public static IVec2[][] getTrianglesOfQuadrilateral(IVec2[] pts)

removeDuplicatedPoints

public static IVec2[] removeDuplicatedPoints(IVec2[] pts)

removeDuplicatedPointsInLoops

public void removeDuplicatedPointsInLoops()

getTriangles

public IVec2[][] getTriangles()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object