private static TextureData createEmptyTextureData() { return new TextureData(null, 1, 1); } }
/** * {@inheritDoc} * * @see kendzi.josm.kendzi3d.service.TextureLibrary#getTextureDefault(java.lang.String) */ @Override public TextureData getTextureDefault(String key) { TextureData texture = getRadnomTextureForKey(key); if (texture == null) { return new TextureData(null, 1, 1); } return texture; }
public static TextureData takeWindowsColumnsTextureData(BuildingModel buildingModel, BuildingPart bp, Wall w, WallPart wp, BuildingElementsTextureManager tm) { String mt = null; TextureData td = tm.findTexture(new TextureFindCriteria(Type.WINDOWS, mt, null, null, null, false)); if (td == null) { td = new TextureData(null, 1, 1); } return td; }
public static TextureData colorableTextureData(TextureData textureData) { String tex0 = null; String tex1 = null; double width = 1d; double height = 1d; if (textureData != null) { tex0 = textureData.getTex0(); tex1 = textureData.getTex1(); width = textureData.getWidth(); height = textureData.getHeight(); } if (tex0 == null) { tex0 = "#c=0xffffff"; } else { tex0 = "#bw=" + tex0; } return new TextureData(tex0, tex1, width, height, true); }
public static TextureData takeFloorTextureData(BuildingModel buildingModel, BuildingPart bp, BuildingElementsTextureManager tm, boolean colorable) { String mt = null; if (bp.getFloorMaterialType() != null) { mt = bp.getFloorMaterialType(); } else if (buildingModel.getFloorMaterialType() != null) { mt = buildingModel.getFloorMaterialType(); } TextureData td = tm.findTexture(new TextureFindCriteria(Type.FLOOR, mt, null, null, null, colorable)); if (td == null) { td = new TextureData(null, 1, 1); } return td; }
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; }
public static TextureData takeFacadeTextureData(BuildingModel buildingModel, NodeBuildingPart bp, BuildingElementsTextureManager tm, boolean colorable) { String mt = null; 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; }
private TextureData convert(org.kendzi3d.TextureData td) { TextureData textureData = new TextureData(td.getTex0(), td.getTex1(), td.getWidth() == null ? 1d : td.getWidth(), td.getHeight() == null ? 1d : td.getHeight(), td.isColorable()); return textureData; }
return new TextureData(facadeColorFile, 1d, 1d);
private static TextureData takeRoofTextureData(BuildingModel buildingModel, BuildingPart bp, Wall w, BuildingElementsTextureManager tm, boolean colorable) { String mt = null; if (w.getRoofMaterialType() != null) { mt = w.getRoofMaterialType(); } else if (bp.getRoofMaterialType() != null) { mt = bp.getRoofMaterialType(); } else if (buildingModel.getRoofMaterialType() != null) { mt = buildingModel.getRoofMaterialType(); } TextureData td = tm.findTexture(new TextureFindCriteria(Type.ROOF, mt, null, null, null, colorable)); if (td == null) { td = new TextureData(null, 1, 1); } return td; }
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; }