当前位置: 首页>>代码示例>>Java>>正文


Java AbstractGeometry.setLocalProperty方法代码示例

本文整理汇总了Java中org.citygml4j.model.gml.geometry.AbstractGeometry.setLocalProperty方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractGeometry.setLocalProperty方法的具体用法?Java AbstractGeometry.setLocalProperty怎么用?Java AbstractGeometry.setLocalProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.citygml4j.model.gml.geometry.AbstractGeometry的用法示例。


在下文中一共展示了AbstractGeometry.setLocalProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doImport

import org.citygml4j.model.gml.geometry.AbstractGeometry; //导入方法依赖的package包/类
protected long doImport(AbstractGeometry surfaceGeometry, long cityObjectId) throws CityGMLImportException, SQLException {
	// check whether we can deal with the geometry
	if (!geometryConverter.isSurfaceGeometry(surfaceGeometry)) {
		importer.logOrThrowErrorMessage(new StringBuilder("Unsupported geometry type ").append(importer.getObjectSignature(surfaceGeometry)).toString());
		return 0;
	}

	boolean success = pkManager.retrieveIds(surfaceGeometry);
	if (!success) {
		importer.logOrThrowErrorMessage(new StringBuilder("Failed to acquire primary key values for surface geometry from database.").toString());
		return 0;
	}

	if (surfaceGeometry.isSetId())
		surfaceGeometry.setLocalProperty(CoreConstants.OBJECT_ORIGINAL_GMLID, surfaceGeometry.getId());

	long surfaceGeometryId = pkManager.nextId();
	doImport(surfaceGeometry, surfaceGeometryId, 0, surfaceGeometryId, false, false, false, cityObjectId);
	pkManager.clear();

	return surfaceGeometryId;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:23,代码来源:DBSurfaceGeometry.java

示例2: visit

import org.citygml4j.model.gml.geometry.AbstractGeometry; //导入方法依赖的package包/类
@Override
public void visit(AbstractGeometry geometry) {
	if (state == ResolverState.GET_GEOMETRY && geometry.isSetId()) {
		List<GeometryProperty<?>> properties = this.properties.get(geometry.getId());
		if (properties != null) {
			for (GeometryProperty<?> property : properties) {
				if (property.getAssociableClass().isAssignableFrom(geometry.getClass())) {
					property.setLocalProperty(CityJSONMarshaller.GEOMETRY_XLINK, geometry);
					geometry.setLocalProperty(CityJSONMarshaller.GEOMETRY_XLINK_TARGET, true);							
				}
			}
		}
	}
	
	super.visit(geometry);
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:17,代码来源:GeometryXlinkResolver.java

示例3: visit

import org.citygml4j.model.gml.geometry.AbstractGeometry; //导入方法依赖的package包/类
@Override
public void visit(AbstractGeometry geometry) {
	if (state == ResolverState.ASSIGN_SURFACE_DATA && geometry.isSetId()) {
		List<SurfaceDataInfo> surfaceData = surfaceDatas.get(geometry.getId());
		if (surfaceData != null)
			geometry.setLocalProperty(CityJSONMarshaller.GEOMETRY_SURFACE_DATA, surfaceData);
	}

	super.visit(geometry);
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:11,代码来源:AppearanceResolver.java

示例4: visit

import org.citygml4j.model.gml.geometry.AbstractGeometry; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T extends AbstractGeometry> void visit(GeometryProperty<T> geometryProperty) {
	if (!geometryProperty.isSetGeometry() && geometryProperty.isSetHref()) {
		if (state == ResolverState.RESOLVE_XLINKS && shouldWalk()) {
			final String target = clipGMLId(geometryProperty.getHref());
			final AbstractGeometry geometry = geometries.get(target);

			if (geometry != null) {
				// check whether the type of the referenced geometry is allowed
				if (geometryProperty.getAssociableClass().isInstance(geometry)) {

					// check whether we have already seen this target while 
					// iterating through the geometry tree.
					if (circularTargets.contains(target)) {
						setShouldWalk(false);
						hasCircularReference = true;
						circularTargets.clear();
						circularTargets.push(geometryProperty.getHref());

						return;
					}

					// iterate through all parent geometries and get their
					// gml:ids to be able to detect circular references
					Child child = (Child)geometryProperty;
					int parents = 0;

					while ((child = childInfo.getParentGeometry(child)) != null) {
						circularTargets.push(((AbstractGeometry)child).getId());
						parents++;
					}

					// recursively walk through the referenced geometry
					geometry.accept(this);

					if (!hasCircularReference) {
						// ok, we can replace the link by a shallow copy of the object
						T copy = (T)geometry.copy(copyBuilder);

						geometryProperty.setGeometry(copy);
						geometryProperty.unsetHref();								
						copy.setLocalProperty(CoreConstants.GEOMETRY_XLINK, true);
						copy.setLocalProperty(CoreConstants.GEOMETRY_ORIGINAL, geometry);

						geometry.setLocalProperty(CoreConstants.GEOMETRY_XLINK, true);

						targets.remove(target);
						for (int i = 0; i < parents; ++i)
							circularTargets.pop();
					} else {
						// ups, circular reference detected
						if (!circularTargets.peek().equals(geometryProperty.getHref()))
							circularTargets.push(geometryProperty.getHref());
					}
				} else {
					if (importer != null) {
						log.error(new StringBuilder(importer.getObjectSignature(rootObject))
								.append(": Incompatible type of geometry referenced by '")
								.append(target).append("'.").toString());
					}
					
					geometryProperty.unsetHref();
				}
			}
		}

		else if (state == ResolverState.GET_XLINKS)				
			targets.add(clipGMLId(geometryProperty.getHref()));
	}

	super.visit(geometryProperty);			
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:74,代码来源:LocalGeometryXlinkResolver.java

示例5: resolveGlobalAppearance

import org.citygml4j.model.gml.geometry.AbstractGeometry; //导入方法依赖的package包/类
public void resolveGlobalAppearance(AbstractGeometry geometry) {
	List<SurfaceDataInfo> surfaceData = globalSurfaceDatas.get(geometry.getId());
	if (surfaceData != null)
		geometry.setLocalProperty(CityJSONMarshaller.GEOMETRY_SURFACE_DATA, surfaceData);		
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:6,代码来源:AppearanceResolver.java

示例6: visit

import org.citygml4j.model.gml.geometry.AbstractGeometry; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T extends AbstractGeometry> void visit(GeometryProperty<T> geometryProperty) {
	if (!geometryProperty.isSetGeometry() && geometryProperty.isSetHref()) {
		if (state == ResolverState.RESOLVE_XLINKS) {
			final String target = clipGMLId(geometryProperty.getHref());
			final AbstractGeometry geometry = geometries.get(target);

			if (geometry != null) {
				// check whether the type of the referenced geometry is allowed
				if (geometryProperty.getAssociableClass().isInstance(geometry)) {

					// check whether we have already seen this target while 
					// iterating through the geometry tree.
					if (circularTargets.contains(target)) {
						setShouldWalk(false);
						hasCircularReference = true;
						circularTargets.clear();
						circularTargets.push(geometryProperty.getHref());

						return;
					}

					// iterate through all parent geometries and get their
					// gml:ids to be able to detect circular references
					Child child = (Child)geometryProperty;
					int parents = 0;

					while ((child = childInfo.getParentGeometry(child)) != null) {
						circularTargets.push(((AbstractGeometry)child).getId());
						parents++;
					}

					// recursively walk through the referenced geometry
					geometry.accept(this);
					addToVisited(geometry);

					if (!hasCircularReference) {
						// ok, we can replace the link by a shallow copy of the object
						T copy = (T)geometry.copy(copyBuilder);
						
						geometryProperty.setGeometry(copy);
						geometryProperty.unsetHref();								
						copy.setLocalProperty(Internal.GEOMETRY_XLINK, true);
						copy.setLocalProperty(Internal.GEOMETRY_ORIGINAL, geometry);
						
						geometry.setLocalProperty(Internal.GEOMETRY_XLINK, true);

						for (int i = 0; i < parents; ++i)
							circularTargets.pop();
					} else
						// ups, circular reference detected
						circularTargets.push(geometryProperty.getHref());
				} else {
					StringBuilder msg = new StringBuilder(Util.getFeatureSignature(
							abstractCityObject.getCityGMLClass(), 
							abstractCityObject.getId()));
					msg.append(": Incompatible type of geometry referenced by '")
					.append(target)
					.append("'.");
					
					LOG.error(msg.toString());						
					geometryProperty.unsetHref();
				}
			}
		}
		
		else if (state == ResolverState.GET_XLINKS)				
			targets.add(clipGMLId(geometryProperty.getHref()));
	}

	super.visit(geometryProperty);			
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:74,代码来源:LocalGeometryXlinkResolver.java


注:本文中的org.citygml4j.model.gml.geometry.AbstractGeometry.setLocalProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。