Skip to content

Commit

Permalink
Name/GUID/Classification indices added for IFC4, queries should work
Browse files Browse the repository at this point in the history
(GUID queries tested successfully)
  • Loading branch information
rubendel committed Dec 11, 2017
1 parent ffb0ec4 commit 2e4c74c
Show file tree
Hide file tree
Showing 25 changed files with 17,181 additions and 15,192 deletions.
10,276 changes: 5,138 additions & 5,138 deletions BimServer/generated/org/bimserver/interfaces/SConverter.java

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions BimServer/models/models.ecore
Expand Up @@ -11266,7 +11266,9 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Location" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Identification" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
unsettable="true">
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ExternalReferenceForResources"
Expand Down Expand Up @@ -13677,6 +13679,7 @@
eType="#/2/IfcClassificationSelect">
<eAnnotations source="inverse"/>
<eAnnotations source="inverse"/>
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IfcRelAssociatesConstraint" eSuperTypes="#/2/IfcRelAssociates">
Expand Down Expand Up @@ -14222,11 +14225,15 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="PredefinedType" eType="#/2/IfcRoofTypeEnum"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IfcRoot">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="GlobalId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="GlobalId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="OwnerHistory" eType="#/2/IfcOwnerHistory"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
unsettable="true">
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
</eClassifiers>
Expand Down
2 changes: 1 addition & 1 deletion BimServer/src/org/bimserver/database/Database.java
Expand Up @@ -92,7 +92,7 @@ public class Database implements BimDatabase {
* database-schema change. Do not change this variable when nothing has
* changed in the schema!
*/
public static final int APPLICATION_SCHEMA_VERSION = 36;
public static final int APPLICATION_SCHEMA_VERSION = 37;

public Database(BimServer bimServer, Set<? extends EPackage> emfPackages, KeyValueStore keyValueStore, MetaDataManager metaDataManager) throws DatabaseInitException {
this.cidToEclass = new EClass[Short.MAX_VALUE];
Expand Down
@@ -0,0 +1,50 @@
package org.bimserver.database.migrations.steps;

/******************************************************************************
* Copyright (C) 2009-2017 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see {@literal<http://www.gnu.org/licenses/>}.
*****************************************************************************/

import org.bimserver.database.DatabaseSession;
import org.bimserver.database.migrations.Migration;
import org.bimserver.database.migrations.Schema;
import org.eclipse.emf.ecore.EClass;

public class Step0037 extends Migration {

@Override
public void migrate(Schema schema, DatabaseSession databaseSession) {
EClass ifcRootClass = schema.getEClass("ifc4", "IfcRoot");
schema.addIndex(ifcRootClass.getEStructuralFeature("GlobalId"));
schema.addIndex(ifcRootClass.getEStructuralFeature("Name"));

EClass ifcClassificationReference = schema.getEClass("ifc4", "IfcClassificationReference");
EClass ifcRelAssociatesClassification = schema.getEClass("ifc4", "IfcRelAssociatesClassification");
//
// // This opposite/inverse is obviously missing from ifc2x3tc1
// // We can however not call this an opposite because of a mismatch
// EReference associatesClassification = schema.createEReference(ifcClassificationReference, "associatesClassification", ifcRelAssociatesClassification);
// associatesClassification.getEAnnotations().add(createHiddenAnnotation());

schema.addIndex(ifcClassificationReference.getEStructuralFeature("Identification"));
schema.addIndex(ifcRelAssociatesClassification.getEStructuralFeature("RelatingClassification"));

}

@Override
public String getDescription() {
return "Indices for IFC4";
}
}
Expand Up @@ -92,7 +92,7 @@ public ObjectIdentifier getOidOfGuidAlternative(EClass eClass, EAttribute attrib
return new ObjectIdentifier(oid, (short)oid);
}
} else {
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("Attribute " + attribute.getName() + " does not have the \"singleindex\" annotation");
}
return null;
}
Expand Down
7 changes: 7 additions & 0 deletions BimServer/src/org/bimserver/geometry/GeometryRunner.java
Expand Up @@ -67,6 +67,7 @@ public class GeometryRunner implements Runnable {
private Map<Long, ProductDef> map;
private ReportJob job;
private boolean reuseGeometry;
private boolean writeOutputFiles = false;

public GeometryRunner(StreamingGeometryGenerator streamingGeometryGenerator, EClass eClass, RenderEnginePool renderEnginePool, DatabaseSession databaseSession, RenderEngineSettings renderEngineSettings, ObjectProvider objectProvider,
StreamingSerializerPlugin ifcSerializerPlugin, RenderEngineFilter renderEngineFilter, GenerateGeometryResult generateGeometryResult, QueryContext queryContext, Query originalQuery, boolean geometryReused,
Expand Down Expand Up @@ -159,6 +160,9 @@ public void newObject(HashMapVirtualObject next) {
if (!this.streamingGeometryGenerator.running) {
return;
}
if (ifcProduct.get("GlobalId").equals("1sZn$z_i91bPOCQJOkOibU")) {
System.out.println();
}
Integer expressId = oidToEid.get(ifcProduct.getOid());
try {
RenderEngineInstance renderEngineInstance = renderEngineModel.getInstanceFromExpressId(expressId);
Expand Down Expand Up @@ -526,6 +530,9 @@ public void newObject(HashMapVirtualObject next) {
if (!notFoundObjects.isEmpty()) {
int debugId = writeDebugFile(bytes, false, notFoundObjects);
job.setException(new Exception("No express objects found in model"), debugId);
} else if (writeOutputFiles) {
int debugId = writeDebugFile(bytes, false, null);
job.setDebugFile(debugId);
}
in.close();
} catch (Throwable e) {
Expand Down
4 changes: 4 additions & 0 deletions BimServer/src/org/bimserver/geometry/ReportJob.java
Expand Up @@ -82,4 +82,8 @@ public int getTrianglesGenerated() {
public GeometryGenerationReport getReport() {
return report;
}

public void setDebugFile(int debugId) {
this.debugId = debugId;
}
}
Binary file not shown.
Expand Up @@ -133,26 +133,27 @@ message SServerSettings {
optional string icon = 12;
optional string name = 13;
optional int64 oid = 14;
optional bool pluginStrictVersionChecking = 15;
optional int32 protocolBuffersPort = 16;
optional int32 renderEngineProcesses = 17;
optional bool reuseGeometry = 18;
optional int32 rid = 19;
optional bool sendConfirmationEmailAfterRegistration = 20;
optional bool sendEmailOnNewRevision = 21;
optional string serviceRepositoryUrl = 22;
optional int32 sessionTimeOutSeconds = 23;
optional string siteAddress = 24;
optional string smtpPassword = 25;
optional int32 smtpPort = 26;
optional SSmtpProtocol smtpProtocol = 27;
optional string smtpServer = 28;
optional string smtpUsername = 29;
optional bool storeLastLogin = 30;
optional bool storeServiceRuns = 31;
optional int64 webModuleId = 32;
repeated int64 webModules = 33;
repeated string whitelistedDomains = 34;
optional bool optimizeMappedItems = 15;
optional bool pluginStrictVersionChecking = 16;
optional int32 protocolBuffersPort = 17;
optional int32 renderEngineProcesses = 18;
optional bool reuseGeometry = 19;
optional int32 rid = 20;
optional bool sendConfirmationEmailAfterRegistration = 21;
optional bool sendEmailOnNewRevision = 22;
optional string serviceRepositoryUrl = 23;
optional int32 sessionTimeOutSeconds = 24;
optional string siteAddress = 25;
optional string smtpPassword = 26;
optional int32 smtpPort = 27;
optional SSmtpProtocol smtpProtocol = 28;
optional string smtpServer = 29;
optional string smtpUsername = 30;
optional bool storeLastLogin = 31;
optional bool storeServiceRuns = 32;
optional int64 webModuleId = 33;
repeated int64 webModules = 34;
repeated string whitelistedDomains = 35;
}

message GetServerSettingsResponse {
Expand Down
10 changes: 5 additions & 5 deletions BimServerWar/.settings/org.eclipse.wst.common.component
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="bimserverwar-1.5.91-SNAPSHOT">
<wb-module deploy-name="bimserverwar-1.5.92-SNAPSHOT">
<wb-resource deploy-path="/WEB-INF/web.xml" source-path="/web.xml"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<dependent-module archiveName="bimserver-1.5.91-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/BimServer/BimServer">
<dependent-module archiveName="bimserver-1.5.94-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/BimServer/BimServer">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="bimserverclientlib-1.5.91-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/BimServerClientLib/BimServerClientLib">
<dependent-module archiveName="bimserverclientlib-1.5.94-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/BimServerClientLib/BimServerClientLib">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="shared-1.5.91-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/Shared/Shared">
<dependent-module archiveName="shared-1.5.94-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/Shared/Shared">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="pluginbase-1.5.91-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/PluginBase/PluginBase">
<dependent-module archiveName="pluginbase-1.5.94-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/PluginBase/PluginBase">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/BimServerWar/target/classes"/>
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SStoreExtendedData.class, SCheckinRevision.class})
@XmlSeeAlso(value={SCheckinRevision.class, SStoreExtendedData.class})
public class SAction implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SObjectRemoved.class, SObjectAdded.class, SObjectModified.class})
@XmlSeeAlso(value={SObjectModified.class, SObjectRemoved.class, SObjectAdded.class})
public class SCompareItem implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SListDataValue.class, SReferenceDataValue.class, SSimpleDataValue.class})
@XmlSeeAlso(value={SReferenceDataValue.class, SListDataValue.class, SSimpleDataValue.class})
public class SDataValue implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -24,7 +24,7 @@


