use of org.bimserver.shared.HashMapWrappedVirtualObject in project BIMserver by opensourceBIM.
the class StreamingGeometryGenerator method processExtends.
void processExtends(VirtualObject geometryInfo, double[] transformationMatrix, float[] vertices, int index, GenerateGeometryResult generateGeometryResult) throws BimserverDatabaseException {
double x = vertices[index];
double y = vertices[index + 1];
double z = vertices[index + 2];
double[] result = new double[4];
Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0);
x = result[0];
y = result[1];
z = result[2];
HashMapWrappedVirtualObject minBounds = (HashMapWrappedVirtualObject) geometryInfo.eGet(GeometryPackage.eINSTANCE.getGeometryInfo_MinBounds());
HashMapWrappedVirtualObject maxBounds = (HashMapWrappedVirtualObject) geometryInfo.eGet(GeometryPackage.eINSTANCE.getGeometryInfo_MaxBounds());
minBounds.set("x", Math.min(x, (double) minBounds.eGet("x")));
minBounds.set("y", Math.min(y, (double) minBounds.eGet("y")));
minBounds.set("z", Math.min(z, (double) minBounds.eGet("z")));
maxBounds.set("x", Math.max(x, (double) maxBounds.eGet("x")));
maxBounds.set("y", Math.max(y, (double) maxBounds.eGet("y")));
maxBounds.set("z", Math.max(z, (double) maxBounds.eGet("z")));
generateGeometryResult.setMinX(Math.min(x, generateGeometryResult.getMinX()));
generateGeometryResult.setMinY(Math.min(y, generateGeometryResult.getMinY()));
generateGeometryResult.setMinZ(Math.min(z, generateGeometryResult.getMinZ()));
generateGeometryResult.setMaxX(Math.max(x, generateGeometryResult.getMaxX()));
generateGeometryResult.setMaxY(Math.max(y, generateGeometryResult.getMaxY()));
generateGeometryResult.setMaxZ(Math.max(z, generateGeometryResult.getMaxZ()));
}
Aggregations