com.supermap.data
类 GeoCompound
- java.lang.Object
-
- com.supermap.data.InternalHandle
-
- com.supermap.data.InternalHandleDisposable
-
- com.supermap.data.Geometry
-
- com.supermap.data.GeoCompound
-
- 所有已实现的接口:
- IDisposable
public class GeoCompound extends Geometry
-
-
构造器概要
构造器 构造器和说明 GeoCompound()构造一个新的 GeoCompound 对象。GeoCompound(GeoCompound geoCompound)根据给定的 GeoCompound 对象构造一个与其完全相同的新对象。
-
方法概要
所有方法 实例方法 具体方法 限定符和类型 方法和说明 intaddPart(Geometry geometry)向复合几何对象中添加一个子对象。voidadjust(boolean isMinGeometryMovedUp)调整复合几何对象中子对象的叠置顺序。GeoCompoundclone()克隆一个Geometry对象。voiddispose()释放该对象所占用的资源。Geometry[]divide(boolean isTopOnly)分解复合几何对象,复合几何对象的结构类似于树状结构, 如果分解时只分解顶层对象,则返回的几何对象仍然可能存在复合几何对象,否则将不含有复合几何对象。GeometrygetPart(int index)返回复合几何对象中的指定序号的子对象。intgetPartCount()返回构成复合几何对象的子对象的个数。booleaninsertPart(int index, Geometry geometry)向复合几何对象中的指定序号的位置处插入一个子对象。booleanisEmpty()返回是否为空Geometrymirror(Point2D startPoint, Point2D endPoint)返回当前复合几何对象关于指定线段对称的几何对象,即获取复合几何对象的镜像。voidoffset(double dx, double dy)偏移booleanremovePart(int index)删除复合几何对象中的指定序号的子对象。voidrotate(Point2D basePoint, double angle)旋转几何对象voidsetEmpty()清空几何对象booleansetPart(int index, Geometry geometry)用指定的几何对象替换复合几何对象中指定序号处的子对象。-
从类继承的方法 com.supermap.data.Geometry
addCustomGeometryCreatedListener, fromXML, getBounds, getHasM, getID, getInnerPoint, getStyle, getType, getVariantID, hitTest, removeCustomGeometryCreatedListener, resize, setBounds, setHasM, setID, setStyle, toXML
-
-
-
-
构造器详细资料
-
GeoCompound
public GeoCompound()
构造一个新的 GeoCompound 对象。
-
GeoCompound
public GeoCompound(GeoCompound geoCompound)
根据给定的 GeoCompound 对象构造一个与其完全相同的新对象。- 参数:
geoCompound- 给定的 GeoCompound 对象。
-
-
方法详细资料
-
addPart
public int addPart(Geometry geometry)
向复合几何对象中添加一个子对象。- 参数:
geometry- 待添加的子对象,该对象是Geometry类对象。- 返回:
- 成功添加的子对象的序号。
-
getPartCount
public int getPartCount()
返回构成复合几何对象的子对象的个数。- 返回:
- 构成复合几何对象的子对象的个数。
- 默认值:
- 默认值为 0。
-
removePart
public boolean removePart(int index)
删除复合几何对象中的指定序号的子对象。- 参数:
index- 指定的待删除子对象的序号。- 返回:
- 删除成功返回 true; 否则返回 false。
-
getPart
public Geometry getPart(int index)
返回复合几何对象中的指定序号的子对象。- 参数:
index- 指定的复合几何对象子对象的序号。- 返回:
- 成功返回指定序号的子对象,失败返回空值。
-
insertPart
public boolean insertPart(int index, Geometry geometry)向复合几何对象中的指定序号的位置处插入一个子对象。- 参数:
index- 指定的插入的位置,默认值为1。geometry- 待插入的子对象。- 返回:
- 插入成功返回 true; 否则返回 false。
-
setPart
public boolean setPart(int index, Geometry geometry)用指定的几何对象替换复合几何对象中指定序号处的子对象。- 参数:
index- 被替换的子对象的序号,必须大于或者等于0。geometry- 指定的几何对象。- 返回:
- 替换成功返回 true; 否则返回 false。
-
adjust
public void adjust(boolean isMinGeometryMovedUp)
调整复合几何对象中子对象的叠置顺序。- 参数:
isMinGeometryMovedUp- 是否将较小的子对象移到上面。
-
divide
public Geometry[] divide(boolean isTopOnly)
分解复合几何对象,复合几何对象的结构类似于树状结构, 如果分解时只分解顶层对象,则返回的几何对象仍然可能存在复合几何对象,否则将不含有复合几何对象。复合几何对象类的对象的结构是一个树状结构,复合几何对象由多个子对象构成,每一个子对象对应一个
Geometry类对象,因此,复合几何对象的子对象也可以是一个复合几何对象类对象,以此类推,构成了复合几何对象的层层嵌套的树状结构,如下面的示意图,简单地展示了复合几何对象的树状结构。
例子:如果分解下图中的红色矩形框所示的复合几何对象,当设置 isTopOnly 参数为 true 时,则在执行分解操作时,只分解它顶层所含有的子对象,即蓝色矩形框所示层次中的子对象,分解的结果将返回由下图所示的对象1、2、3、4构成的几何对象数组;当设置 isTopOnly 参数为 false 时,分解操作将分解该复合几何对象所有层次内的对象,分解后的几何对象将不包含有复合几何对象。

- 参数:
isTopOnly- 是否只分解顶层对象。该参数为 true 时,表示只分解顶层的对象。- 返回:
- 几何对象数组。
-
clone
public GeoCompound clone()
从类复制的说明:Geometry克隆一个Geometry对象。
-
dispose
public void dispose()
从类复制的说明:Geometry释放该对象所占用的资源。当调用该方法之后,此对象不再可用。- 指定者:
dispose在接口中IDisposable- 指定者:
dispose在类中Geometry
-
isEmpty
public boolean isEmpty()
返回是否为空- 覆盖:
isEmpty在类中Geometry- 返回:
- boolean
- 另请参阅:
Geometry.offset(double, double)
-
rotate
public void rotate(Point2D basePoint, double angle)
旋转几何对象
-
mirror
public Geometry mirror(Point2D startPoint, Point2D endPoint)
返回当前复合几何对象关于指定线段对称的几何对象,即获取复合几何对象的镜像。- 覆盖:
mirror在类中Geometry- 参数:
startPoint- 指定的线段的起点。endPoint- 指定的线段的终点。- 返回:
- 复合几何对象的镜像。
- 另请参阅:
Geometry.offset(double,double)
-
offset
public void offset(double dx, double dy)偏移
-
-
Copyright © 2021–2025 SuperMap. All rights reserved.