com.supermap.realspace
类 Layer3DSettingGrid

java.lang.Object
  继承者 com.supermap.realspace.Layer3DSetting
      继承者 com.supermap.realspace.Layer3DSettingGrid

public class Layer3DSettingGrid
extends Layer3DSetting

栅格数据集三维图层扩展设置类。

该类用于设置栅格数据集作为三维图层加入到三维窗口中所使用的一些显示风格或者返回相关的信息。

示例:
以下代码示范了如何设置三维场景中的栅格数据集的样式风格。

假设打开了一个工作空间 workspace 对象,工作空间中存在一个数据源 datasource 对象,该数据源中存在一个名为 DEM25 的数据集。

 public void layer3DSettingGridDemo() {
            // 获取名称为 DEM25 的栅格数据集
            DatasetGrid dataset = (DatasetGrid)datasource.getDatasets().get("DEM25");
            SceneControl m_sceneControl = new SceneControl();
            // 向场景中添加栅格数据集
            Layer3D m_layer = m_sceneControl.getScene().getLayers().add(dataset, new Layer3DSettingGrid(), true);

            // 构造一个Colors对象并将各种颜色值添加到其中
            Colors colors = new Colors();
            colors.add(Color.BLUE);
            colors.add(Color.BLACK);
            colors.add(Color.GRAY);
            colors.add(Color.ORANGE);

            // 获取该图层的扩展设置信息
            Layer3DSettingGrid layer3DSettingGrid = (Layer3DSettingGrid)m_layer.getAdditionalSetting();
            // 设置颜色表
            layer3DSettingGrid.setColorTable(colors);
            // 设置指定栅格值及其颜色和是否透明
            layer3DSettingGrid.setSpecialValue(100);
            layer3DSettingGrid.setSpecialValueColor(Color.PINK);
            layer3DSettingGrid.setSpecialValueTransparent(false);

            // 更新图层
            m_layer.updateData();
    }
 

构造方法摘要
Layer3DSettingGrid()
          构造一个新的 Layer3DSettingGrid 对象。
Layer3DSettingGrid(Layer3DSettingGrid layer3DSettingGrid)
          根据给定的 Layer3DSettingGrid 对象构造一个与其完全相同的新对象。
 
方法摘要
 Colors getColorTable()
          返回颜色表,即一个颜色集合对象。
 double[] getGridValueTable()
          返回栅格值表。
 int getOpaqueRate()
          返回栅格图层的不透明度。
 double getSpecialValue()
          返回图层的指定栅格值。
 java.awt.Color getSpecialValueColor()
          返回栅格数据集指定栅格值的颜色。
 java.awt.Color getTransparentColor()
          返回透明色。
 int getTransparentColorTolerance()
          返回透明色容限,容限范围是(0~255)。
 boolean isSpecialValueTransparent()
          返回图层的指定栅格值(SpecialValue)所处区域是否透明。
 boolean isTransparent()
          返回是否使透明色及其容限范围内的颜色透明显示。
 void setColorTable(Colors colorTable)
          根据指定的颜色集合对象设置颜色表。
 void setGridValueTable(double[] value)
          根据指定的栅格值数组设置栅格值表。
 void setOpaqueRate(int value)
          设置栅格图层的不透明度。
 void setSpecialValue(double value)
          设置图层的指定栅格值。
 void setSpecialValueColor(java.awt.Color value)
          设置栅格数据集指定栅格值的颜色。
 void setSpecialValueTransparent(boolean value)
          设置图层的指定栅格值(SpecialValue)所处区域是否透明。
 void setTransparent(boolean value)
          设置是否使透明色及其容限范围内的颜色透明显示。
 void setTransparentColor(java.awt.Color color)
          设置透明色。
 void setTransparentColorTolerance(int value)
          设置透明色容限,容限范围是(0~255)。
 
从类 com.supermap.realspace.Layer3DSetting 继承的方法
getType
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Layer3DSettingGrid

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


Layer3DSettingGrid

public Layer3DSettingGrid(Layer3DSettingGrid layer3DSettingGrid)
根据给定的 Layer3DSettingGrid 对象构造一个与其完全相同的新对象。

参数:
layer3DSettingGrid - 给定的 Layer3DSettingGrid 对象。
方法详细信息

isTransparent

public boolean isTransparent()
返回是否使透明色及其容限范围内的颜色透明显示。

返回:
是否使透明色及其容限范围内的颜色透明显示。

setTransparent

public void setTransparent(boolean value)
设置是否使透明色及其容限范围内的颜色透明显示。

参数:
value - 是否使透明色及其容限范围内的颜色透明显示。

getTransparentColor

public java.awt.Color getTransparentColor()
返回透明色。

返回:
透明色。

setTransparentColor

public void setTransparentColor(java.awt.Color color)
设置透明色。

参数:
color - 透明色。

getTransparentColorTolerance

public int getTransparentColorTolerance()
返回透明色容限,容限范围是(0~255)。

返回:
透明色容限。

setTransparentColorTolerance

public void setTransparentColorTolerance(int value)
设置透明色容限,容限范围是(0~255)。

