Package org.meteoinfo.shape
Class PolylineShape
- java.lang.Object
-
- org.meteoinfo.shape.Shape
-
- org.meteoinfo.shape.PolylineShape
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
CapPolylineShape,CurveLineShape,PolylineErrorShape,PolylineZShape
public class PolylineShape extends Shape implements java.lang.Cloneable
Poyline shape class
-
-
Field Summary
Fields Modifier and Type Field Description int[]partsPart array
-
Constructor Summary
Constructors Constructor Description PolylineShape()ConstructorPolylineShape(Geometry geometry)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVertice(int vIdx, PointD vertice)Add a verticejava.lang.Objectclone()Clonejava.lang.Objectclone_back()voidcloneValue(Shape other)Clone valuedoublegetLength()Get lengthintgetPartIndex(int vIdx)Get part indexintgetPartNum()Get part numberintgetPointNum()Get point numberjava.util.List<? extends PointD>getPoints()Get pointsjava.util.List<? extends Polyline>getPolylines()Get polylinesShapeTypesgetShapeType()Get shape typebooleanisClosed()Check if the polyline shape is closed or notvoidremoveVerice(int vIdx)Remove a verticevoidreverse()Reverse points directionvoidsetPartNum(int value)Set part numbervoidsetPoints(java.util.List<? extends PointD> points)Set pointsvoidsetPolylines(java.util.List<? extends Polyline> polylines)GeometrytoGeometry(GeometryFactory factory)To geometry methodjava.lang.ObjectvalueClone()Value clone-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class org.meteoinfo.shape.Shape
buffer, contains, convexHull, coveredBy, covers, crosses, difference, disjoint, equals, geometry2Shape, getExtent, getLegendIndex, getValue, intersection, intersects, isEditing, isSelected, isVisible, move, moveVertice, overlaps, reform, setEditing, setExtent, setLegendIndex, setSelected, setValue, setVisible, split, symDifference, toGeometry, touches, union, within
-
-
-
-
Constructor Detail
-
PolylineShape
public PolylineShape()
Constructor
-
PolylineShape
public PolylineShape(Geometry geometry)
Constructor- Parameters:
geometry- Geometry
-
-
Method Detail
-
getShapeType
public ShapeTypes getShapeType()
Description copied from class:ShapeGet shape type- Specified by:
getShapeTypein classShape- Returns:
- Shape type
-
toGeometry
public Geometry toGeometry(GeometryFactory factory)
To geometry method- Specified by:
toGeometryin classShape- Parameters:
factory- GeometryFactory- Returns:
- Geometry
-
getPoints
public java.util.List<? extends PointD> getPoints()
Get points
-
setPoints
public void setPoints(java.util.List<? extends PointD> points)
Set points
-
getPartNum
public int getPartNum()
Get part number- Returns:
- Part number
-
setPartNum
public void setPartNum(int value)
Set part number- Parameters:
value- Part number
-
getPointNum
public int getPointNum()
Get point number- Returns:
- Point number
-
getPolylines
public java.util.List<? extends Polyline> getPolylines()
Get polylines- Returns:
- polyline list
-
setPolylines
public void setPolylines(java.util.List<? extends Polyline> polylines)
-
getLength
public double getLength()
Get length- Returns:
- length
-
getPartIndex
public int getPartIndex(int vIdx)
Get part index- Parameters:
vIdx- The vertice index- Returns:
- Part index
-
addVertice
public void addVertice(int vIdx, PointD vertice)Add a vertice- Overrides:
addVerticein classShape- Parameters:
vIdx- Vertice indexvertice- The vertice
-
removeVerice
public void removeVerice(int vIdx)
Remove a vertice- Overrides:
removeVericein classShape- Parameters:
vIdx- Vertice index
-
clone_back
public java.lang.Object clone_back()
-
valueClone
public java.lang.Object valueClone()
Value clone- Returns:
- PolylineShape
-
cloneValue
public void cloneValue(Shape other)
Clone value- Overrides:
cloneValuein classShape- Parameters:
other- Other polyline shape
-
isClosed
public boolean isClosed()
Check if the polyline shape is closed or not- Returns:
- Boolean
-
-