Skip to content

Commit

Permalink
Merge pull request #7 from jyrkioraskari/master
Browse files Browse the repository at this point in the history
V2.6
  • Loading branch information
jyrkioraskari authored Sep 29, 2020
2 parents e0955e2 + 1e16851 commit 41ef853
Show file tree
Hide file tree
Showing 573 changed files with 60,008 additions and 8,757 deletions.
Binary file removed IFCtoLBD-Desktop_Java_12_win10_installation.zip
Binary file not shown.
Binary file removed IFCtoLBD-Desktop_Java_8.jar
Binary file not shown.
Binary file removed IFCtoLBD-Desktop_Java_8_win10_installation.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion IFCtoLBDGeometry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
</plugin>
</plugins>
</build>
<version>2.3</version>
<version>2.6</version>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,56 +32,56 @@ public BoundingBox getBoundingBox(String guid) {
BoundingBox boundingBox = null;

IfcOpenShellEntityInstance renderEngineInstance;
renderEngineInstance = renderEngineModel.getInstancesByGuid().get(guid);
renderEngineInstance = renderEngineModel.getInstanceFromGUID(guid);

if (renderEngineInstance == null) {
return null;
}
IfcGeomServerClientEntity geometry = renderEngineInstance.generateGeometry();
if (geometry != null && geometry.getIndices().length > 0) {
boundingBox = new BoundingBox();
double[] tranformationMatrix = new double[16];
if (renderEngineInstance.getTransformationMatrix() != null) {
tranformationMatrix = renderEngineInstance.getTransformationMatrix();
tranformationMatrix = Matrix.changeOrientation(tranformationMatrix);
} else {
Matrix.setIdentityM(tranformationMatrix, 0);
}

float[] vertices=geometry.getPositions();
for (int i = 0; i < geometry.getPositions().length; i+=3) {
processExtends(boundingBox, tranformationMatrix, vertices[i],vertices[i+1],vertices[i+2]);
}
}
if (geometry != null && geometry.getIndices().length > 0) {
boundingBox = new BoundingBox();
double[] tranformationMatrix = new double[16];
if (renderEngineInstance.getTransformationMatrix() != null) {
tranformationMatrix = renderEngineInstance.getTransformationMatrix();
tranformationMatrix = Matrix.changeOrientation(tranformationMatrix);
} else {
Matrix.setIdentityM(tranformationMatrix, 0);
}

float[] vertices = geometry.getPositions();
for (int i = 0; i < geometry.getPositions().length; i += 3) {
processExtends(boundingBox, tranformationMatrix, vertices[i], vertices[i + 1], vertices[i + 2]);
}
}
return boundingBox;
}

private IfcOpenShellModel getRenderEngineModel(File ifcFile) throws RenderEngineException, IOException {
String ifcGeomServerLocation = OperatingSystemCopyOf_IfcGeomServer.getIfcGeomServer();
System.out.println("ifcGeomServerLocation: "+ifcGeomServerLocation);
System.out.println("ifcGeomServerLocation: " + ifcGeomServerLocation);
Path ifcGeomServerLocationPath = Paths.get(ifcGeomServerLocation);
IfcOpenShellEngine ifcOpenShellEngine = new IfcOpenShellEngine(ifcGeomServerLocationPath, false, false);
System.out.println("init");
ifcOpenShellEngine.init();
System.out.println("init done");
FileInputStream ifcFileInputStream = new FileInputStream(ifcFile);

System.out.println("ifcFile: "+ifcFile);
System.out.println("ifcFile: " + ifcFile);
IfcOpenShellModel model = ifcOpenShellEngine.openModel(ifcFileInputStream);
System.out.println("IfcOpenShell opens ifc: " + ifcFile.getAbsolutePath());

model.generateGeneralGeometry();
return model;
}

