private void AddNetwork3DLineTheme(Workspace workspace,DatasetVector networkDV,String subName) {
try {
//三维自定义专题图
Theme3DCustom theme = new Theme3DCustom();
FieldInfos fieldInfos = networkDV.getFieldInfos();
for (int i = 0; i < fieldInfos.getCount(); i++) {
String fieldName = fieldInfos.get(i).getName();
if (fieldName.equals(FieldStringHelper.lineSymbolID)) {
theme.setLineSymbolIDExpression(fieldName);
} else if (fieldName.equals(FieldStringHelper.lineWidth)) {
theme.setLineWidthExpression(fieldName);
} else if (fieldName.equals(FieldStringHelper.altitudeModeLine)) {
theme.setAltitudeModeExpression(fieldName);
}
}
if(workspace.getScenes().getCount()==0)
return;
String sceneName = workspace.getScenes().get(0);//默认打开第一个
Scene scene = new Scene(workspace);
if(scene.open(sceneName)) {
Layer3DDataset networkLayer = scene.getLayers().add(networkDV, theme, true);
networkLayer.setCaption(subName+"管线");//图层中文别名
workspace.getScenes().setSceneXML(sceneName, scene.toXML());
}
scene.dispose();
scene= null;
theme = null;
fieldInfos = null;
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
}
}
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.supermap.realspace.Layer3DsNative.jni_AddTheme(JLjava/lang/String;JJIZ)J+0
j com.supermap.realspace.Layer3Ds.add(Lcom/supermap/data/Dataset;Lcom/supermap/realspace/Theme3D;Z)Lcom/supermap/realspace/Layer3DDataset;+399
j z.s.cache.service.cacheSrv.AddNetwork3DLineTheme(Lcom/supermap/data/Workspace;Lcom/supermap/data/DatasetVector;Ljava/lang/String;)V+156
j z.s.cache.service.cacheSrv.SceneSymbolize(Lcom/supermap/data/Workspace;Lcom/supermap/data/DatasetVector;Lcom/supermap/data/DatasetVector;Ljava/lang/String;)V+9
j z.s.cache.service.cacheSrv.Signifying(Ljava/util/List;Ljava/lang/String;)Z+256
j z.s.cache.service.cacheSrv.publishServices(Ljava/lang/String;Ljava/lang/String;)V+737
j z.s.cache.thread.CacheThread.run()V+37
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub