• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MultiSurface类的典型用法和代码示例

java 1次浏览

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

MultiSurface类属于org.citygml4j.model.gml.geometry.aggregates包,在下文中一共展示了MultiSurface类的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: constructPolygons

点赞 3

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
/**
 * Constructs Polygons from CityGML boundary surface properties
 * @param bsp
 * @return
 */
public Vector<Polygon> constructPolygons(List<BoundarySurfaceProperty> bsp)
{
	Vector<Polygon> pols = new Vector<Polygon>();
	for( BoundarySurfaceProperty a : bsp)
	{
		AbstractBoundarySurface b = a.getBoundarySurface();
		MultiSurfaceProperty 	c = b.getLod2MultiSurface();
		MultiSurface 			d = c.getGeometry();
		List<SurfaceProperty>   e = d.getSurfaceMember();
		for( SurfaceProperty f  : e)
		{
			if(f.getGeometry().getGMLClass() == GMLClass.POLYGON)
			{
				pols.add(constructPolygon(f));
			} else if(f.getGeometry().getGMLClass() == GMLClass.COMPOSITE_SURFACE)
			{
				for( SurfaceProperty g: ((CompositeSurface)f.getGeometry()).getSurfaceMember())
				{
					pols.add(constructPolygon(g));
				}
			}
		}
	}
	return pols;
}
 

开发者ID:SteuerHorst,
项目名称:Voluminator,
代码行数:31,
代码来源:PolygonConstructor.java

示例2: apply

