public <T extends IdEObject> List<T> getAllOfType(EClass eClass, Class<T> clazz, QueryInterface query) throws BimserverDatabaseException { IfcModelInterface allOfType = getAllOfType(eClass.getEPackage().getName(), eClass.getName(), query); return allOfType.getAllWithSubTypes(clazz); }
protected void calculateGeometryExtents() throws RenderEngineException, SerializerException { for (IfcProduct ifcProduct : model.getAllWithSubTypes(IfcProduct.class)) { try { calculateExtents(ifcProduct.getGlobalId(), ifcProduct); } catch (Exception e) { LoggerFactory.getLogger(AbstractGeometrySerializer.class).error("", e); } } }
public IdEObject copyBasicObjects(IfcModelInterface model, Map<IdEObject, IdEObject> bigMap) throws IfcModelInterfaceException { PackageMetaData packageMetaData = model.getPackageMetaData(); IdEObject newProject = null; for (IdEObject idEObject : model.getAllWithSubTypes(packageMetaData.getEClass("IfcProject"))) { newProject = copy(idEObject, false, skipRepresentation); bigMap.put(newProject, idEObject); } IdEObject newOwnerHistory = null; for (IdEObject idEObject : model.getAllWithSubTypes(packageMetaData.getEClass("IfcOwnerHistory"))) { newOwnerHistory = copy(idEObject, false, skipRepresentation); bigMap.put(newOwnerHistory, idEObject); } for (IdEObject idEObject : model.getAllWithSubTypes(packageMetaData.getEClass("IfcUnit"))) { bigMap.put(copy(idEObject, false, skipRepresentation), idEObject); } for (IdEObject idEObject : model.getAllWithSubTypes(packageMetaData.getEClass("IfcUnitAssignment"))) { bigMap.put(copy(idEObject, false, skipRepresentation), idEObject); } return newOwnerHistory; } }
public ModelColorizer(IfcModelInterface model) { this.model = model; for (IfcProduct product : model.getAllWithSubTypes(IfcProduct.class)) { IfcProductRepresentation productRepresentation = product.getRepresentation(); if (productRepresentation != null) {
} else { Set<EClass> classes = new HashSet<>(); for (IdEObject object : model.getAllWithSubTypes(packageMetaData.getEClass("IfcProduct"))) { IdEObject representation = (IdEObject)object.eGet(representationFeature); if (representation != null && ((List<?>)representation.eGet(representationsFeature)).size() > 0) {
allWithSubTypes = targetModel.getAllWithSubTypes(packageMetaData.getEClass("IfcProduct")); } else { allWithSubTypes = targetModel.getAll(eClass);
List<IdEObject> allWithSubTypes = new ArrayList<>(model.getAllWithSubTypes(productClass)); for (IdEObject ifcProduct : allWithSubTypes) { ifcProduct.forceLoad();
blue.eSet(blueFeature, 0.5D); for (IdEObject product : mergedModel.getAllWithSubTypes(packageMetaData.getEClass("IfcProduct"))) { IdEObject color = null; if (added.contains(product.getOid())) {
private void returnCachedData(IfcModelInterface model, GeometryCache geometryCache, DatabaseSession databaseSession, int pid, int rid, boolean store) throws BimserverDatabaseException, ObjectAlreadyExistsException, IfcModelInterfaceException { 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(createBuffer(model, databaseSession, geometryCacheEntry.getVertices(), store, pid, rid)); geometryData.setNormals(createBuffer(model, databaseSession, geometryCacheEntry.getNormals(), store, pid, rid)); GeometryInfo geometryInfo = databaseSession.create(GeometryPackage.eINSTANCE.getGeometryInfo(), pid, rid); Vector3f min = databaseSession.create(GeometryPackage.eINSTANCE.getVector3f(), pid, rid); min.setX(geometryCacheEntry.getGeometryInfo().getBounds().getMin().getX()); min.setY(geometryCacheEntry.getGeometryInfo().getBounds().getMin().getY()); min.setZ(geometryCacheEntry.getGeometryInfo().getBounds().getMin().getZ()); Vector3f max = databaseSession.create(GeometryPackage.eINSTANCE.getVector3f(), pid, rid); max.setX(geometryCacheEntry.getGeometryInfo().getBounds().getMax().getX()); max.setY(geometryCacheEntry.getGeometryInfo().getBounds().getMax().getY()); max.setZ(geometryCacheEntry.getGeometryInfo().getBounds().getMax().getZ()); Bounds bounds = GeometryFactory.eINSTANCE.createBounds(); bounds.setMin(min); bounds.setMax(max); geometryInfo.setBounds(bounds); geometryInfo.setData(geometryData); ifcProduct.eSet(ifcProduct.eClass().getEStructuralFeature("geometry"), geometryInfo); } } }