com.supermap.data
类 GeoText3D

java.lang.Object
  继承者 com.supermap.data.Geometry
      继承者 com.supermap.data.Geometry3D
          继承者 com.supermap.data.GeoText3D

public class GeoText3D
extends Geometry3D

三维文本几何对象类。

该类提供了三维文本几何对象的编辑信息,可以通过设置此类来对三维文本几何对象以及其子对象进行编辑操作。

该类仅在 Windows、Linux 平台版本中支持。

一个三维文本几何对象是由一个或多个部分组成,每个部分称为三维文本几何对象的一个子对象,每个子对象都是一个 TextPart3D 的实例。三维文本几何对象的文字内容是各个子对象的文字内容之和,还可以通过设置各个子对象的放置位置,使一个三维文本几何对象中的各部分文字具有自己的放置风格。同一个三维文本几何对象的所有子对象都使用相同的文本风格,即使用该类的 setTextStyle() 方法定义的文本风格。

注意:

1.三维中的文本采用 BillBoard 技术,文本总是会自动放在最上层显示,始终朝着人,表面和视线垂直,不总是贴地面。

2.该类的对象调用 getGeoModel() 方法无效,即返回值为null。


构造方法摘要
GeoText3D()
          构造一个新的 GeoText3D 对象。
GeoText3D(GeoText3D geoText3D)
          根据指定的 GeoText3D 对象构造一个与其相同的新对象。
GeoText3D(TextPart3D part)
          根据指定的参数来构造一个 GeoText3D 的新对象。
GeoText3D(TextPart3D part, TextStyle textStyle)
          根据指定的参数来构造一个 GeoText3D 的新对象。
 
方法摘要
 int addPart(TextPart3D part)
          在三维文本几何对象中添加子对象。
 GeoText3D clone()
          返回当前 GeoText3D 对象的一个拷贝。
 void dispose()
          释放该对象所占用的资源。
 GeoModel getGeoModel(int slices, int stacks)
          该类不支持该方法。
 TextPart3D getPart(int index)
          返回此 GeoText3D 类实例的指定索引的子对象。
 int getPartCount()
          返回三维文本几何对象的子对象个数。
 Point3D getPosition()
          该类不支持该方法。
 double getRotationX()
          该类不支持该方法。
 double getRotationY()
          该类不支持该方法。
 double getRotationZ()
          该类不支持该方法。
 double getScaleX()
          该类不支持该方法。
 double getScaleY()
          该类不支持该方法。
 double getScaleZ()
          该类不支持该方法。
 GeoStyle getStyle()
          该类不支持该方法。
 java.lang.String getText()
          返回三维文本几何对象的文本字符串。
 TextStyle getTextStyle()
          返回三维文本几何对象的文本风格。
 double getVolume()
          该类不支持该方法。
 boolean hitTest(Point2D point, double tolerance)
          该类不支持该方法。
 int indexOf(TextPart3D part)
          返回指定的子对象在此三维文本几何对象中的索引。
 boolean insertPart(int index, TextPart3D part)
          在三维文本几何对象的指定位置插入一个子对象。
 Geometry mirror(Point2D startPoint, Point2D endPoint)
          该类不支持该方法。
 boolean removePart(int index)
          删除指定索引的子对象。
 void resize(Rectangle2D bounds)
          该类不支持该方法。
 void rotate(Point2D basePoint, double angle)
          该类不支持该方法。
 boolean setPart(int index, TextPart3D part)
          修改指定索引的子对象,即用新的三维文本子对象来替换原来的三维文本子对象。
 void setPosition(Point3D point3D)
          该类不支持该方法。
 void setRotationX(double value)
          该类不支持该方法。
 void setRotationY(double value)
          该类不支持该方法。
 void setRotationZ(double value)
          该类不支持该方法。
 void setScaleX(double value)
          该类不支持该方法。
 void setScaleY(double value)
          该类不支持该方法。
 void setScaleZ(double value)
          该类不支持该方法。
 void setStyle(GeoStyle value)
          该类不支持该方法。
 void setTextStyle(TextStyle textStyle)
          设置三维文本几何对象的文本风格。
 
从类 com.supermap.data.Geometry3D 继承的方法
convertToGeoModel3D, convertToGeoModel3D, getBoundingBox, getInnerPoint3D, getStyle3D, offset, setStyle3D
 
从类 com.supermap.data.Geometry 继承的方法
addCustomGeometryCreatedListener, fromXML, getBounds, getID, getInnerPoint, getType, getVariantID, isEmpty, offset, removeCustomGeometryCreatedListener, setEmpty, setID, toXML
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

GeoText3D

public GeoText3D()
构造一个新的 GeoText3D 对象。


GeoText3D

public GeoText3D(GeoText3D geoText3D)
根据指定的 GeoText3D 对象构造一个与其相同的新对象。

参数:
geoText3D - 指定的 GeoText3D 对象。

GeoText3D

public GeoText3D(TextPart3D part)
根据指定的参数来构造一个 GeoText3D 的新对象。

参数:
part - 给定的三维文本几何对象的子对象。

GeoText3D

public GeoText3D(TextPart3D part,
                 TextStyle textStyle)
根据指定的参数来构造一个 GeoText3D 的新对象。

参数:
part - 给定的三维文本几何对象的子对象。
textStyle - 指定的文本风格。
方法详细信息

getText

public java.lang.String getText()
返回三维文本几何对象的文本字符串。如果该三维文本几何对象有子对象,则其值为子对象的字符串之和。

返回:
三维文本几何对象的文本字符串。

getPartCount

public int getPartCount()
返回三维文本几何对象的子对象个数。

返回:
三维文本几何对象的子对象个数。

getTextStyle

public TextStyle getTextStyle()
返回三维文本几何对象的文本风格。文本风格用于指定文本对象显示时的透明度、缩放比、固定大小、高度和颜色等,目前不支持字体。

其中缩放比例(getFontScale()/setFontScale())与文本固定大小、文本字体高度的关系如下:

1)在屏幕图层中,kml中的文本大小只支持缩放比,与文本字体高度和是否固定大小无关;

2)在三维标签专题图和文本数据集中:

a. 在 setTextStyle 设置为固定大小的情况下,是通过文本字体高度(setFontHeight())来改变文字在场景中显示的大小。此时的缩放比例 (setFontScale())即使设置了也不生效。

b. 在 TextStyle 不固定大小的情况下,是通过缩放比例(setFontScale())来改变文字在场景中的显示的大小。文本字体高度(setFontHeight())即使设置了也不生效。

返回:
三维文本几何对象的文本风格。

setTextStyle

public void setTextStyle(TextStyle textStyle)
设置三维文本几何对象的文本风格。文本风格用于指定文本对象显示时的字体、宽度、高度和颜色等。

参数:
textStyle - 三维文本几何对象的文本风格。

addPart

public int addPart(TextPart3D part)
在三维文本几何对象中添加子对象。

参数:
part - 待添加的三维文本几何对象的子对象。
返回:
添加成功则返回子对象索引,失败时返回-1。

getPart

public TextPart3D getPart(int index)
返回此 GeoText3D 类实例的指定索引的子对象。

参数:
index - 指定的子对象索引。
返回:
指定索引的子对象。
抛出:
java.lang.IndexOutOfBoundsException - 如果 index<0 或 index>= getPartCount()

insertPart

public boolean insertPart(int index,
                          TextPart3D part)
在三维文本几何对象的指定位置插入一个子对象。

参数:
index - 插入的位置,即子对象的索引值。
part - 要插入的子对象。
返回:
插入成功返回 true,否则返回 false。
抛出:
java.lang.IndexOutOfBoundsException - 如果 index <0 或 index>= getPartCount()

removePart

public boolean removePart(int index)
删除指定索引的子对象。

参数:
index - 指定的子对象索引。
返回:
删除成功返回 true,否则返回 false。
抛出:
java.lang.IndexOutOfBoundsException - 如果 index <0 或 index>= getPartCount()

setPart

public boolean setPart(int index,
                       TextPart3D part)
修改指定索引的子对象,即用新的三维文本子对象来替换原来的三维文本子对象。

参数:
index - 指定子对象的索引。
part - 指定的子对象。
返回:
设置成功返回 true,否则返回 false。
抛出:
java.lang.IndexOutOfBoundsException - 如果 index <0 或 index>= getPartCount()

indexOf

public int indexOf(TextPart3D part)
返回指定的子对象在此三维文本几何对象中的索引。

参数:
part - 指定的子对象。
返回:
指定子对象的索引。

dispose

public void dispose()
释放该对象所占用的资源。当调用该方法之后,此对象不再可用。

覆盖:
Geometry 中的 dispose

clone

public GeoText3D clone()
返回当前 GeoText3D 对象的一个拷贝。

