Package de.fhpotsdam.unfolding.utils

Examples of de.fhpotsdam.unfolding.utils.ScreenPosition


  public void draw() {
    background(240);
    map.draw();

    ScreenPosition pos = berlinMarker.getScreenPosition(map);
    fill(255, 0, 0, 100);
    stroke(255, 0, 0);
    strokeWeight(2);
    ellipse(pos.x, pos.y + 30, 20, 20);
    println("o:" + pos.x + ", " + pos.y);
View Full Code Here


    fill(0, 180);
    noStroke();

    synchronized (visibleDots) {
      for (Dot dot : visibleDots) {
        ScreenPosition pos = map.getScreenPosition(dot.location);
        if (map.getZoomLevel() <= 4) {
          rect(pos.x, pos.y, 4, 4);
        } else {
          // Draw more expensive representations on higher zoom levels (i.e. when fewer dots)
          ellipse(pos.x, pos.y, 8, 8);
View Full Code Here

    rect(0, 0, width, height);

    // Update list of points
    List<PVector> points = new ArrayList<PVector>();
    for (Location location : locations) {
      ScreenPosition pos = map.getScreenPosition(location);
      points.add(pos);
    }

    if (!points.isEmpty()) {
View Full Code Here

  public void updateShapeVertices(PShape shape, ShapeFeature shapeFeature, boolean update) {
    List<Location> locations = shapeFeature.getLocations();
    int v = 0;
    for (Location location : locations) {
      ScreenPosition pos = map.getScreenPosition(location);
      if (update) {
        shape.setVertex(v++, pos.x, pos.y);
      }
      else {
        shape.vertex(pos.x, pos.y);
View Full Code Here

  public void draw() {
    tint(255);
    map.draw();

    ScreenPosition topRight = map.getScreenPosition(visNorthWest);
    ScreenPosition bottomLeft = map.getScreenPosition(visSouthEast);

    float width = bottomLeft.x - topRight.x;
    float height = bottomLeft.y - topRight.y;

    tint(255, 110);
View Full Code Here

    int visibleDotNumber = 0;
    for (Dot dot : dots) {
      if (dot.location.getLat() > brLoc.getLat() && dot.location.getLat() < tlLoc.getLat()
          && dot.location.getLon() > tlLoc.getLon() && dot.location.getLon() < brLoc.getLon()) {

        ScreenPosition pos = map.getScreenPosition(dot.location);
        if (map.getZoomLevel() <= 4) {
          rect(pos.x, pos.y, 4, 4);
        } else {
          // Draw more expensive representations on higher zoom levels (i.e. when fewer dots)
          ellipse(pos.x, pos.y, 8, 8);
View Full Code Here

    background(0);
    map.draw();

    fill(0);
    for (Location location : locations) {
      ScreenPosition pos = map.getScreenPosition(location);
      ellipse(pos.x, pos.y, 10, 10);
    }
   
    Location centroid = GeoUtils.getCentroid(locations);
    ScreenPosition centroidPos = map.getScreenPosition(centroid);
    fill(255, 0, 0);
    ellipse(centroidPos.x, centroidPos.y, 10, 10);
   
  }
View Full Code Here

  public void draw() {
    background(0);
    map.draw();

    for (Location location : locations) {
      ScreenPosition pos = map.getScreenPosition(location);
      ellipse(pos.x, pos.y, 10, 10);
    }
  }
View Full Code Here

    map.draw();

    fill(0);
    List<PVector> vertices = new ArrayList<PVector>();
    for (Location location : locations) {
      ScreenPosition pos = map.getScreenPosition(location);
      ellipse(pos.x, pos.y, 10, 10);
      vertices.add(pos);
    }

    fill(0, 100);
    beginShape();
    for (PVector pos : vertices) {
      vertex(pos.x, pos.y);
    }
    endShape();

    Location centroid = GeoUtils.getCentroid(locations);
    ScreenPosition centroidPos = map.getScreenPosition(centroid);
    fill(255, 0, 0);
    ellipse(centroidPos.x, centroidPos.y, 10, 10);

    PVector centroidPos1 = getCentroidOfPolygon(vertices);
    fill(0, 255, 0);
View Full Code Here

    background(0);
    map.draw();

    debugDisplay.draw();

    ScreenPosition pos1 = map.getScreenPosition(location1);
    ScreenPosition pos2 = map.getScreenPosition(location2);
    ScreenPosition pos3 = map.getScreenPosition(location3);

    printInfo("1", location1, pos1);
    printInfo("2", location2, pos2);
    printInfo("3", location3, pos3);
View Full Code Here

TOP

Related Classes of de.fhpotsdam.unfolding.utils.ScreenPosition

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.