@XmlRootElement
@XmlSeeAlso(value={SRevisionRelated.class, SGeoTagUpdated.class, SSettingsSaved.class, SExtendedDataAddedToRevision.class, SRemoteServiceCalled.class, SServerStarted.class, SUserRelated.class, SCheckoutRelated.class, SExtendedDataAddedToProject.class, SProjectRelated.class, SNewObjectIDMUploaded.class, SDownload.class, SRevisionBranched.class, SDatabaseCreated.class})
@XmlSeeAlso(value={SCheckoutRelated.class, SRevisionBranched.class, SExtendedDataAddedToProject.class, SNewObjectIDMUploaded.class, SDatabaseCreated.class, SServerStarted.class, SUserRelated.class, SExtendedDataAddedToRevision.class, SProjectRelated.class, SRemoteServiceCalled.class, SSettingsSaved.class, SDownload.class, SRevisionRelated.class, SGeoTagUpdated.class})
public class SLogAction implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SModelCheckerResultHeader.class, SModelCheckerResultLine.class})
@XmlSeeAlso(value={SModelCheckerResultLine.class, SModelCheckerResultHeader.class})
public class SModelCheckerResultItem implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SObjectIDMPluginConfiguration.class, SInternalServicePluginConfiguration.class, SModelComparePluginConfiguration.class, SQueryEnginePluginConfiguration.class, SSerializerPluginConfiguration.class, SDeserializerPluginConfiguration.class, SWebModulePluginConfiguration.class, SRenderEnginePluginConfiguration.class, SModelMergerPluginConfiguration.class})
@XmlSeeAlso(value={SInternalServicePluginConfiguration.class, SModelMergerPluginConfiguration.class, SDeserializerPluginConfiguration.class, SWebModulePluginConfiguration.class, SRenderEnginePluginConfiguration.class, SQueryEnginePluginConfiguration.class, SObjectIDMPluginConfiguration.class, SModelComparePluginConfiguration.class, SSerializerPluginConfiguration.class})
public class SPluginConfiguration implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SByteArrayType.class, SDoubleType.class, SLongType.class, SStringType.class, SBooleanType.class})
@XmlSeeAlso(value={SLongType.class, SDoubleType.class, SBooleanType.class, SByteArrayType.class, SStringType.class})
public class SPrimitiveType extends SType implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -24,7 +24,7 @@


@XmlRootElement
@XmlSeeAlso(value={SProjectDeleted.class, SProjectUndeleted.class, SNewProjectAdded.class, SProjectUpdated.class})
@XmlSeeAlso(value={SProjectUndeleted.class, SProjectUpdated.class, SProjectDeleted.class, SNewProjectAdded.class})
public class SProjectRelated extends SLogAction implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -24,7 +24,7 @@


@XmlRootElement
@XmlSeeAlso(value={SRevisionUpdated.class, SNewRevisionAdded.class})
@XmlSeeAlso(value={SNewRevisionAdded.class, SRevisionUpdated.class})
public class SRevisionRelated extends SLogAction implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -23,7 +23,7 @@


@XmlRootElement
@XmlSeeAlso(value={SPrimitiveType.class, SObjectType.class, SArrayType.class})
@XmlSeeAlso(value={SObjectType.class, SPrimitiveType.class, SArrayType.class})
public class SType implements SDataBase
{
private long oid = -1;
Expand Down
Expand Up @@ -24,7 +24,7 @@


@XmlRootElement
@XmlSeeAlso(value={SUserRemovedFromProject.class, SPasswordReset.class, SUserDeleted.class, SNewUserAdded.class, SUserChanged.class, SPasswordChanged.class, SUserUndeleted.class, SUserAddedToProject.class})
@XmlSeeAlso(value={SPasswordChanged.class, SUserDeleted.class, SUserUndeleted.class, SUserAddedToProject.class, SPasswordReset.class, SUserRemovedFromProject.class, SNewUserAdded.class, SUserChanged.class})
public class SUserRelated extends SLogAction implements SDataBase
{
private long oid = -1;
Expand Down
13 changes: 10 additions & 3 deletions PluginBase/generated/org/bimserver/models/ifc4/impl/ifc4.ecore
Expand Up @@ -1751,7 +1751,9 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Location" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Identification" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
unsettable="true">
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ExternalReferenceForResources"
Expand Down Expand Up @@ -4080,6 +4082,7 @@
eType="#//IfcClassificationSelect">
<eAnnotations source="inverse"/>
<eAnnotations source="inverse"/>
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IfcRelAssociatesConstraint" eSuperTypes="#//IfcRelAssociates">
Expand Down Expand Up @@ -4613,11 +4616,15 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="PredefinedType" eType="#//IfcRoofTypeEnum"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IfcRoot">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="GlobalId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="GlobalId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="OwnerHistory" eType="#//IfcOwnerHistory"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
unsettable="true">
<eAnnotations source="singleindex"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
</eClassifiers>
Expand Down

0 comments on commit 2e4c74c

Please sign in to comment.