/** * @param in * @return * @throws IOException */ private PrototypeReference readPrototypeReference( DataInputStream in ) throws IOException { String id = in.readUTF(); float width = in.readFloat(); float height = in.readFloat(); float depth = in.readFloat(); float angle = in.readFloat(); float[] location = new float[3]; location[0] = in.readFloat(); location[1] = in.readFloat(); location[2] = in.readFloat(); return new PrototypeReference( id, angle, location, width, height, depth ); }
/** * @param rqm * @param bbox * @return */ private RenderableQualityModel createPrototypeReference( RegressionForm form ) { // get 2D projection of 3D object required for calculating convex hull // Coordinate[] coordinates = projectToPlane( rqm ); float angle = form.getRotationAngle(); float width = form.getWidth(); float depth = form.getDepth(); float height = form.getHeight(); return new RenderableQualityModel( new PrototypeReference( "box", angle, form.getCentroid(), width, height, depth ) ); }
/** * @param mappedColumns * @param values * @return */ private WorldRenderableObject createWRO( Map<Column, Integer> mappedColumns, String[] values ) { float height = parseFloatingPoint( values[mappedColumns.get( Column.HEIGHT )], Column.HEIGHT ); float width = 1; float depth = 1; float northing = parseFloatingPoint( values[mappedColumns.get( Column.NORTHING )], Column.NORTHING ); northing += wpvsTranslationVector[1]; float easting = parseFloatingPoint( values[mappedColumns.get( Column.EASTING )], Column.EASTING ); easting += wpvsTranslationVector[0]; float groundLevel = parseFloatingPoint( values[mappedColumns.get( Column.GROUND_LEVEL )], Column.GROUND_LEVEL ); String protoTypeRef = values[mappedColumns.get( Column.PROTOTYPE )]; float[] location = new float[] { easting, northing, groundLevel }; PrototypeReference reference = new PrototypeReference( protoTypeRef, 0, location, width, height, depth ); RenderableQualityModel[] qualityLevels = new RenderableQualityModel[numberOfLevels]; Envelope env = getEnvelope( location, width, height, depth ); qualityLevels[qualityLevel] = new RenderableQualityModel( reference ); WorldRenderableObject result = new WorldRenderableObject( values[mappedColumns.get( Column.ID )], null, env, qualityLevels ); return result; }
if ( building != null ) { PrototypeReference pr = new PrototypeReference( prototypeID, rotation, new float[] { (float) translation[0], (float) translation[1] }, width, height, depth );