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


Java AbstractRingProperty类代码示例

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


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

示例1: constructPolygon

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
/**
 * Constructs a Polygon from CityGML surface property
 * @param f
 * @return
 */
private Polygon constructPolygon( SurfaceProperty f)
{
	Polygon pol = new Polygon();	
	org.citygml4j.model.gml.geometry.primitives.Polygon p = (org.citygml4j.model.gml.geometry.primitives.Polygon)f.getSurface();		
	LinearRing r = (LinearRing) (p.getExterior().getRing());
	DirectPositionList q = r.getPosList();
	List<Double> a1 = q.getValue();
	
	//exterior
	pol.addExterior(constructRing(a1));
	
	//interior
	List<AbstractRingProperty> liste = (List<AbstractRingProperty>)p.getInterior();
	for(AbstractRingProperty ar : liste)
	{
		LinearRing r2 = (LinearRing)ar.getRing();
		DirectPositionList q2 = r2.getPosList();
		List<Double> a2 = q2.getValue();
		pol.addInterior(constructRing(a2));
	}
	
	pol.project();
	return pol;

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

示例2: apply

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
public T apply(Polygon polygon) {
	T object = apply((AbstractSurface)polygon);
	if (object != null)
		return object;

	if (polygon.isSetExterior()) {
		object = apply(polygon.getExterior());
		if (object != null)
			return object;
	}

	if (polygon.isSetInterior()) {
		for (AbstractRingProperty abstractRingProperty : new ArrayList<AbstractRingProperty>(polygon.getInterior())) {
			object = apply(abstractRingProperty);
			if (object != null)
				return object;
		}
	}

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

示例3: unmarshalRectangle

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
public Rectangle unmarshalRectangle(RectangleType src) {
	Rectangle dest = new Rectangle();
	unmarshalAbstractSurfacePatch(src, dest);

	if (src.isSetExterior()) {
		try {
			ModelObject exterior = jaxb.unmarshal(src.getExterior());
			if (exterior instanceof AbstractRingProperty)
				dest.setExterior((AbstractRingProperty)exterior);
		} catch (MissingADESchemaException e) {
			//
		}
	}

	if (src.isSetInterpolation())
		dest.setInterpolation(unmarshalSurfaceInterpolation(src.getInterpolation()));

	return dest;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:20,代码来源:GMLUnmarshaller.java

示例4: unmarshalTriangle

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
public Triangle unmarshalTriangle(TriangleType src) {
	Triangle dest = new Triangle();
	unmarshalAbstractSurfacePatch(src, dest);

	if (src.isSetExterior()) {
		try {
			ModelObject exterior = jaxb.unmarshal(src.getExterior());
			if (exterior instanceof AbstractRingProperty)
				dest.setExterior((AbstractRingProperty)exterior);
		} catch (MissingADESchemaException e) {
			//
		}
	}

	if (src.isSetInterpolation())
		dest.setInterpolation(unmarshalSurfaceInterpolation(src.getInterpolation()));

	return dest;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:20,代码来源:GMLUnmarshaller.java

示例5: convertPatch

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
public static AbstractSurfacePatch convertPatch(IRing iRing) {

		Triangle tri = new Triangle();

		Ring r = convertRing(iRing);
		AbstractRingProperty rPT = new AbstractRingProperty() {

			@Override
			public Object copy(CopyBuilder arg0) {
				// TODO Auto-generated method stub
				return super.copyTo(this, arg0);

			}

			@Override
			public Class<AbstractRing> getAssociableClass() {
				// TODO Auto-generated method stub
				return AbstractRing.class;
			}
		};

		rPT.setRing(convertRing(iRing));

		tri.setExterior(rPT);
		rPT.setRing(r);

		return tri;
	}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:29,代码来源:ConvertToCityGMLGeometry.java

示例6: visit

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
public void visit(Polygon polygon) {
	visit((AbstractSurface)polygon);

	if (polygon.isSetExterior())
		visit(polygon.getExterior());

	if (polygon.isSetInterior())
		for (AbstractRingProperty interior : new ArrayList<AbstractRingProperty>(polygon.getInterior()))
			visit(interior);
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:11,代码来源:GMLWalker.java

示例7: marshalAbstractRingProperty

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public AbstractRingPropertyType marshalAbstractRingProperty(AbstractRingProperty src) {
	AbstractRingPropertyType dest = gml.createAbstractRingPropertyType();

	if (src.isSetRing()) {
		JAXBElement<?> elem = jaxb.marshalJAXBElement(src.getRing());
		if (elem != null && elem.getValue() instanceof AbstractRingType)
			dest.set_Ring((JAXBElement<? extends AbstractRingType>)elem);
	}

	return dest;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:13,代码来源:GMLMarshaller.java

示例8: unmarshalAbstractRingProperty

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
public void unmarshalAbstractRingProperty(AbstractRingPropertyType src, AbstractRingProperty dest) {
	if (src.isSet_Ring()) {
		try {
			ModelObject abstractRing = jaxb.unmarshal(src.get_Ring());
			if (abstractRing instanceof AbstractRing)
				dest.setRing((AbstractRing)abstractRing);
		} catch (MissingADESchemaException e) {
			//
		}
	}
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:12,代码来源:GMLUnmarshaller.java

示例9: marshalPolygon

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
private List<List<Integer>> marshalPolygon(Polygon polygon, AffineTransform transformer, boolean reverse) {
	List<List<Integer>> vertices = null;

	if (polygon.isSetExterior()) {
		AbstractRing exterior = polygon.getExterior().getRing();
		if (exterior instanceof LinearRing) {
			List<Integer> indexes = marshalLinearRing((LinearRing)exterior, transformer, reverse);
			if (indexes != null) {
				vertices = new ArrayList<>();
				vertices.add(indexes);

				if (polygon.isSetInterior()) {
					for (AbstractRingProperty property : polygon.getInterior()) {
						AbstractRing interior = property.getRing();
						if (interior instanceof LinearRing) {
							indexes = marshalLinearRing((LinearRing)interior, transformer, reverse);
							if (indexes != null)
								vertices.add(indexes);
						}
					}
				}
			}
		}
	}

	return vertices;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:28,代码来源:GMLMarshaller.java

示例10: generatePointList

import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty; //导入依赖的package包/类
private List<List<Double>> generatePointList(Polygon polygon, boolean is2d, boolean reverse) {
	List<List<Double>> pointList = new ArrayList<>();

	if (polygon.isSetExterior()) {
		AbstractRing exteriorAbstractRing = polygon.getExterior().getRing();
		if (exteriorAbstractRing instanceof LinearRing) {
			LinearRing exteriorLinearRing = (LinearRing)exteriorAbstractRing;
			if (!ringValidator.validate(exteriorLinearRing))
				return null;

			List<Double> coords = exteriorLinearRing.toList3d(reverse);
			if (!coords.isEmpty()) {
				pointList.add(coords);

				if (polygon.isSetInterior()) {
					for (AbstractRingProperty abstractRingProperty : polygon.getInterior()) {
						AbstractRing interiorAbstractRing = abstractRingProperty.getRing();
						if (interiorAbstractRing instanceof LinearRing) {
							LinearRing interiorLinearRing = (LinearRing)interiorAbstractRing;
							if (!ringValidator.validate(interiorLinearRing))
								return null;

							coords = interiorLinearRing.toList3d(reverse);
							if (!coords.isEmpty())
								pointList.add(coords);
						}
					}
				}
			}
		}

		if (is2d) {
			// if we have to return a 2d polygon we first have to correct the
			// double lists we retrieved from citygml4j as they are always 3d
			for (List<Double> coordsList : pointList) {							
				Iterator<Double> iter = coordsList.iterator();

				int count = 0;							
				while (iter.hasNext()) {
					iter.next();

					if (count++ == 2) {
						count = 0;	
						iter.remove();
					}
				}
			}						
		}
	}

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


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