|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object igeo.gui.IPolyline2D
public class IPolyline2D
2D polyline geometry to assist graphic classes of curves and surfaces.
Nested Class Summary | |
---|---|
static class |
IPolyline2D.Intersection
|
static class |
IPolyline2D.XComparator
|
static class |
IPolyline2D.YComparator
|
Field Summary | |
---|---|
boolean |
closed
|
IVec2 |
max
|
IVec2 |
min
|
IVec2[] |
pts
|
Constructor Summary | |
---|---|
IPolyline2D()
|
|
IPolyline2D(int num)
|
|
IPolyline2D(IPolyline2D pl)
|
|
IPolyline2D(IVec2 pt)
|
|
IPolyline2D(IVec2[] pts)
|
|
IPolyline2D(IVec2 pt1,
IVec2 pt2)
|
Method Summary | |
---|---|
void |
add(IVec2 pt)
|
void |
append(IPolyline2D l)
|
void |
append(IPolyline2D l,
boolean reverseDir)
|
void |
append(IVec2[] pts2)
|
void |
append(IVec2[] pts2,
boolean reverseDir)
|
void |
checkBoundary()
|
void |
close()
|
IPolyline2D |
dup()
|
IVec2 |
end()
|
IVec2[] |
get()
|
IVec2 |
get(int i)
|
IVec2 |
getMaxBoundary()
|
IVec2 |
getMinBoundary()
|
static IPolyline2D.Intersection[] |
getPairsInsidePolygon(IPolyline2D.Intersection[] pts,
IVec2[] polygon,
boolean xOrY)
|
int |
indexOf(IVec2 pt)
|
void |
insert(int idx,
IVec2 pt)
|
IVec2[] |
intersect(IPolyline2D line)
|
IPolyline2D.Intersection[] |
intersectPolylineAndXLine(boolean inside,
double y)
gets intersection point with IPolyline2D instance and adjacent points |
IPolyline2D.Intersection[] |
intersectPolylineAndYLine(boolean inside,
double x)
gets intersection point with IPolyline2D instance and adjacent points |
static IVec2I |
intersectXEdgeAndXLine(IVec2I pt1,
IVec2I pt2,
IVec2I pt3,
IVec2I pt4,
IVec2I intersectPt,
boolean normalDir,
boolean inside)
when pt2 and pt3 are on X line, get a point which is inside/outisde intersection pt1 and pt4 can be null |
static IVec2I |
intersectYEdgeAndYLine(IVec2I pt1,
IVec2I pt2,
IVec2I pt3,
IVec2I pt4,
IVec2I intersectPt,
boolean normalDir,
boolean inside)
when pt2 and pt3 are on y line, get a point which is inside/outisde intersection pt1 and pt4 can be null |
boolean |
isClosed()
|
boolean |
isNormalPositive()
|
static boolean |
isNormalPositive(IVec2I[] pts,
boolean close)
checking if the direction of closed polygon normal is positive towards z direction or not direction follows right screw law. |
static IPolyline2D |
join(IPolyline2D[] lines,
boolean close)
join polylines without checking end points but removing end point of each line replaced with next start point |
int |
num()
|
void |
open()
|
void |
removeDuplicatedPoints()
|
void |
removeStraightPoints()
|
void |
reverse()
|
void |
set(int i,
IVec2 pt)
|
void |
set(int i,
IVec2I pt)
|
IVec2 |
start()
|
static double |
sumOfExteriorAngles(IVec2I[] pts,
boolean close)
|
java.lang.String |
toString()
|
static IPolyline2D[] |
xLineInside(double y,
IPolyline2D[] outlines,
IPolyline2D[] holes)
|
static IPolyline2D[] |
yLineInside(double x,
IPolyline2D[] outlines,
IPolyline2D[] holes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public IVec2[] pts
public boolean closed
public IVec2 min
public IVec2 max
Constructor Detail |
---|
public IPolyline2D()
public IPolyline2D(int num)
public IPolyline2D(IVec2[] pts)
public IPolyline2D(IVec2 pt1, IVec2 pt2)
public IPolyline2D(IVec2 pt)
public IPolyline2D(IPolyline2D pl)
Method Detail |
---|
public IPolyline2D dup()
public int num()
public IVec2 get(int i)
public IVec2 start()
public IVec2 end()
public IVec2[] get()
public void set(int i, IVec2I pt)
public void set(int i, IVec2 pt)
public int indexOf(IVec2 pt)
public void checkBoundary()
public IVec2 getMinBoundary()
public IVec2 getMaxBoundary()
public boolean isClosed()
public void close()
public void open()
public void add(IVec2 pt)
public void insert(int idx, IVec2 pt)
public void append(IPolyline2D l)
public void append(IPolyline2D l, boolean reverseDir)
public void append(IVec2[] pts2)
public void append(IVec2[] pts2, boolean reverseDir)
public void reverse()
public static IPolyline2D join(IPolyline2D[] lines, boolean close)
public IVec2[] intersect(IPolyline2D line)
public void removeStraightPoints()
public void removeDuplicatedPoints()
public static IPolyline2D.Intersection[] getPairsInsidePolygon(IPolyline2D.Intersection[] pts, IVec2[] polygon, boolean xOrY)
public static IPolyline2D[] yLineInside(double x, IPolyline2D[] outlines, IPolyline2D[] holes)
public static IPolyline2D[] xLineInside(double y, IPolyline2D[] outlines, IPolyline2D[] holes)
public static IVec2I intersectXEdgeAndXLine(IVec2I pt1, IVec2I pt2, IVec2I pt3, IVec2I pt4, IVec2I intersectPt, boolean normalDir, boolean inside)
pt1
- first point of polylinept2
- second point of polyline; pt2 and pt3 are both on the same xpt3
- third point of polyline; pt2 and pt3 are both on the same xpt4
- fourth point of polylineintersectPt
- intersecting point between pt2 and pt3normalDir
- direction of closing polygon if it's turning right screw direction or notinside
- getting inner or outer intersection point depending on normalDirpublic static IVec2I intersectYEdgeAndYLine(IVec2I pt1, IVec2I pt2, IVec2I pt3, IVec2I pt4, IVec2I intersectPt, boolean normalDir, boolean inside)
pt1
- first point of polylinept2
- second point of polyline; pt2 and pt3 are both on the same ypt3
- third point of polyline; pt2 and pt3 are both on the same ypt4
- fourth point of polylineintersectPt
- intersecting point between pt2 and pt3normalDir
- direction of closing polygon if it's turning right screw direction or notinside
- getting inner or outer intersection point depending on normalDirpublic IPolyline2D.Intersection[] intersectPolylineAndXLine(boolean inside, double y)
public IPolyline2D.Intersection[] intersectPolylineAndYLine(boolean inside, double x)
public static double sumOfExteriorAngles(IVec2I[] pts, boolean close)
public static boolean isNormalPositive(IVec2I[] pts, boolean close)
public boolean isNormalPositive()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |