类 Shape
- java.lang.Object
-
- org.meteoinfo.shape.Shape
-
- 所有已实现的接口:
java.lang.Cloneable
- 直接已知子类:
ChartText,CubicShape,CylinderShape,PointShape,PolygonShape,PolylineShape
public abstract class Shape extends java.lang.Object implements java.lang.CloneableShape class- 作者:
- Yaqiang Wang
-
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidaddVertice(int vIdx, PointD vertice)Add a verticeShapebuffer(double distance)Get buffer shapejava.lang.Objectclone()ClonevoidcloneValue(Shape other)Clone valuebooleancontains(Shape other)If this shape contains another oneShapeconvexHull()Get convexhull shapebooleancoveredBy(Shape other)If this shape covered by another onebooleancovers(Shape other)If this shape covers another onebooleancrosses(Shape other)Is shapes cross each other or notShapedifference(Shape b)Get difference shapebooleandisjoint(Shape other)If this shape disjoint another onebooleanequals(Shape other)If this shape equals another onestatic Shapegeometry2Shape(org.locationtech.jts.geom.Geometry geo)ExtentgetExtent()Get extentintgetLegendIndex()Get legend indexjava.util.List<? extends PointD>getPoints()Get pointsabstract ShapeTypesgetShapeType()Get shape typedoublegetValue()Get valueShapeintersection(Shape b)Get intersection shapebooleanintersects(Shape other)If this shape intersects another onebooleanisEditing()Get if is editingbooleanisSelected()Get if the shape is selectedbooleanisVisible()Get if visiblevoidmove(double xShift, double yShift)Move the shapevoidmoveVertice(int vIdx, double newX, double newY)Vertice edited updatebooleanoverlaps(Shape other)If this shape overlaps another oneShapereform(Shape line)Reform the shape by a linevoidremoveVerice(int vIdx)Remove a verticevoidreverse()Reverse points directionvoidsetEditing(boolean value)Set if is editingvoidsetExtent(Extent aExtent)Set extentvoidsetLegendIndex(int value)Set legend indexvoidsetPoints(java.util.List<? extends PointD> points)Set pointsvoidsetSelected(boolean isTrue)Set selectedvoidsetValue(double value)Set valuevoidsetVisible(boolean isTrue)Set visiblejava.util.List<Shape>split(Shape line)Split shapeShapesymDifference(Shape b)Get system difference shapeorg.locationtech.jts.geom.GeometrytoGeometry()To geometry methodabstract org.locationtech.jts.geom.GeometrytoGeometry(org.locationtech.jts.geom.GeometryFactory factory)To geometry methodbooleantouches(Shape other)If this shape touches another oneShapeunion(Shape b)Get union shapebooleanwithin(Shape other)If this shape within another one
-
-
-
方法详细资料
-
getShapeType
public abstract ShapeTypes getShapeType()
Get shape type- 返回:
- Shape type
-
isVisible
public boolean isVisible()
Get if visible- 返回:
- is visible or not
-
setVisible
public void setVisible(boolean isTrue)
Set visible- 参数:
isTrue- True or not
-
isSelected
public boolean isSelected()
Get if the shape is selected- 返回:
- Boolean
-
setSelected
public void setSelected(boolean isTrue)
Set selected- 参数:
isTrue- True or not
-
isEditing
public boolean isEditing()
Get if is editing- 返回:
- Boolean
-
setEditing
public void setEditing(boolean value)
Set if is editing- 参数:
value- Boolean
-
getExtent
public Extent getExtent()
Get extent- 返回:
- extent Extent
-
setExtent
public void setExtent(Extent aExtent)
Set extent- 参数:
aExtent- Extent
-
getLegendIndex
public int getLegendIndex()
Get legend index- 返回:
- Legend index
-
setLegendIndex
public void setLegendIndex(int value)
Set legend index- 参数:
value- Legend index
-
getValue
public double getValue()
Get value- 返回:
- Value
-
setValue
public void setValue(double value)
Set value- 参数:
value- Value
-
getPoints
public java.util.List<? extends PointD> getPoints()
Get points- 返回:
- point list
-
setPoints
public void setPoints(java.util.List<? extends PointD> points)
Set points- 参数:
points- point list
-
addVertice
public void addVertice(int vIdx, PointD vertice)Add a vertice- 参数:
vIdx- Vertice indexvertice- The vertice
-
removeVerice
public void removeVerice(int vIdx)
Remove a vertice- 参数:
vIdx- Vertice index
-
moveVertice
public void moveVertice(int vIdx, double newX, double newY)Vertice edited update- 参数:
vIdx- Vertice indexnewX- New XnewY- New Y
-
move
public void move(double xShift, double yShift)Move the shape- 参数:
xShift- X shiftyShift- Y shift
-
reverse
public void reverse()
Reverse points direction
-
toGeometry
public abstract org.locationtech.jts.geom.Geometry toGeometry(org.locationtech.jts.geom.GeometryFactory factory)
To geometry method- 参数:
factory- GeometryFactory- 返回:
- Geometry
-
toGeometry
public org.locationtech.jts.geom.Geometry toGeometry()
To geometry method- 返回:
- Geometry
-
geometry2Shape
public static Shape geometry2Shape(org.locationtech.jts.geom.Geometry geo)
-
intersection
public Shape intersection(Shape b)
Get intersection shape- 参数:
b- Other shape- 返回:
- Intersection shape
-
difference
public Shape difference(Shape b)
Get difference shape- 参数:
b- Other shape- 返回:
- Difference shape
-
symDifference
public Shape symDifference(Shape b)
Get system difference shape- 参数:
b- Other shape- 返回:
- System difference shape
-
buffer
public Shape buffer(double distance)
Get buffer shape- 参数:
distance- Distance- 返回:
- Buffered shape
-
convexHull
public Shape convexHull()
Get convexhull shape- 返回:
- Convexhull shape
-
split
public java.util.List<Shape> split(Shape line)
Split shape- 参数:
line- Split line- 返回:
- Splitted shapes
-
reform
public Shape reform(Shape line)
Reform the shape by a line- 参数:
line- The line- 返回:
- Result shape
-
crosses
public boolean crosses(Shape other)
Is shapes cross each other or not- 参数:
other- Other shape- 返回:
- Cross or not
-
contains
public boolean contains(Shape other)
If this shape contains another one- 参数:
other- Other shape- 返回:
- Contains or not
-
coveredBy
public boolean coveredBy(Shape other)
If this shape covered by another one- 参数:
other- Other shape- 返回:
- Covered by or not
-
covers
public boolean covers(Shape other)
If this shape covers another one- 参数:
other- Other shape- 返回:
- Covers or not
-
disjoint
public boolean disjoint(Shape other)
If this shape disjoint another one- 参数:
other- Other shape- 返回:
- Disjoint or not
-
equals
public boolean equals(Shape other)
If this shape equals another one- 参数:
other- Other shape- 返回:
- Equals or not
-
intersects
public boolean intersects(Shape other)
If this shape intersects another one- 参数:
other- Other shape- 返回:
- Intersects or not
-
overlaps
public boolean overlaps(Shape other)
If this shape overlaps another one- 参数:
other- Other shape- 返回:
- Overlaps or not
-
touches
public boolean touches(Shape other)
If this shape touches another one- 参数:
other- Other shape- 返回:
- Touches or not
-
within
public boolean within(Shape other)
If this shape within another one- 参数:
other- Other shape- 返回:
- Within or not
-
clone
public java.lang.Object clone()
Clone- 覆盖:
clone在类中java.lang.Object- 返回:
- Shape object
-
cloneValue
public void cloneValue(Shape other)
Clone value- 参数:
other- Other shape
-
-