点赞 3

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public T apply(MultiSurface multiSurface) {
	T object = apply((AbstractGeometricAggregate)multiSurface);
	if (object != null)
		return object;

	if (multiSurface.isSetSurfaceMember()) {
		for (SurfaceProperty surfaceProperty : new ArrayList<SurfaceProperty>(multiSurface.getSurfaceMember())) {
			object = apply(surfaceProperty);
			if (object != null)
				return object;
		}
	}

	if (multiSurface.isSetSurfaceMembers()) {
		object = apply(multiSurface.getSurfaceMembers());
		if (object != null)
			return object;
	}

	return null;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:22,
代码来源:GMLFunctionWalker.java

示例3: GMLMarshaller

点赞 3

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public GMLMarshaller(CityJSONMarshaller json) {
	this.json = json;
	childInfo = new ChildInfo();

	typeMapper = BiFunctionTypeMapper.<AffineTransform, AbstractGeometryType>create()
			.with(MultiPoint.class, this::marshalMultiPoint)
			.with(MultiCurve.class, this::marshalMultiLineString)
			.with(Surface.class, this::marshalSurface)
			.with(TriangulatedSurface.class, this::marshalTriangulatedSurface)
			.with(Tin.class, this::marshalTin)
			.with(MultiSurface.class, this::marshalMultiSurface)
			.with(CompositeSurface.class, this::marshalCompositeSurface)
			.with(Solid.class, this::marshalSolid)
			.with(CompositeSolid.class, this::marshalCompositeSolid)
			.with(MultiSolid.class, this::marshalMultiSolid);
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:17,
代码来源:GMLMarshaller.java

示例4: unmarshalAbstractBoundarySurface

点赞 3

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalAbstractBoundarySurface(SemanticsType src, AbstractBoundarySurface dest, List<AbstractSurface> surfaces, Number lod) {
	dest.setId(DefaultGMLIdManager.getInstance().generateUUID());
	
	if (src.isSetProperties())
		citygml.getGenericsUnmarshaller().unmarshalSemanticsAttributes(src.getProperties(), dest);

	MultiSurface multiSurface = new MultiSurface();
	for (AbstractSurface surface : surfaces)
		multiSurface.addSurfaceMember(new SurfaceProperty(surface));

	switch (lod.intValue()) {
	case 2:
		dest.setLod2MultiSurface(new MultiSurfaceProperty(multiSurface));
		break;
	case 3:
		dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
		break;
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:20,
代码来源:BridgeUnmarshaller.java

示例5: visit

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
@Override
public void visit(MultiSurface multiSurface) {
	if (multiSurface.isSetId())
		targets.add(new StringBuilder("#").append(multiSurface.getId()).toString());

	super.visit(multiSurface);
}
 

开发者ID:3dcitydb,
项目名称:importer-exporter,
代码行数:8,
代码来源:AppearanceRemover.java

示例6: createMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public MultiSurface createMultiSurface(Polygon... polygons) {
	MultiSurface multiSurface = new MultiSurface();
	
	for (Polygon polygon : polygons) {
		if (polygon != null && polygon.isSetExterior())
			multiSurface.addSurfaceMember(new SurfaceProperty(polygon));
	}
	
	return multiSurface;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:11,
代码来源:GMLGeometryFactory.java

示例7: visit

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void visit(MultiSurface multiSurface) {
	visit((AbstractGeometricAggregate)multiSurface);

	if (multiSurface.isSetSurfaceMember())
		for (SurfaceProperty surfaceProperty : new ArrayList<SurfaceProperty>(multiSurface.getSurfaceMember()))
			visit(surfaceProperty);

	if (multiSurface.isSetSurfaceMembers())
		visit(multiSurface.getSurfaceMembers());
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:11,
代码来源:GMLWalker.java

示例8: marshalMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public MultiSurfaceType marshalMultiSurface(MultiSurface src) {
	MultiSurfaceType dest = gml.createMultiSurfaceType();
	marshalAbstractGeometricAggregate(src, dest);

	if (src.isSetSurfaceMember()) {
		for (SurfaceProperty member : src.getSurfaceMember())
			dest.getSurfaceMember().add(marshalSurfaceProperty(member));
	}

	if (src.isSetSurfaceMembers())
		dest.setSurfaceMembers(marshalSurfaceArrayProperty(src.getSurfaceMembers()));

	return dest;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:15,
代码来源:GMLMarshaller.java

示例9: unmarshalMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public MultiSurface unmarshalMultiSurface(MultiSurfaceType src) {
	MultiSurface dest = new MultiSurface();
	unmarshalAbstractGeometricAggregate(src, dest);

	if (src.isSetSurfaceMember()) {
		for (SurfacePropertyType surfaceMember : src.getSurfaceMember())
			dest.addSurfaceMember(unmarshalSurfaceProperty(surfaceMember));
	}

	if (src.isSetSurfaceMembers())
		dest.setSurfaceMembers(unmarshalSurfaceArrayProperty(src.getSurfaceMembers()));

	return dest;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:15,
代码来源:GMLUnmarshaller.java

示例10: preprocessGeometry

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
private Map<Integer, MultiSurface> preprocessGeometry(WaterBody waterBody) {
	Map<Integer, MultiSurface> multiSurfaces = null;
	SurfaceCollector collector = new SurfaceCollector();

	for (BoundedByWaterSurfaceProperty property : waterBody.getBoundedBySurface()) {
		if (property.isSetWaterBoundarySurface()) {
			LodRepresentation lodRepresentation = property.getWaterBoundarySurface().getLodRepresentation();
			for (int lod = 2; lod < 4; lod++) {
				if (lodRepresentation.isSetGeometry(lod)) {
					collector.setLod(lod);
					for (GeometryProperty<?> geometryProperty : lodRepresentation.getGeometry(lod))
						collector.visit(geometryProperty);
				}
			}
		}
	}

	if (collector.hasSurfaces()) {
		multiSurfaces = new HashMap<>();

		for (int lod = 2; lod < 4; lod++) {
			Collection<AbstractSurface> surfaces = collector.getSurfaces(lod);
			if (surfaces != null) {
				MultiSurface multiSurface = new MultiSurface();

				for (AbstractSurface surface : surfaces) {					
					SurfaceProperty dummy = new SurfaceProperty();
					dummy.setLocalProperty(CityJSONMarshaller.GEOMETRY_XLINK, surface);
					surface.setLocalProperty(CityJSONMarshaller.GEOMETRY_XLINK_TARGET, true);
					multiSurface.addSurfaceMember(dummy);
				}

				multiSurfaces.put(lod, multiSurface);
			}
		}
	}

	return multiSurfaces;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:40,
代码来源:WaterBodyMarshaller.java

示例11: unmarshalAbstractOpening

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalAbstractOpening(SemanticsType src, AbstractOpening dest, List<AbstractSurface> surfaces, Number lod) {
	if (src.isSetProperties())
		citygml.getGenericsUnmarshaller().unmarshalSemanticsAttributes(src.getProperties(), dest);

	if (lod.intValue() == 3) {
		MultiSurface multiSurface = new MultiSurface();
		for (AbstractSurface surface : surfaces)
			multiSurface.addSurfaceMember(new SurfaceProperty(surface));

		dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:13,
代码来源:BridgeUnmarshaller.java

示例12: unmarshalLandUse

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalLandUse(LandUseType src, LandUse dest) {
	citygml.getCoreUnmarshaller().unmarshalAbstractCityObject(src, dest);
	
	if (src.isSetAttributes()) {
		Attributes attributes = src.getAttributes();
		if (attributes.isSetClazz())
			dest.setClazz(new Code(attributes.getClazz()));

		if (attributes.isSetFunction())
			dest.addFunction(new Code(attributes.getFunction()));

		if (attributes.isSetUsage())
			dest.addUsage(new Code(attributes.getUsage()));
	}
	
	for (AbstractGeometryType geometryType : src.getGeometry()) {
		if (geometryType instanceof AbstractSurfaceCollectionType) {
			AbstractSurfaceCollectionType surfaceType = (AbstractSurfaceCollectionType)geometryType;
			MultiSurface multiSurface = json.getGMLUnmarshaller().unmarshalMultiSurface(surfaceType, dest);
			
			if (multiSurface != null) {
				int lod = geometryType.getLod().intValue();
				switch (lod) {
				case 0:
					dest.setLod0MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 1:
					dest.setLod1MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 2:
					dest.setLod2MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 3:
					dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				}
			}
		}	
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:41,
代码来源:LandUseUnmarshaller.java

示例13: unmarshalMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public MultiSurface unmarshalMultiSurface(AbstractSurfaceCollectionType src, AbstractCityObject cityObject) {
	MultiSurface dest = new MultiSurface();
	for (SurfaceProperty property : unmarshalSurfaceCollection(src, cityObject, false))
		dest.addSurfaceMember(property);

	return dest.isSetSurfaceMember() ? dest : null;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:8,
代码来源:GMLUnmarshaller.java

示例14: convertMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public static MultiSurface convertMultiSurface(IMultiSurface<?> iMS) {

		MultiSurface mS = new MultiSurface();

		int nbElem = iMS.size();

		List<SurfaceProperty> lSPT = new ArrayList<SurfaceProperty>();

		for (int i = 0; i < nbElem; i++) {

			AbstractSurface aS = convertPolygon((GM_Polygon) iMS.get(i));
			SurfaceProperty sP = new SurfaceProperty();

			sP.setSurface(aS);
			lSPT.add(sP);

		}

		mS.setSurfaceMember(lSPT);

		return mS;

	}
 

开发者ID:IGNF,
项目名称:geoxygene,
代码行数:24,
代码来源:ConvertToCityGMLGeometry.java

示例15: parseGeometry

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
private GeometryObject parseGeometry(GML gml, QName name) throws GeometryParseException, SrsParseException {
	GeometryObject geometryObject = null;

	// geometry is not advertised
	if (!SpatialOperandName.contains(gml.getGMLClass()))
		throw new GeometryParseException("The GML geometry type '" + name + "' is not supported as geometric value.");

	switch (gml.getGMLClass()) {
	case ENVELOPE:
		geometryObject = parseEnvelope((Envelope)gml);
		break;
	case POINT:
		geometryObject = parsePoint((Point)gml);
		break;
	case MULTI_POINT:
		geometryObject = parseMultiPoint((MultiPoint)gml);
		break;
	case LINE_STRING:
		geometryObject = parseLineString((LineString)gml);
		break;
	case MULTI_LINE_STRING:
		geometryObject = parseMultiLineString((MultiLineString)gml);
		break;
	case CURVE:
		geometryObject = parseCurve((Curve)gml);
		break;
	case MULTI_CURVE:
		geometryObject = parseMultiCurve((MultiCurve)gml);
		break;
	case POLYGON:
		geometryObject = parsePolygon((Polygon)gml);
		break;
	case MULTI_POLYGON:
		geometryObject = parseMultiPolygon((MultiPolygon)gml);
		break;
	case SURFACE:
		geometryObject = parseSurface((Surface)gml);
		break;
	case MULTI_SURFACE:
		geometryObject = parseMultiSurface((MultiSurface)gml);
		break;
	default:
		break;
	}

	if (geometryObject == null)
		throw new GeometryParseException("Failed to parse the geometry element '" + name + "'.");

	return geometryObject;
}
 

开发者ID:3dcitydb,
项目名称:importer-exporter,
代码行数:51,
代码来源:SimpleGMLParser.java

示例16: createMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
private JAXBElement<?> createMultiSurface(MultiSurface src) {
	return gml.createMultiSurface(marshalMultiSurface(src));
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:4,
代码来源:GMLMarshaller.java

示例17: marshalMultiSurface

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public MultiSurfaceType marshalMultiSurface(MultiSurface src, AffineTransform transformer) {
	MultiSurfaceType dest = new MultiSurfaceType();
	marshalSurfaceCollection(src, dest, transformer);

	return dest;
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:7,
代码来源:GMLMarshaller.java

示例18: unmarshalTransportationComplex

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalTransportationComplex(AbstractTransportationComplexType src, TransportationComplex dest) {
	citygml.getCoreUnmarshaller().unmarshalAbstractCityObject(src, dest);

	if (src.isSetAttributes()) {
		TransportationComplexAttributes attributes = src.getAttributes();

		if (attributes.isSetClazz())
			dest.setClazz(new Code(attributes.getClazz()));

		if (attributes.isSetFunction())
			dest.addFunction(new Code(attributes.getFunction()));

		if (attributes.isSetUsage())
			dest.addUsage(new Code(attributes.getUsage()));

		if (attributes.isSetSurfaceMaterials()) {
			StringAttribute surfaceMaterial = new StringAttribute();
			surfaceMaterial.setName("surfaceMaterial");
			surfaceMaterial.setValue(attributes.getSurfaceMaterials().stream().collect(Collectors.joining(" ")));
			dest.addGenericAttribute(surfaceMaterial);
		}
	}

	for (AbstractGeometryType geometryType : src.getGeometry()) {
		if (geometryType instanceof AbstractSurfaceCollectionType) {
			AbstractSurfaceCollectionType surfaceType = (AbstractSurfaceCollectionType)geometryType;
			MultiSurface multiSurface = json.getGMLUnmarshaller().unmarshalMultiSurface(surfaceType, dest);

			if (multiSurface != null) {
				int lod = geometryType.getLod().intValue();
				switch (lod) {
				case 1:
					dest.setLod1MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 2:
					dest.setLod2MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 3:
					dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				}
			}
		}	
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:46,
代码来源:TransportationUnmarshaller.java

示例19: unmarshalTrafficArea

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalTrafficArea(SemanticsType src, TrafficArea dest, List<AbstractSurface> surfaces, Number lod) {
	dest.setId(DefaultGMLIdManager.getInstance().generateUUID());
	
	if (src.isSetProperties()) {
		Object attribute = src.getProperties().get("surfaceMaterial");
		if (attribute instanceof String) {
			dest.setSurfaceMaterial(new Code((String)attribute));
			src.getProperties().remove("surfaceMaterial");
		}
		
		attribute = src.getProperties().get("class");
		if (attribute instanceof String) {
			dest.setClazz(new Code((String)attribute));
			src.getProperties().remove("class");
		}
		
		attribute = src.getProperties().get("function");
		if (attribute instanceof String) {
			dest.addFunction(new Code((String)attribute));
			src.getProperties().remove("function");
		}
		
		attribute = src.getProperties().get("usage");
		if (attribute instanceof String) {
			dest.addFunction(new Code((String)attribute));
			src.getProperties().remove("usage");
		}
		
		citygml.getGenericsUnmarshaller().unmarshalSemanticsAttributes(src.getProperties(), dest);
	}
	
	MultiSurface multiSurface = new MultiSurface();
	for (AbstractSurface surface : surfaces)
		multiSurface.addSurfaceMember(new SurfaceProperty(surface));

	switch (lod.intValue()) {
	case 2:
		dest.setLod2MultiSurface(new MultiSurfaceProperty(multiSurface));
		break;
	case 3:
		dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
		break;
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:45,
代码来源:TransportationUnmarshaller.java

示例20: unmarshalAuxiliaryTrafficArea

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalAuxiliaryTrafficArea(SemanticsType src, AuxiliaryTrafficArea dest, List<AbstractSurface> surfaces, Number lod) {
	dest.setId(DefaultGMLIdManager.getInstance().generateUUID());
	
	if (src.isSetProperties()) {
		Object attribute = src.getProperties().get("surfaceMaterial");
		if (attribute instanceof String) {
			dest.setSurfaceMaterial(new Code((String)attribute));
			src.getProperties().remove("surfaceMaterial");
		}
		
		attribute = src.getProperties().get("class");
		if (attribute instanceof String) {
			dest.setClazz(new Code((String)attribute));
			src.getProperties().remove("class");
		}
		
		attribute = src.getProperties().get("function");
		if (attribute instanceof String) {
			dest.addFunction(new Code((String)attribute));
			src.getProperties().remove("function");
		}
		
		attribute = src.getProperties().get("usage");
		if (attribute instanceof String) {
			dest.addFunction(new Code((String)attribute));
			src.getProperties().remove("usage");
		}
		
		citygml.getGenericsUnmarshaller().unmarshalSemanticsAttributes(src.getProperties(), dest);
	}
	
	MultiSurface multiSurface = new MultiSurface();
	for (AbstractSurface surface : surfaces)
		multiSurface.addSurfaceMember(new SurfaceProperty(surface));

	switch (lod.intValue()) {
	case 2:
		dest.setLod2MultiSurface(new MultiSurfaceProperty(multiSurface));
		break;
	case 3:
		dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
		break;
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:45,
代码来源:TransportationUnmarshaller.java

示例21: unmarshalPlantCover

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void unmarshalPlantCover(PlantCoverType src, PlantCover dest) {
	citygml.getCoreUnmarshaller().unmarshalAbstractCityObject(src, dest);
	
	if (src.isSetAttributes()) {
		PlantCoverAttributes attributes = src.getAttributes();
		
		if (attributes.isSetClazz())
			dest.setClazz(new Code(attributes.getClazz()));

		if (attributes.isSetFunction())
			dest.addFunction(new Code(attributes.getFunction()));

		if (attributes.isSetUsage())
			dest.addUsage(new Code(attributes.getUsage()));
		
		if (attributes.isSetAverageHeight())
			dest.setAverageHeight(new Length(attributes.getAverageHeight()));
	}
	
	for (AbstractGeometryType geometryType : src.getGeometry()) {
		AbstractGeometry geometry = json.getGMLUnmarshaller().unmarshal(geometryType, dest);

		if (geometry != null) {
			int lod = geometryType.getLod().intValue();

			if (geometry instanceof MultiSurface) {
				MultiSurface multiSurface = (MultiSurface)geometry;
				switch (lod) {
				case 1:
					dest.setLod1MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 2:
					dest.setLod2MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				case 3:
					dest.setLod3MultiSurface(new MultiSurfaceProperty(multiSurface));
					break;
				}
			}

			else if (geometry instanceof MultiSolid) {
				MultiSolid multiSolid = (MultiSolid)geometry;
				switch (lod) {
				case 1:
					dest.setLod1MultiSolid(new MultiSolidProperty(multiSolid));
					break;
				case 2:
					dest.setLod2MultiSolid(new MultiSolidProperty(multiSolid));
					break;
				case 3:
					dest.setLod3MultiSolid(new MultiSolidProperty(multiSolid));
					break;
				}
			}
		}
	}
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:58,
代码来源:VegetationUnmarshaller.java

示例22: main

点赞 2

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] "); 

	System.out.println(df.format(new Date()) + "setting up citygml4j context and CityGML builder");
	CityGMLContext ctx = CityGMLContext.getInstance();
	CityGMLBuilder builder = ctx.createCityGMLBuilder();

	System.out.println(df.format(new Date()) + "reading CityGML file LOD2_CityObjectGroup_v100.gml");
	CityGMLInputFactory in = builder.createCityGMLInputFactory();
	CityGMLReader reader = in.createCityGMLReader(new File("datasets/LOD2_CityObjectGroup_v100.gml"));

	CityModel cityModel = (CityModel)reader.nextFeature();
	reader.close();
	
	System.out.println(df.format(new Date()) + "creating XLinkResolver");
	XLinkResolver xLinkResolver = new XLinkResolver();
	
	for (CityObjectMember member : cityModel.getCityObjectMember()) {
		if (member.isSetCityObject() && 
				member.getCityObject().getCityGMLClass() == CityGMLClass.CITY_OBJECT_GROUP) {
			CityObjectGroup group = (CityObjectGroup)member.getCityObject();
			
			for (CityObjectGroupMember groupMember : group.getGroupMember()) {
				System.out.println(df.format(new Date()) + "processing group member with role: " + groupMember.getGroupRole());					
				System.out.println(df.format(new Date()) + "resolving XLink to " + groupMember.getHref());
				AbstractCityObject cityObject = xLinkResolver.getAbstractGML(groupMember.getHref(), cityModel, AbstractCityObject.class);
				System.out.println("   Referenced city object: " + cityObject.getCityGMLClass() + 
						", gml:id='" + cityObject.getId() +"'");
				 
				if (cityObject.getId().equals("ID_76")) {
					Road road = (Road)cityObject;
					TrafficArea trafficArea = road.getTrafficArea().get(2).getTrafficArea();
					
					System.out.println(df.format(new Date()) + "resolving XLink to " + trafficArea.getLod2MultiSurface().getHref());
					ModelObject object = xLinkResolver.getObject(trafficArea.getLod2MultiSurface().getHref(), road);
					if (object instanceof MultiSurface) {
						MultiSurface multiSurface = (MultiSurface)object;
						System.out.println("   Referenced geometry: " + multiSurface.getGMLClass() + 
								", gml:id='" + multiSurface.getId() + "'");
					}
				}
			}
		}
	}
	
	System.out.println(df.format(new Date()) + "sample citygml4j application successfully finished");
}
 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:48,
代码来源:ResolvingInternalXlinks.java

示例23: convertGMLMultiSurface

点赞 1

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
/**
 * Convertit une multisurface GML en GM_MultiSurface de GeOxygene
 * 
 * @param multiS
 *            multiSurface GML
 * @return GM_MultiSurface de GeOxygene
 */
public static IMultiSurface<IOrientableSurface> convertGMLMultiSurface(MultiSurface multiS) {
	List<SurfaceProperty> multiSurfaces = multiS.getSurfaceMember();
	int nbSurfaces = multiSurfaces.size();

	List<IOrientableSurface> lOS = new ArrayList<IOrientableSurface>(nbSurfaces);

	for (int i = 0; i < nbSurfaces; i++) {
		AbstractSurface as = multiSurfaces.get(i).getSurface();

		if (as instanceof OrientableSurface) {

			lOS.addAll(ConvertCityGMLtoGeometry.convertGMLOrientableSurface((OrientableSurface) as));
		} else if (as instanceof Polygon) {

			GML_Polygon pol = ConvertCityGMLtoGeometry.convertGMLPolygon((Polygon) as);
			
			
			
			if(pol == null){
				System.out.println("Polygon ignored due to errors : " + as.getId());
			}

			
			
			if(pol != null){
				lOS.add(pol);
			}
			
			/*
			 * } else if (as instanceof MultiSurface) {
			 * 
			 * lOS.addAll(ConvertyCityGMLGeometry
			 * .convertGMLMultiSurface((MultiSurface) as));
			 */
		} else if (as instanceof Surface) {

			lOS.addAll(ConvertCityGMLtoGeometry.convertGMLSurface((Surface) as));
		} else if (as instanceof CompositeSurface) {

			lOS.addAll(ConvertCityGMLtoGeometry.convertGMLCompositeSurface((CompositeSurface) as).getGenerator());

		} else {

			System.out.println("Surface non reconnu" + as.getClass());
		}

	}

	return new GM_MultiSurface<IOrientableSurface>(lOS);
}
 

开发者ID:IGNF,
项目名称:geoxygene,
代码行数:58,
代码来源:ConvertCityGMLtoGeometry.java

示例24: apply

点赞 1

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public T apply(MultiSurface multiSurface); 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:2,
代码来源:GeometryFunctor.java

示例25: visit

点赞 1

import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; //导入依赖的package包/类
public void visit(MultiSurface multiSurface); 

开发者ID:citygml4j,
项目名称:citygml4j,
代码行数:2,
代码来源:GeometryVisitor.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)