예제 #1
0
  private void processLightObject(OsmPolygon poly) {
    if (XplaneOptionsHelper.getOptions().isGenerateLights()) {
      XplaneDsfObject object = dsfObjectsProvider.getRandomDsfLightObject(poly);
      if (object != null) {
        object.setPolygon(poly);
        try {
          writeObjectToDsf(object);

        } catch (Osm2xpBusinessException e) {
        }
      }
    }
  }
예제 #2
0
  /**
   * choose and write a 3D object in the dsf file.
   *
   * @param polygon osm polygon.
   * @return true if a 3D object has been written in the dsf file.
   */
  private boolean process3dObject(OsmPolygon osmPolygon) {
    Boolean result = false;

    if (XplaneOptionsHelper.getOptions().isGenerateObj()) {
      // simplify shape if checked and if necessary
      if (GuiOptionsHelper.getOptions().isSimplifyShapes() && !osmPolygon.isSimplePolygon()) {
        osmPolygon.simplifyPolygon();
      }
      XplaneDsfObject object = dsfObjectsProvider.getRandomDsfObject(osmPolygon);
      if (object != null) {
        object.setPolygon(osmPolygon);
        try {
          writeObjectToDsf(object);
          result = true;
        } catch (Osm2xpBusinessException e) {
          result = false;
        }
      }
    }
    return result;
  }