com.supermap.realspace

类 Theme3DLabel

  • 所有已实现的接口:
    IDisposable


    public class Theme3DLabel
    extends Theme3D
    三维标签专题图类。三维标签专题图用文本的形式在三维图层上直接显示属性表中的数据,其实质就是对图层的标注。三维标签专题图的标注可以是数字、字母与文字,例如:河流、湖泊、海洋、山脉、城镇、村庄等地理名称,高程、等值线数值、河流流速、公路段里程、航海线里程等。支持粗体、斜体、加下划线和加删除线的文字扩展。

    在三维标签专题图中,你可以为所有的标签都设置统一的显示风格来显示。

    示范代码:
    以下代码示范了如何制作三维标签专题图,并显示在三维场景中。
     public void TestThemeLabel3D(DatasetVector targetDataset,
                    String labelExpression, Scene sceneObject) {
            // 进行三维场景的设置
            sceneObject.getAtmosphere().setVisible(true);
     
            // 生成三维标签专题图并显示在三维场景中
            Theme3DLabel theme3DLabel = new Theme3DLabel();
            theme3DLabel.setLabelExpression(labelExpression);
            TextStyle textStyle = new TextStyle();
            textStyle.setForeColor(Color.PINK);
            textStyle.setFontScale(0.8);
            textStyle.setOpaqueRate(70);
            theme3DLabel.setUniformStyle(textStyle);
            Layer3DDataset layer3DDatasetLabel = sceneObject.getLayers().add(
                            targetDataset, themeLabel3D, true);
            layer3DDatasetLabel.updateData();
            sceneObject.refresh();
     
     }
     
    • 构造器详细资料

      • Theme3DLabel

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

        public Theme3DLabel(Theme3DLabel themeLabel3D)
        根据给定的 Theme3DLabel 对象构造一个与其完全相同的新对象。
        参数:
        themeLabel3D - 给定的 Theme3DLabel 对象。
    • 方法详细资料

      • getLabelExpression

        public String getLabelExpression()
        返回标注字段表达式。
        返回:
        标注字段表达式。
        默认值:
        默认值为一个空的字符串。
      • setLabelExpression

        public void setLabelExpression(String value)
        设置标注字段表达式。
        参数:
        value - 指定标注字段表达式。
      • getUniformStyle

        public TextStyle getUniformStyle()
        返回统一文本风格。

        目前三维标签专题图中的文本风格只支持颜色(ForeColor),缩放比例(FontScale)和透明度(OpaqueRate),其他的都不支持。

        返回:
        统一文本风格。
        默认值:
        默认值为 {Alignment=TopLeft,BackColor=Color [A=255, R=0, G=0,B=0],BackOpaque=False,Bold=False,FontHeight=6,FontWidth=0,ForeColor=Color [A=255, R=255, G=255,B=255],IsSizeFixed=False,Italic=False,Outline=False,Rotation=0,Shadow=False,Strikeout=False,Underline=False,Weight=0}。
      • setUniformStyle

        public void setUniformStyle(TextStyle style)
        设置统一文本风格。

        目前三维标签专题图中的文本风格只支持颜色(ForeColor),缩放比例(FontScale)和透明度(OpaqueRate),其他的都不支持。

        参数:
        style - 指定统一文本风格。
      • getNumericPrecision

        public int getNumericPrecision()
        返回标签的小数值精度。
        返回:
        返回标签的小数值精度。
      • setNumericPrecision

        public void setNumericPrecision(int value)
        设置标签的小数值精度。
        参数:
        value - 标签的小数值精度。
      • dispose

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

        public void setIsCustomStyle(boolean bcustom)
      • isCustomStyle

        public boolean isCustomStyle()
      • toString

        public String toString()
        从类复制的说明: Theme3D
        输出三维专题图格式化字符串。

        格式化字符串提供三维专题图的相关设置信息,与 XML 字符串不同的是,格式化字符串不可导入显示三维专题图,只用于提供三维专题图的相关信息。

        指定者:
        toString 在类中 Theme3D
        返回:
        三维专题图的格式化字符串。

Copyright © 2021–2024 SuperMap. All rights reserved.