Package org.osm2world.core.math

Examples of org.osm2world.core.math.SimplePolygonXZ


  @Override
  public EleConnectorGroup getEleConnectors() {
   
    if (connectors == null) {
     
      SimplePolygonXZ outlinePolygonXZ = getOutlinePolygonXZ();
     
      if (outlinePolygonXZ == null) {
       
        connectors = EleConnectorGroup.EMPTY;
       
      } else {
       
        connectors = new EleConnectorGroup();
        connectors.addConnectorsFor(outlinePolygonXZ.getVertices(),
            node, getGroundState());
       
      }
     
    }
View Full Code Here


   
    if (outlineXZ.size() > 2) {
   
      try { //TODO better handling of broken outlines
        outlineXZ.add(outlineXZ.get(0));
        return new SimplePolygonXZ(outlineXZ);
      } catch (InvalidGeometryException e) {}
     
      }
   
    return null;
View Full Code Here

  }
 
  private static final PolygonWithHolesXZ convertToPolygon(
      List<MapNode> nodes, List<List<MapNode>> holes) {
   
    SimplePolygonXZ outerPolygon =
        polygonFromMapNodeLoop(nodes);
   
    List<SimplePolygonXZ> holePolygons =
      new ArrayList<SimplePolygonXZ>(holes.size());
    for (List<MapNode> hole : holes) {
View Full Code Here

   
    for (MapNode node : nodes) {
      vertices.add(node.getPos());
    }
   
    return new SimplePolygonXZ(vertices);
   
  }
View Full Code Here

      }
     
      for (int h = 0; h < holes.size(); h++) {
       
        List<MapNode> holeNodes = holes.get(h);
        SimplePolygonXZ holePolygon = polygon.getHoles().get(h);
       
        for (int v = 0; v+1 < holeNodes.size(); v++) {
          //relies on duplication of first/last node
         
          areaSegments.add(new MapAreaSegment(this,
              !holePolygon.isClockwise(),
              holeNodes.get(v), holeNodes.get(v+1)));
         
        }
       
      }
View Full Code Here

      vertices.add(vectorXZForPointAt(leftXIndex, bottomZIndex));
      vertices.add(vectorXZForPointAt(leftXIndex+1, bottomZIndex));
      vertices.add(vectorXZForPointAt(leftXIndex+1, bottomZIndex+1));
      vertices.add(vectorXZForPointAt(leftXIndex, bottomZIndex+1));
      vertices.add(vertices.get(0));
      return new SimplePolygonXZ(vertices);
    }
View Full Code Here

      outlineLoopXZ.add(outlineLoopXZ.get(0));
     
      // check for brokenness
     
      try {
        outlinePolygonXZ = new SimplePolygonXZ(outlineLoopXZ);
        broken = outlinePolygonXZ.isClockwise();
      } catch (InvalidGeometryException e) {
        broken = true;
        connectors = EleConnectorGroup.EMPTY;
      }
View Full Code Here

      vertices.add(new VectorXZ(minX2, minZ2));
      vertices.add(new VectorXZ(maxX2, minZ2));
      vertices.add(new VectorXZ(maxX2, maxZ2));
      vertices.add(new VectorXZ(minX2, maxZ2));
      vertices.add(vertices.get(0));
      boundary = new SimplePolygonXZ(vertices);
     
    }
View Full Code Here

        }
       
        if (simplified.size() > 2) {
          try{
            simplified.add(simplified.get(0));
            simplePolygon = new PolygonWithHolesXZ(new SimplePolygonXZ(simplified),
                polygon.getHoles());
          } catch (InvalidGeometryException e) {
            System.err.print(e.getMessage());
            simplePolygon = polygon;
          }
View Full Code Here

     
      upperLeft = lowerLeft.add(toBack);
      upperCenter = lowerCenter.add(toBack);
      upperRight = lowerRight.add(toBack);
     
      outline = new SimplePolygonXZ(asList(
          lowerLeft, lowerCenter, lowerRight,
          upperRight, upperCenter, upperLeft,
          lowerLeft));
     
    }
View Full Code Here

TOP

Related Classes of org.osm2world.core.math.SimplePolygonXZ

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.