参数:
value - 透明色容限,容限范围是(0~255)。

getSpecialValueColor

public java.awt.Color getSpecialValueColor()
返回栅格数据集指定栅格值的颜色。

可对将指定的栅格值的栅格颜色半透明显示,例如:Layer3DSettingGrid.setSpecialValueColor(new Color(255, 0, 0,127)),以红色半透明的颜色显示指定栅格值。半透显示的前提条件是将setSpecialValueTransparent() 设置为false。

返回:
栅格数据集指定栅格值的颜色。
默认值:
默认值为 Color(0,0,0,0),即透明的黑色。

setSpecialValueColor

public void setSpecialValueColor(java.awt.Color value)
设置栅格数据集指定栅格值的颜色。

参数:
value - 栅格数据集指定栅格值的颜色。

getSpecialValue

public double getSpecialValue()
返回图层的指定栅格值。

在新增一个 Grid 图层时,该方法的返回值与数据集的 NoValue 属性值相等。

返回:
图层的特殊值。
默认值:
默认值为 -9999。

setSpecialValue

public void setSpecialValue(double value)
设置图层的指定栅格值。

参数:
value - 图层的指定栅格值。

isSpecialValueTransparent

public boolean isSpecialValueTransparent()
返回图层的指定栅格值(SpecialValue)所处区域是否透明。

返回:
一个布尔值,图层的指定栅格值(SpecialValue)所处区域透明返回 true,否则返回 false。
默认值:
默认值为 false。

setSpecialValueTransparent

public void setSpecialValueTransparent(boolean value)
设置图层的指定栅格值(SpecialValue)所处区域是否透明。

参数:
value - 图层的指定栅格值(SpecialValue)所处区域是否透明。

getColorTable

public Colors getColorTable()
返回颜色表,即一个颜色集合对象。

返回:
一个颜色集合对象。
默认值:
默认值为颜色集合对象中没有颜色,即Colors.getCount() 方法的返回值为0。

setColorTable

public void setColorTable(Colors colorTable)
根据指定的颜色集合对象设置颜色表。

当颜色集合对象中的颜色个数为0时,则三维场景中显示的栅格数据集的保持其本身的颜色。

当颜色集合对象中的颜色个数为1时,则整个栅格数据集的所有栅格颜色都被设置为颜色表中的这种颜色。

当颜色集合对象中的颜色个数大于1时,如果没有对数据集设置栅格值表,即没有调用setGridValueTable() 方法,则栅格数据集的颜色根据颜色表中的颜色插值;如果同时设置了栅格值表,栅格数据集的颜色取决于栅格表中的所设置的栅格值的个数,可参考setGridValueTable()方法的描述。

参数:
colorTable - 指定的颜色集合对象。

getGridValueTable

public double[] getGridValueTable()
返回栅格值表。

返回:
一个存放栅格值的数组。

setGridValueTable

public void setGridValueTable(double[] value)
根据指定的栅格值数组设置栅格值表。

栅格数据集的栅格颜色是setColorTable() 方法与setGridValueTable()相关作用的结果,有以下几点注意:

1.如果没有通过 setColorTable() 方法设置颜色表或颜色表中的颜色个数为1,调用该方法设置栅格值无效。

2.如果颜色表中的颜色个数为2时,栅格数据集的栅格值以栅格值数组中的最后一个栅格值为分界值,最小栅格值到分界值之间的所有栅格颜色为颜色表中的第一个颜色,分界值到最大栅格值之间的所有栅格颜色被设置为颜色表中的第二个颜色。

3.如果颜色表中的颜色个数大于2,当栅格值数组中的栅格值的个数为1,栅格数据集的栅格值以这个栅格值为分界值,最小栅格值到分界值之间的所有栅格颜色为颜色表中的第一个颜色,分界值到最大栅格值之间的所有栅格颜色被设置为颜色表中的最后一个颜色;当栅格数组中的栅格值个数大于等于2时,栅格值表中的第一个栅格值到最小栅格值之间的所有栅格颜色被设置为颜色表中的第一个颜色,栅格值表中的最后一个栅格值到最大栅格值这个区间的所有栅格被设置为颜色表中的最后一个颜色,栅格值表中最小值和最大值这个区间的栅格颜色通过剩下的颜色表中的颜色个数插值得到。

参数:
value - 指定的栅格值数组。

getOpaqueRate

public int getOpaqueRate()
返回栅格图层的不透明度。当栅格数据集以影像方式加载时,可以对其的不透明进行设置。该属性值范围0-100,0表示完全透明,100表示不透明。

返回:
栅格图层的不透明度。该属性值范围0-100,0表示完全透明,100表示不透明。
默认值:
默认值为100,即:不透明。

setOpaqueRate

public void setOpaqueRate(int value)
设置栅格图层的不透明度。当栅格数据集以影像方式加载时,可以对其的不透明进行设置。该属性值范围0-100,0表示完全透明,100表示不透明。

参数:
value - 栅格图层的不透明度。该属性值范围0-100,0表示完全透明,100表示不透明。
默认值:
默认值为100,即:不透明。