use of org.bimserver.models.geometry.Vector3f in project BIMserver by opensourceBIM.
the class GenerateGeometryResult method getMaxBoundsAsVector3f.
public Vector3f getMaxBoundsAsVector3f() {
Vector3f max = GeometryFactory.eINSTANCE.createVector3f();
max.setX(this.max[0]);
max.setY(this.max[1]);
max.setZ(this.max[2]);
return max;
}
use of org.bimserver.models.geometry.Vector3f in project BIMserver by opensourceBIM.
the class GenerateGeometryResult method getMinBoundsAsVector3f.
public Vector3f getMinBoundsAsVector3f() {
Vector3f min = GeometryFactory.eINSTANCE.createVector3f();
min.setX(this.min[0]);
min.setY(this.min[1]);
min.setZ(this.min[2]);
return min;
}
use of org.bimserver.models.geometry.Vector3f in project BIMserver by opensourceBIM.
the class GeometryGenerator method createVector3f.
private Vector3f createVector3f(PackageMetaData packageMetaData, IfcModelInterface model, double defaultValue, DatabaseSession session, boolean store, int pid, int rid) throws BimserverDatabaseException, IfcModelInterfaceException, ObjectAlreadyExistsException {
Vector3f vector3f = null;
if (store) {
vector3f = model.createAndAdd(GeometryPackage.eINSTANCE.getVector3f(), session.newOid(GeometryPackage.eINSTANCE.getVector3f()));
session.store(vector3f, pid, rid);
} else {
vector3f = GeometryFactory.eINSTANCE.createVector3f();
}
vector3f.setX(defaultValue);
vector3f.setY(defaultValue);
vector3f.setZ(defaultValue);
return vector3f;
}
use of org.bimserver.models.geometry.Vector3f in project BIMserver by opensourceBIM.
the class GeometryGenerator method returnCachedData.
private void returnCachedData(IfcModelInterface model, GeometryCache geometryCache, DatabaseSession databaseSession, int pid, int rid) throws BimserverDatabaseException {
EClass productClass = model.getPackageMetaData().getEClass("IfcProduct");
List<IdEObject> products = model.getAllWithSubTypes(productClass);
for (IdEObject ifcProduct : products) {
GeometryCacheEntry geometryCacheEntry = geometryCache.get(ifcProduct.getExpressId());
if (geometryCacheEntry != null) {
GeometryData geometryData = databaseSession.create(GeometryPackage.eINSTANCE.getGeometryData(), pid, rid);
geometryData.setVertices(geometryCacheEntry.getVertices().array());
geometryData.setNormals(geometryCacheEntry.getNormals().array());
GeometryInfo geometryInfo = databaseSession.create(GeometryPackage.eINSTANCE.getGeometryInfo(), pid, rid);
Vector3f min = databaseSession.create(GeometryPackage.eINSTANCE.getVector3f(), pid, rid);
min.setX(geometryCacheEntry.getGeometryInfo().getMinBounds().getX());
min.setY(geometryCacheEntry.getGeometryInfo().getMinBounds().getY());
min.setZ(geometryCacheEntry.getGeometryInfo().getMinBounds().getZ());
Vector3f max = databaseSession.create(GeometryPackage.eINSTANCE.getVector3f(), pid, rid);
max.setX(geometryCacheEntry.getGeometryInfo().getMaxBounds().getX());
max.setY(geometryCacheEntry.getGeometryInfo().getMaxBounds().getY());
max.setZ(geometryCacheEntry.getGeometryInfo().getMaxBounds().getZ());
geometryInfo.setMinBounds(min);
geometryInfo.setMaxBounds(max);
geometryInfo.setData(geometryData);
ifcProduct.eSet(ifcProduct.eClass().getEStructuralFeature("geometry"), geometryInfo);
}
}
}
use of org.bimserver.models.geometry.Vector3f in project BIMserver by opensourceBIM.
the class Extends method integrate.
public void integrate(GeometryInfo geometryInfo) {
Vector3f min = geometryInfo.getMinBounds();
Vector3f max = geometryInfo.getMaxBounds();
addToMinExtents(new double[] { min.getX(), min.getY(), min.getZ() });
addToMaxExtents(new double[] { max.getX(), max.getY(), max.getZ() });
}
Aggregations