返回该三维要素集合对象中的三维要素对象数组,查询选项用于设置是只返回顶层叶子结点(三维要素对象)数组还是返回所有的叶子结点(三维要素对象)数组。
命名空间:
SuperMap.Realspace程序集: SuperMap.Realspace (in SuperMap.Realspace)
版本: dll
语法
C# |
---|
public Feature3D[] GetFeatureArray( Feature3DSearchOption option ) |
参数
- option
- Type: SuperMap.Realspace..::.Feature3DSearchOption
查询选项。有关查询选项的详细信息,请参见Feature3DSearchOption枚举类。
返回值
三维要素对象数组。示例
以下代码示例了向三维要素集合中添加要素,三维几何对象和要素集合对象,并通过GetFeatureArray返回该三维要素集合对象中的三维要素对象数组,再通过FindFeatures返回三维要素集合对象。
CopyC#
public void GetFeatureAndFeaturesArray() { //构造任意几个三维几何对象geo1、geo2、geo3、geo4、geo5 GeoPoint3D geo1 = new GeoPoint3D(10.0, 20.0, 30.0); GeoPoint3D geo2 = new GeoPoint3D(10.0, 200.0, 30.0); GeoPoint3D geo3 = new GeoPoint3D(10.0, 20.0, 300.0); GeoPoint3D geo4 = new GeoPoint3D(100.0, 20.0, 30.0); GeoPoint3D geo5 = new GeoPoint3D(115.0, 38.0, 30.0); //构造三个三维要素集合features1、features2、features3 Feature3Ds feature3Ds1 = new Feature3Ds(); feature3Ds1.Name = "Feature3Ds1"; Feature3Ds feature3Ds2 = new Feature3Ds(); feature3Ds2.Name = "Feature3Ds2"; Feature3Ds feature3Ds3 = new Feature3Ds(); feature3Ds3.Name = "Feature3Ds3"; //构造三维要素集合的树状结构 //1 在features2中添加geo1、geo2 Feature3D feature3D1 = feature3Ds2.Add(geo1); Feature3D feature3D2 = feature3Ds2.Add(geo2); //2 在features2的子节点下面再添加一个features3 feature3Ds2.Add(feature3Ds3); //3 在features3中添加geo3、geo4 Feature3D feature3D3 = feature3Ds3.Add(geo3); Feature3D feature3D4 = feature3Ds3.Add(geo4); //4 在features1子对象中添加features2和geo5 feature3Ds1.Add(feature3Ds2); feature3Ds1.Add(geo5); //通过GetFeatureArray接口查找features1树形的顶层三维要素集合得到featureArray1 Feature3D[] featureArray1 = feature3Ds1.GetFeatureArray(Feature3DSearchOption.TopFeaturesOnly); //通过GetFeaturesArray接口查找整个features1树形要素集合得到featuresArray1 Feature3Ds[] featuresArray1 = feature3Ds1.GetFeaturesArray(Feature3DSearchOption.AllFeatures); //通过Find接口在顶层查找ID为3的三维要素 Feature3D result = feature3Ds1.FindFeature(3, Feature3DSearchOption.AllFeatures); //通过Find接口在顶层查找三维要素集合 Feature3Ds[] results = feature3Ds1.FindFeatures("feature3Ds2", Feature3DSearchOption.TopFeaturesOnly); }