本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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) {
//
}
}
}
示例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;
}
示例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;
}