Tabnine Logo
PolygonWithHolesList2d
Code IndexAdd Tabnine to your IDE (free)

How to use
PolygonWithHolesList2d
in
kendzi.math.geometry.polygon

Best Java code snippets using kendzi.math.geometry.polygon.PolygonWithHolesList2d (Showing top 20 results out of 315)

origin: kendzi/kendzi3d

public static PolygonWithHolesList2d transformationPolygonWithHoles(PolygonWithHolesList2d polygonWithHoles,
    SimpleMatrix transformLocal) {
  PolygonList2d outer = transformPolygon(polygonWithHoles.getOuter(), transformLocal);
  List<PolygonList2d> inner = new ArrayList<PolygonList2d>();
  if (polygonWithHoles.getInner() != null) {
    for (PolygonList2d pi : polygonWithHoles.getInner()) {
      inner.add(transformPolygon(pi, transformLocal));
    }
  }
  return new PolygonWithHolesList2d(outer, inner);
}
origin: kendzi/kendzi3d

private static Polygon convert(PolygonWithHolesList2d polygonWithHoles) {
  Polygon outer = convert(polygonWithHoles.getOuter());
  if (polygonWithHoles.getInner() != null) {
    for (PolygonList2d inner : polygonWithHoles.getInner()) {
      outer.addHole(convert(inner));
    }
  }
  return outer;
}
origin: kendzi/kendzi3d

private String debugPolygon(PolygonWithHolesList2d buildingTransformed) {
  StringBuffer sb = new StringBuffer();
  sb.append("** Debug for polygon **\n");
  List<Point2d> outer = buildingTransformed.getOuter().getPoints();
  sb.append("List<Point2d> polygon = new ArrayList<Point2d>();\n");
  for (Point2d p : outer) {
    sb.append("polygon.add(new Point2d(" + p.x + ",  " + p.y + "));\n");
  }
  List<List<Point2d>> inners = PolygonWithHolesList2dUtil.getListOfHolePoints(buildingTransformed);
  int holeCount = 0;
  for (List<Point2d> polygonList2d : inners) {
    holeCount++;
    sb.append("\nList<Point2d> hole" + holeCount + " = new ArrayList<Point2d>();\n");
    for (Point2d p : polygonList2d) {
      sb.append("hole" + holeCount + ".add(new Point2d(" + p.x + ",  " + p.y + "));\n");
    }
  }
  sb.append("****");
  return sb.toString();
}
origin: kendzi/kendzi3d

public static PolygonWithHolesList2d buildingPartToPolygonWithHoles(BuildingPart bp) {
  PolygonList2d outerPolygon = wallToOuterPolygon(bp.getWall());
  List<PolygonList2d> innerList = new ArrayList<PolygonList2d>();
  if (bp.getInlineWalls() != null) {
    for (Wall innerWall : bp.getInlineWalls()) {
      PolygonList2d innerPolygon = wallToOuterPolygon(innerWall);
      innerList.add(innerPolygon);
    }
  }
  return new PolygonWithHolesList2d(outerPolygon, innerList);
}
origin: kendzi/kendzi3d

private List<List<Point2d>> innerLists(PolygonWithHolesList2d buildingPolygon) {
  List<List<Point2d>> ret = new ArrayList<List<Point2d>>();
  if (buildingPolygon.getInner() == null) {
    return ret;
  }
  for (PolygonList2d p : buildingPolygon.getInner()) {
    ret.add(p.getPoints());
  }
  return ret;
}
origin: kendzi/kendzi3d

@Override
public RoofTypeOutput buildRoof(Point2d startPoint, PolygonWithHolesList2d buildingPolygon, DormerRoofModel roof,
    double height, RoofMaterials roofTextureData) {
  SimpleMatrix transformLocal = TransformationMatrix2d.tranA(-startPoint.x, -startPoint.y);
  List<Point2d> polygon = buildingPolygon.getOuter().getPoints();
  polygon = TransformationMatrix2d.transformList(polygon, transformLocal);
  Double h1 = null;
  Double angle = null;
  Measurement measurement = roof.getMeasurements().get(MeasurementKey.HEIGHT_1);
  if (isUnit(measurement, MeasurementUnit.DEGREES)) {
    angle = measurement.getValue();
  } else {
    h1 = getHeightMeters(roof.getMeasurements(), MeasurementKey.HEIGHT_1, DEFAULT_ROOF_HEIGHT);
  }
  RoofTypeOutput rto = build(polygon, h1, angle, roofTextureData);
  SimpleMatrix transformGlobal = TransformationMatrix3d.tranA(startPoint.x, height - rto.getHeight(), -startPoint.y);
  rto.setTransformationMatrix(transformGlobal);
  return rto;
}
origin: kendzi/kendzi3d

private boolean isComplex(PolygonWithHolesList2d buildingPolygon, DormerRoofModel roof) {
  if (roof.getDirection() != null) {
    return false;
  }
  if (roof.getOrientation() != null) {
    return false;
  }
  if (buildingPolygon.getInner() != null && buildingPolygon.getInner().size() > 0) {
    // has any holes
    return true;
  }
  List<Point2d> points = buildingPolygon.getOuter().getPoints();
  RectanglePointVector2d orientedBBox = RectangleUtil.findRectangleContur(points);
  double orientedBBoxArea = orientedBBox.getHeight() * orientedBBox.getWidth();
  float polygonArea = Math.abs(PolygonUtil.area(points));
  return orientedBBoxArea > polygonArea * 1.2;
}
origin: kendzi/kendzi3d

/**
 * @param pRelation
 * @param pPerspective
 * @param ret
 * @return
 */
public static List<PolygonWithHolesList2d> findPolygonsWithHoles(Relation pRelation, Perspective pPerspective) {
  List<PolygonWithHolesList2d> ret = new ArrayList<PolygonWithHolesList2d>();
  List<AreaWithHoles> waysPolygon = PolygonWithHolesUtil.findAreaWithHoles(pRelation);
  for (AreaWithHoles waysPolygon2 : waysPolygon) {
    List<PolygonList2d> inner = new ArrayList<PolygonList2d>();
    PolygonList2d outer = parse(waysPolygon2.getOuter(), pPerspective);
    if (waysPolygon2.getInner() != null) {
      for (List<ReversableWay> rwList : waysPolygon2.getInner()) {
        inner.add(parse(rwList, pPerspective));
      }
    }
    ret.add(new PolygonWithHolesList2d(outer, inner));
  }
  return ret;
}
origin: kendzi/kendzi3d

@Override
public RoofTypeOutput buildRoof(Point2d pStartPoint, PolygonWithHolesList2d buildingPolygon, DormerRoofModel pRoof,
    double height, RoofMaterials roofTextureData) {
  SimpleMatrix transformLocal = TransformationMatrix2d.tranA(-pStartPoint.x, -pStartPoint.y);
  List<Point2d> polygon = buildingPolygon.getOuter().getPoints();
  polygon = TransformationMatrix2d.transformList(polygon, transformLocal);
  Double h1 = null;
  Double angle = null;
  Measurement measurement = pRoof.getMeasurements().get(MeasurementKey.HEIGHT_1);
  if (isUnit(measurement, MeasurementUnit.DEGREES)) {
    angle = measurement.getValue();
  } else {
    h1 = getHeightMeters(pRoof.getMeasurements(), MeasurementKey.HEIGHT_1, DEFAULT_ROOF_HEIGHT);
  }
  RoofTypeOutput rto = build(polygon, h1, angle, roofTextureData);
  SimpleMatrix transformGlobal = TransformationMatrix3d.tranA(pStartPoint.x, height - rto.getHeight(), -pStartPoint.y);
  rto.setTransformationMatrix(transformGlobal);
  return rto;
}
origin: kendzi/kendzi3d