覆盖:
java.lang.Object 中的 clone
返回:
通过克隆操作得到的 GeoText3D 对象。

getStyle

public GeoStyle getStyle()
该类不支持该方法。

覆盖:
Geometry3D 中的 getStyle
返回:
几何对象的风格。

setStyle

public void setStyle(GeoStyle value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setStyle
参数:
value - 用来设置几何对象风格的 GeoStyle 对象。
另请参见:
Geometry.offset(double, double)

hitTest

public boolean hitTest(Point2D point,
                       double tolerance)
该类不支持该方法。

覆盖:
Geometry3D 中的 hitTest
参数:
point - 测试点。
tolerance - 容限值,单位与数据集的单位相同。
返回:
测试结果,点中了该几何对象返回 true;否则返回 false。
另请参见:
Point2D

mirror

public Geometry mirror(Point2D startPoint,
                       Point2D endPoint)
该类不支持该方法。

覆盖:
Geometry3D 中的 mirror
参数:
startPoint - 线段的起点。
endPoint - 线段的终点。
返回:
该几何对象关于指定对称的几何对象。
另请参见:
Geometry.offset(double,double)

resize

public void resize(Rectangle2D bounds)
该类不支持该方法。

覆盖:
Geometry3D 中的 resize
参数:
bounds - 调整大小后几何对象的范围。

rotate

public void rotate(Point2D basePoint,
                   double angle)
该类不支持该方法。

覆盖:
Geometry3D 中的 rotate
参数:
basePoint - 旋转的基点。
angle - 旋转的角度,单位为度。

getGeoModel

public GeoModel getGeoModel(int slices,
                            int stacks)
该类不支持该方法。

覆盖:
Geometry3D 中的 getGeoModel
参数:
slices - 横向细分数。
stacks - 纵向细分数。
返回:
三维模型几何对象。

getPosition

public Point3D getPosition()
该类不支持该方法。

覆盖:
Geometry3D 中的 getPosition
返回:
三维几何对象的位置。

setPosition

public void setPosition(Point3D point3D)
该类不支持该方法。

覆盖:
Geometry3D 中的 setPosition
参数:
point3D - 三维几何对象的位置。

getRotationX

public double getRotationX()
该类不支持该方法。

覆盖:
Geometry3D 中的 getRotationX
返回:
三维几何对象沿 X 轴方向的旋转角度。单位为度。

setRotationX

public void setRotationX(double value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setRotationX
参数:
value - 三维几何对象沿 X 轴方向的旋转角度。单位为度。

getRotationY

public double getRotationY()
该类不支持该方法。

覆盖:
Geometry3D 中的 getRotationY
返回:
三维几何对象沿 Y 轴方向的旋转角度。单位为度。

setRotationY

public void setRotationY(double value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setRotationY
参数:
value - 三维几何对象沿 Y 轴方向的旋转角度。单位为度。

getRotationZ

public double getRotationZ()
该类不支持该方法。

覆盖:
Geometry3D 中的 getRotationZ
返回:
三维几何对象沿 Z 轴方向的旋转角度。单位为度。

setRotationZ

public void setRotationZ(double value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setRotationZ
参数:
value - 三维几何对象沿 Z 轴方向的旋转角度。单位为度。

getScaleX

public double getScaleX()
该类不支持该方法。

覆盖:
Geometry3D 中的 getScaleX
返回:
三维几何对象沿 X 轴方向的缩放比例。

setScaleX

public void setScaleX(double value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setScaleX
参数:
value - 三维几何对象沿 X 轴方向的缩放比例。

getScaleY

public double getScaleY()
该类不支持该方法。

覆盖:
Geometry3D 中的 getScaleY
返回:
三维几何对象沿 Y 轴方向的缩放比例。

setScaleY

public void setScaleY(double value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setScaleY
参数:
value - 三维几何对象沿 Y 轴方向的缩放比例。

getScaleZ

public double getScaleZ()
该类不支持该方法。

覆盖:
Geometry3D 中的 getScaleZ
返回:
三维几何对象沿 Z 轴方向的缩放比例。

setScaleZ

public void setScaleZ(double value)
该类不支持该方法。

覆盖:
Geometry3D 中的 setScaleZ
参数:
value - 三维几何对象沿 Z 轴方向的缩放比例。

getVolume

public double getVolume()
该类不支持该方法。

覆盖:
Geometry3D 中的 getVolume
返回:
三维几何对象的体积。单位为立方米。