private void processExtends(BoundingBox boundingBox, double[] transformationMatrix, double x, double y, double z) {
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];
Point3d point = new Point3d(x / 1000, y / 1000, z / 1000);
boundingBox.add(point);
}
private void processExtends(BoundingBox boundingBox, double[] transformationMatrix, double x, double y, double z) {
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];
Point3d point = new Point3d(x / 1000, y / 1000, z / 1000);
boundingBox.add(point);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,14 @@ public IfcGeomServerClientEntity getNext() throws RenderEngineException {
askForMore();

return e.getEntity();
} catch (IOException e) {
}
// JO 2020
catch (java.io.EOFException e) {
// Do nothing.The file is read!
return null;
}
catch (IOException e) {
e.printStackTrace();
terminate();
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
import java.io.InputStream;
import java.nio.file.Path;

import org.bimserver.plugins.renderengine.RenderEngine;
import org.bimserver.plugins.renderengine.RenderEngineException;
import org.bimserver.plugins.renderengine.RenderEngineModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
import org.bimserver.models.store.StoreFactory;
import org.bimserver.plugins.PluginConfiguration;
import org.bimserver.plugins.PluginContext;
import org.bimserver.plugins.renderengine.RenderEngine;
import org.bimserver.plugins.renderengine.RenderEngineException;
import org.bimserver.plugins.renderengine.RenderEnginePlugin;
import org.bimserver.plugins.renderengine.VersionInfo;
import org.bimserver.shared.exceptions.PluginException;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;

import org.bimserver.plugins.renderengine.EntityNotFoundException;
import org.bimserver.plugins.renderengine.RenderEngineException;
import org.bimserver.plugins.renderengine.RenderEngineFilter;
import org.bimserver.plugins.renderengine.RenderEngineInstance;
import org.bimserver.plugins.renderengine.RenderEngineModel;
import org.bimserver.plugins.renderengine.RenderEngineSettings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -60,8 +66,8 @@ public class IfcOpenShellModel {
private InputStream ifcInputStream;

private HashMap<Integer,IfcOpenShellEntityInstance> instancesById;
private HashMap<String,IfcOpenShellEntityInstance> instancesByGuid;

private HashMap<String,IfcOpenShellEntityInstance> instancesByGUID;
private IfcGeomServerClient client;

public IfcOpenShellModel(IfcGeomServerClient client, InputStream ifcInputStream) throws RenderEngineException, IOException {
Expand Down Expand Up @@ -92,25 +98,27 @@ public void close() throws RenderEngineException {
public void generateGeneralGeometry() throws RenderEngineException {
// We keep track of instances ourselves
instancesById = new HashMap<Integer,IfcOpenShellEntityInstance>();
instancesByGuid = new HashMap<String,IfcOpenShellEntityInstance>();
instancesByGUID = new HashMap<String,IfcOpenShellEntityInstance>();

final double t0 = (double) System.nanoTime();

while (client.hasNext()) {
IfcGeomServerClientEntity next = client.getNext();
// Store the instance in our dictionary
if(next==null) // JO 2020
break;
IfcOpenShellEntityInstance instance = new IfcOpenShellEntityInstance(next);
System.out.println("GEN GEOM: "+next.getGuid());
// Store the instance in our dictionary
instancesById.put(next.getId(), instance);
instancesByGuid.put(next.getGuid(), instance);
System.out.println(next.getGuid());
instancesByGUID.put(next.getGuid(), instance);
}

final double t1 = (double) System.nanoTime();

LOGGER.debug(String.format("Took %.2f seconds to obtain representations for %d entities", (t1-t0) / 1.E9, instancesById.size()));
}

public IfcOpenShellEntityInstance getInstanceFromExpressId(int oid) throws RenderEngineException {
public IfcOpenShellEntityInstance getInstanceFromExpressId(int oid) {
if ( instancesById.containsKey(oid) ) {
return instancesById.get(oid);
} else {
Expand All @@ -121,9 +129,11 @@ public IfcOpenShellEntityInstance getInstanceFromExpressId(int oid) throws Rende
return null;
}
}

public HashMap<String, IfcOpenShellEntityInstance> getInstancesByGuid() {
return instancesByGuid;
public IfcOpenShellEntityInstance getInstanceFromGUID(String guid) {
if ( instancesByGUID.containsKey(guid) ) {
return instancesByGUID.get(guid);
} else {
return null;
}
}

}
Binary file removed IFCtoLBD_OpenAPI.war
Binary file not shown.
5 changes: 4 additions & 1 deletion IFCtoLBD_OpenAPI/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<dependent-module archiveName="IFCtoLBD-2.4.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/IFCtoLBD/IFCtoLBD">
<dependent-module archiveName="IFCtoLBD-2.6.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/IFCtoLBD/IFCtoLBD">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="IFCtoLBDGeometry-2.6.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/IFCtoLBDGeometry/IFCtoLBDGeometry">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="IFCtoRDF-0.5J-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/IFCtoRDF/IFCtoRDF">
Expand Down
4 changes: 2 additions & 2 deletions IFCtoLBD_OpenAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.rwth-aachen.dc.ifctolbd</groupId>
<artifactId>IFCtoLBD_OpenAPI</artifactId>
<version>2.4</version>
<version>2.6</version>
<packaging>war</packaging>
<name>IFCtoLBD OpenAPI Interface</name>

Expand Down Expand Up @@ -128,7 +128,7 @@
<dependency>
<groupId>io.github.jyrkioraskari</groupId>
<artifactId>IFCtoLBD</artifactId>
<version>2.4</version>
<version>2.6</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.jena/apache-jena-libs -->
Expand Down
Binary file added IFCtoLBD_Python/jars/FastInfoset-1.2.16.jar
Binary file not shown.
Binary file removed IFCtoLBD_Python/jars/IFCtoLBD-2.4.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/IFCtoLBD-2.6.jar
Binary file not shown.
Binary file removed IFCtoLBD_Python/jars/IFCtoRDF-0.5J-SNAPSHOT.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/ST4-4.0.8.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/antlr-2.7.7.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/antlr-3.5.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/antlr-complete-3.5.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/antlr-runtime-3.5.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/aopalliance-1.0.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/cdi-api-1.0.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/commonj.sdo-2.1.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/commons-lang-2.6.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/gmbal-4.0.0.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/guice-4.0-no_aop.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/gunit-3.5.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/ha-api-3.1.12.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/hamcrest-core-1.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/httpmime-4.5.7.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/ifcplugins-0.0.99.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jakarta.jws-api-1.1.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jakarta.mail-api-1.6.3.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jakarta.xml.ws-api-2.3.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/java-getopt-1.0.13.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/javassist-3.24.1-GA.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/javax.inject-1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/javax.json-1.0.4.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/javax.servlet-api-3.1.0.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jaxb-jxc-2.3.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jaxb-runtime-2.3.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jaxb-xjc-2.3.2.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jaxws-rt-2.3.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jaxws-tools-2.3.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/jsr250-api-1.0.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/junit-4.10.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/management-api-3.2.1.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/maven-artifact-3.3.9.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/maven-core-3.3.9.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/maven-model-3.3.9.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/maven-plugin-api-3.3.9.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/maven-settings-3.3.9.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/mimepull-1.9.11.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/org.eclipse.osgi-3.16.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pfl-asm-4.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pfl-basic-4.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pfl-basic-tools-4.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pfl-dynamic-4.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pfl-tf-4.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pfl-tf-tools-4.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/plexus-cipher-1.4.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/plexus-classworlds-2.5.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/plexus-utils-3.0.22.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/pluginbase-1.5.182.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/policy-2.7.6.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/protobuf-java-2.6.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/saaj-impl-1.5.1.jar
Binary file not shown.
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/shared-1.5.182.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/slf4j-api-1.6.2.jar
Binary file not shown.
Binary file removed IFCtoLBD_Python/jars/slf4j-api-1.7.6.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/stax-api-1.0.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/stax-ex-1.8.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/stax2-api-4.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/streambuffer-1.5.7.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/stringtemplate-3.2.1.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/txw2-2.3.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/vecmath-1.5.2.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/woodstox-core-5.1.0.jar
Binary file not shown.
Binary file added IFCtoLBD_Python/jars/xmlbeans-2.6.0.jar
Binary file not shown.
Loading

0 comments on commit 41ef853

Please sign in to comment.