PolygonList2d outer = polygon.getOuter();
Collection<PolygonList2d> holes = polygon.getInner();
origin: kendzi/kendzi3d

List<PolygonWithHolesList2d> getMultiPolygonWithHolesWay(Way way, Perspective perspective) {
  List<PolygonWithHolesList2d> ret = new ArrayList<PolygonWithHolesList2d>();
  List<Point2d> poly = new ArrayList<Point2d>();
  int size = way.getNodesCount();
  if (size > 0) {
    if (way.getNode(0).equals(way.getNode(way.getNodesCount() - 1))) {
      size--;
    }
    for (int i = 0; i < size; i++) {
      Point2d p = perspective.calcPoint(way.getNode(i));
      poly.add(p);
    }
    ret.add(new PolygonWithHolesList2d(new PolygonList2d(poly), null));
  }
  return ret;
}
origin: kendzi/kendzi3d

List<Point2d> outer = buildingTransformed.getOuter().getPoints();
List<List<Point2d>> inners = PolygonWithHolesList2dUtil.getListOfHolePoints(buildingTransformed);
origin: kendzi/kendzi3d

List<Point2d> pBorderList = buildingPolygon.getOuter().getPoints();
origin: kendzi/kendzi3d

List<Point2d> polygon = buildingPolygon.getOuter().getPoints();
origin: kendzi/kendzi3d

List<Point2d> outlineList = buildingPolygon.getOuter().getPoints();
origin: kendzi/kendzi3d

if (direction == null) {
  PolygonList2d outerPolygon = buildingPolygon.getOuter();
  PolygonList2d outerPolygon = buildingPolygon.getOuter();
origin: kendzi/kendzi3d

@Override
public RoofTypeOutput buildRoof(Point2d pStartPoint, PolygonWithHolesList2d buildingPolygon, DormerRoofModel pRoof,
    double height, RoofMaterials roofTextureData) {
  List<Point2d> pPolygon = buildingPolygon.getOuter().getPoints();
  SimpleMatrix transformLocal = TransformationMatrix2d.tranA(-pStartPoint.x, -pStartPoint.y);
  pPolygon = TransformationMatrix2d.transformList(pPolygon, transformLocal);
  // rectangleContur =
  // TransformationMatrix2d.transformArray(rectangleContur,
  // transformLocal);
  PolygonList2d borderPolygon = new PolygonList2d(pPolygon);
  Circle circle = CircleInsidePolygon.iterativeNonConvex(borderPolygon, 0.01);
  int isection = getIsection(pRoof.getRoofTypeParameter());
  boolean soft = isSoft(pRoof.getRoofTypeParameter());
  Bend[] bends = getBends(pRoof.getMeasurements(), circle);
  RoofTypeOutput rto = build(pPolygon, circle.getPoint(), bends, isection, soft, roofTextureData);
  SimpleMatrix transformGlobal = TransformationMatrix3d.tranA(pStartPoint.x, height - rto.getHeight(), -pStartPoint.y);
  rto.setTransformationMatrix(transformGlobal);
  return rto;
}
origin: kendzi/kendzi3d

TextureData roofTexture = roofTextureData.getRoof().getTextureData();
List<Point2d> pBorderList = buildingPolygon.getOuter().getPoints();
PolygonList2d borderPolygon = new PolygonList2d(pBorderList);
origin: kendzi/kendzi3d

List<Point2d> outlineList = buildingPolygon.getOuter().getPoints();
origin: kendzi/kendzi3d

TextureData roofTexture = roofTextureData.getRoof().getTextureData();
List<Point2d> pBorderList = buildingPolygon.getOuter().getPoints();
PolygonList2d borderPolygon = new PolygonList2d(pBorderList);
kendzi.math.geometry.polygonPolygonWithHolesList2d

Most used methods

  • <init>
  • getInner
  • getOuter

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now