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

How to use
WallPart
in
kendzi.kendzi3d.buildings.model

Best Java code snippets using kendzi.kendzi3d.buildings.model.WallPart (Showing top 11 results out of 315)

origin: kendzi/kendzi3d

private static WallPart parseWallPart(ReversableWay rw, Perspective pPerspective) {
  Way way = rw.getWay();
  WallPart wp = new WallPart();
  List<WallNode> wnList = new ArrayList<WallNode>();
  if (!rw.isReversed()) {
    for (int i = 0; i < way.getNodesCount(); i++) {
      WallNode wn = parseWallNode(way.getNode(i), pPerspective);
      wnList.add(wn);
    }
  } else {
    for (int i = way.getNodesCount() - 1; i >= 0; i--) {
      WallNode wn = parseWallNode(way.getNode(i), pPerspective);
      wnList.add(wn);
    }
  }
  wp.setNodes(wnList);
  wp.setBuildingElements(parseBuildingAttributeWallElement(way));
  // String parseFacadeName =
  // BuildingAttributeParser.parseFacadeMaterialName(w);
  // wp.setFacadeTextureData(BuildingAttributeParser.parseFacadeTexture(parseFacadeName,
  // this.textureLibraryService));
  // wp.setColor(BuildingAttributeParser.parseFacadeColor(w));
  wp.setFacadeMaterialType(BuildingAttributeParser.parseFacadeMaterialName(way));
  wp.setFacadeColor(BuildingAttributeParser.parseFacadeColor(way));
  wp.setRoofMaterialType(BuildingAttributeParser.parseRoofMaterialName(way));
  wp.setRoofColor(BuildingAttributeParser.parseRoofColor(way));
  return wp;
}
origin: kendzi/kendzi3d

  private static PolygonList2d wallPartsToPolygon(List<WallPart> wallParts) {

    List<Point2d> points = new ArrayList<Point2d>();

    for (WallPart p : wallParts) {
      if (points.size() > 0 && p.getNodes().size() > 0) {
        Point2d lastAdded = points.get(points.size() - 1);
        Point2d newToAdd = p.getNodes().get(0).point;
        if (lastAdded.equals(newToAdd)) {
          points.remove(points.size() - 1);
        }
      }

      for (WallNode n : p.getNodes()) {
        points.add(n.point);
      }
    }

//        if (points.size() > 1) {
    if (points.get(0).equals(points.get(points.size()-1))) {
      points.remove(points.size()-1);
    } else {
      throw new IllegalArgumentException("wall is not closed!!!");
    }

    return new PolygonList2d(points);
  }
 
origin: kendzi/kendzi3d

private static Color takeFacadeColor(BuildingModel buildingModel, BuildingPart bp, Wall w, WallPart wp,
    BuildingElementsTextureManager tm) {
  Color c = null;
  if (wp != null && wp.getFacadeColor() != null) {
    c = wp.getFacadeColor();
  } else if (w.getFacadeColor() != null) {
    c = w.getFacadeColor();
  } else if (bp.getFacadeColor() != null) {
    c = bp.getFacadeColor();
  } else if (buildingModel.getFacadeColor() != null) {
    c = buildingModel.getFacadeColor();
  }
  return c;
}
origin: kendzi/kendzi3d

nodes.add(nodes.get(0));
WallPart wp = new WallPart();
wp.setNodes(nodes);
origin: kendzi/kendzi3d

private static Color takeRoofColor(BuildingModel buildingModel, BuildingPart bp, Wall w, WallPart wp,
    BuildingElementsTextureManager tm) {
  Color c = null;
  if (wp != null && wp.getRoofColor() != null) {
    c = wp.getRoofColor();
  } else if (w.getRoofColor() != null) {
    c = w.getRoofColor();
  } else if (bp.getRoofColor() != null) {
    c = bp.getRoofColor();
  } else if (buildingModel.getRoofColor() != null) {
    c = buildingModel.getRoofColor();
  }
  return c;
}
origin: kendzi/kendzi3d

public static TextureData takeFacadeTextureData(BuildingModel buildingModel, BuildingPart bp, Wall w, WallPart wp,
    BuildingElementsTextureManager tm, boolean colorable) {
  String mt = null;
  if (wp != null && wp.getFacadeMaterialType() != null) {
    mt = wp.getFacadeMaterialType();
  } else if (w.getFacadeMaterialType() != null) {
    mt = w.getFacadeMaterialType();
  } else if (bp.getFacadeMaterialType() != null) {
    mt = bp.getFacadeMaterialType();
  } else if (buildingModel.getFacadeMaterialType() != null) {
    mt = buildingModel.getFacadeMaterialType();
  }
  TextureData td = tm.findTexture(new TextureFindCriteria(Type.FACADE, mt, null, null, null, colorable));
  if (td == null) {
    td = new TextureData(null, 1, 1);
  }
  return td;
}
origin: kendzi/kendzi3d

private static TextureData generateWindowsOverlayTextureData(Wall wall, double minHeight, double wallHeight,
    BuildingPart buildingPart, BuildingModel buildingModel, BuildingElementsTextureManager tm, WallPart wallPart,
    double wallLength) {
  Integer windowsCols = hasWindowsCloumns(wallPart.getBuildingElements());
  if (windowsCols != null && windowsCols != 0) {
    /* Check if wall has any windows column defined. */
    TextureData windowsTextureData = takeWindowsColumnsTextureData(buildingModel, buildingPart, wall, wallPart, tm);
    double windowsSegmetLength = wallLength / (double) windowsCols;
    int facadeLevels = getFacadeLevels(wall, buildingPart);
    /*
     * Adjust texture data size to match wall size multiply by number of
     * window columns and levels.
     */
    double windowsSegmentHeight = (wallHeight - minHeight) / facadeLevels;
    return new TextureData(windowsTextureData.getTex0(), windowsSegmetLength, windowsSegmentHeight);
  }
  return null;
}
origin: kendzi/kendzi3d

private static double calcWallPartLength(WallPart wp) {
  double wallLength = 0;
  List<WallNode> nodes = wp.getNodes();
  int size = nodes.size();
  WallNode n1 = nodes.get(0);
  for (int i = 1; i < size; i++) {
    WallNode n2 = nodes.get(i);
    wallLength += n1.getPoint().distance(n2.getPoint());
    n1 = n2;
  }
  return wallLength;
}
origin: kendzi/kendzi3d

private Bbox2d calcBounds(BuildingPart bp) {
  Bbox2d bbox = new Bbox2d();
  List<WallPart> wallParts = bp.getWall().getWallParts();
  for (WallPart wp : wallParts) {
    for (WallNode wn : wp.getNodes()) {
      Point2d p = wn.getPoint();
      bbox.addPoint(p);
    }
  }
  return bbox;
}
origin: kendzi/kendzi3d

List<WallNode> nodes = wp.getNodes();
int size = nodes.size();
origin: kendzi/kendzi3d

List<WallPart> wallParts = bp.getWall().getWallParts();
for (WallPart wp : wallParts) {
  for (WallNode wn : wp.getNodes()) {
kendzi.kendzi3d.buildings.modelWallPart

Most used methods

  • <init>
  • getNodes
  • setNodes
  • getBuildingElements
  • getFacadeColor
  • getFacadeMaterialType
  • getRoofColor
  • setBuildingElements
  • setFacadeColor
  • setFacadeMaterialType
  • setRoofColor
  • setRoofMaterialType
  • setRoofColor,
  • setRoofMaterialType

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JFileChooser (javax.swing)
  • Top PhpStorm plugins
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