Search in sources :

Example 1 with Vector3f

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;
}
Also used : Vector3f(org.bimserver.models.geometry.Vector3f)

Example 2 with Vector3f

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;
}
Also used : Vector3f(org.bimserver.models.geometry.Vector3f)

Example 3 with Vector3f

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;
}
Also used : Vector3f(org.bimserver.models.geometry.Vector3f)

Example 4 with 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);
        }
    }
}
Also used : EClass(org.eclipse.emf.ecore.EClass) IdEObject(org.bimserver.emf.IdEObject) Vector3f(org.bimserver.models.geometry.Vector3f) GeometryInfo(org.bimserver.models.geometry.GeometryInfo) GeometryData(org.bimserver.models.geometry.GeometryData)

Example 5 with Vector3f

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() });
}
Also used : Vector3f(org.bimserver.models.geometry.Vector3f)

Aggregations

Vector3f (org.bimserver.models.geometry.Vector3f)8 GeometryInfo (org.bimserver.models.geometry.GeometryInfo)2 URL (java.net.URL)1 IdEObject (org.bimserver.emf.IdEObject)1 IfcModelInterface (org.bimserver.emf.IfcModelInterface)1 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)1 SProject (org.bimserver.interfaces.objects.SProject)1 GeometryData (org.bimserver.models.geometry.GeometryData)1 IfcProduct (org.bimserver.models.ifc2x3tc1.IfcProduct)1 BimServerClientInterface (org.bimserver.plugins.services.BimServerClientInterface)1 UsernamePasswordAuthenticationInfo (org.bimserver.shared.UsernamePasswordAuthenticationInfo)1 LowLevelInterface (org.bimserver.shared.interfaces.LowLevelInterface)1 EClass (org.eclipse.emf.ecore.EClass)1 Test (org.junit.Test)1