fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7331] Finished adding Systems to model


From: Petur Thorsteinsson
Subject: [Fmsystem-commits] [7331] Finished adding Systems to model
Date: Mon, 30 May 2011 20:05:55 +0000

Revision: 7331
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7331
Author:   peturbjorn
Date:     2011-05-30 20:05:55 +0000 (Mon, 30 May 2011)
Log Message:
-----------
Finished adding Systems to model

Modified Paths:
--------------
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ZoneAssignment.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/loader/CommonLoader.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/WholeModelOutput.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/SystemObject.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/Zone.java
    
thirdparty/BIM_converter/trunk/src/test/java/no/bimconverter/ifc/v2x3/WholeModelOutputTest.java

Added Paths:
-----------
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/Assignment.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ComponentSystemAssignment.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/GroupObject.java

Added: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/Assignment.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/Assignment.java
                               (rev 0)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/Assignment.java
       2011-05-30 20:05:55 UTC (rev 7331)
@@ -0,0 +1,20 @@
+package no.bimconverter.ifc.jaxb;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
address@hidden
+public class Assignment {
+       public Assignment() {
+       }
+       protected List<String> checkAndInitializeArrayList(List<String> list) {
+               if(list == null) {
+                       return new ArrayList<String>();
+               } else {
+                       return list;
+               }
+       }
+
+}

Added: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ComponentSystemAssignment.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ComponentSystemAssignment.java
                                (rev 0)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ComponentSystemAssignment.java
        2011-05-30 20:05:55 UTC (rev 7331)
@@ -0,0 +1,40 @@
+package no.bimconverter.ifc.jaxb;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+
address@hidden(name="component-system-assignment")
+public class ComponentSystemAssignment extends Assignment {
+       private List<String> components;
+       private List<String> subSystems;
+       public ComponentSystemAssignment() {
+       }
+       public void addComponentGuid(String guid) {
+               this.components = 
super.checkAndInitializeArrayList(this.components);
+               this.components.add(guid);
+       }
+       public void addSubSystemId(String guid) {
+               this.subSystems = 
super.checkAndInitializeArrayList(this.subSystems);
+               this.subSystems.add(guid);
+       }
+       @XmlElementWrapper(name="components")
+       @XmlElement(name="guid")
+       public List<String> getComponents() {
+               return components;
+       }
+       public void setComponents(List<String> components) {
+               this.components = components;
+       }
+       @XmlElementWrapper(name="sub-systems")
+       @XmlElement(name="guid")
+       public List<String> getSubSystems() {
+               return subSystems;
+       }
+       public void setSubSystems(List<String> subSystems) {
+               this.subSystems = subSystems;
+       }
+       
+}

Modified: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ZoneAssignment.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ZoneAssignment.java
   2011-05-30 12:48:27 UTC (rev 7330)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/jaxb/ZoneAssignment.java
   2011-05-30 20:05:55 UTC (rev 7331)
@@ -1,6 +1,5 @@
 package no.bimconverter.ifc.jaxb;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlElement;
@@ -8,9 +7,10 @@
 import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement
-public class ZoneAssignment {
+public class ZoneAssignment extends Assignment{
        private List<String> spaces;
        private List<String> subZones;
+       
        public ZoneAssignment() {
        }
        
@@ -24,14 +24,8 @@
                this.subZones.add(id);
        }
        
-       private List<String> checkAndInitializeArrayList(List<String> list) {
-               if(list == null) {
-                       return new ArrayList<String>();
-               } else {
-                       return list;
-               }
-       }
        
+       
        @XmlElementWrapper(name="spaces")
        @XmlElement(name="guid")
        public List<String> getSpaces() {

Modified: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/loader/CommonLoader.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/loader/CommonLoader.java
   2011-05-30 12:48:27 UTC (rev 7330)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/loader/CommonLoader.java
   2011-05-30 20:05:55 UTC (rev 7331)
@@ -59,11 +59,11 @@
                }
        }
        private CommonObject loadObject(EEntity entity, Class<? extends 
CommonObject> myObject) {
-               CommonObject window;
+               CommonObject commonObject;
                try {
-                       window = myObject.newInstance();
-                       window.load((EIfcobject)entity);
-                       return window;
+                       commonObject = myObject.newInstance();
+                       commonObject.load((EIfcobject)entity);
+                       return commonObject;
                } catch (InstantiationException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();

Modified: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/WholeModelOutput.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/WholeModelOutput.java
 2011-05-30 12:48:27 UTC (rev 7330)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/WholeModelOutput.java
 2011-05-30 20:05:55 UTC (rev 7331)
@@ -11,6 +11,7 @@
 import no.bimconverter.ifc.v2x3.object.Project;
 import no.bimconverter.ifc.v2x3.object.Site;
 import no.bimconverter.ifc.v2x3.object.Space;
+import no.bimconverter.ifc.v2x3.object.SystemObject;
 import no.bimconverter.ifc.v2x3.object.Zone;
 import no.bimconverter.ifc.v2x3.object.element.BuildingServiceElement;
 import no.bimconverter.ifc.v2x3.object.element.Covering;
@@ -34,6 +35,7 @@
        private List<Furnishing> furnishingElements = null;
        private List<Zone> zones = null;
        private List<BuildingServiceElement> buildingServiceElements = null;
+       private List<SystemObject> systems = null;
        
        public WholeModelOutput() {
        }
@@ -50,7 +52,7 @@
                this.furnishingElements = (List<Furnishing>) 
model.getFacilityManagementEntity(new Furnishing());
                this.zones = (List<Zone>) model.getFacilityManagementEntity(new 
Zone());
                this.buildingServiceElements = (List<BuildingServiceElement>) 
model.getFacilityManagementEntity(new BuildingServiceElement());
-               
+               this.systems = (List<SystemObject>) 
model.getFacilityManagementEntity(new SystemObject());
        }
        public ModelInformation getModelInformation() {
                return modelInformation;
@@ -144,5 +146,13 @@
                        List<BuildingServiceElement> buildingServiceElements) {
                this.buildingServiceElements = buildingServiceElements;
        }
+       @XmlElementWrapper(name="systems")
+       @XmlElement(name="system") 
+       public List<SystemObject> getSystems() {
+               return systems;
+       }
+       public void setSystems(List<SystemObject> systems) {
+               this.systems = systems;
+       }
 
 }

Added: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/GroupObject.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/GroupObject.java
                               (rev 0)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/GroupObject.java
       2011-05-30 20:05:55 UTC (rev 7331)
@@ -0,0 +1,40 @@
+package no.bimconverter.ifc.v2x3.object;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jsdai.SIfc2x3.AIfcobjectdefinition;
+import jsdai.SIfc2x3.AIfcrelassignstogroup;
+import jsdai.SIfc2x3.EIfcgroup;
+import jsdai.SIfc2x3.EIfcobjectdefinition;
+import jsdai.SIfc2x3.EIfcrelassignstogroup;
+import jsdai.lang.EEntity;
+import jsdai.lang.SdaiException;
+import jsdai.lang.SdaiIterator;
+
+/*
+ * Analogous to EIfcGroup
+ * Parent class to System, Zone, etc.
+ */
+public class GroupObject extends CommonObjectImpl{
+       protected List<String> loadAssignments(EIfcgroup entity, Class<? 
extends EEntity> relatingGroupClass, Class<? extends EEntity> 
relatedObjectClass) throws SdaiException {
+               List<String> guidList = new ArrayList<String>();
+               AIfcrelassignstogroup groupAgg = entity.getIsgroupedby(null, 
null);
+               SdaiIterator groupIterator = groupAgg.createIterator();
+               while(groupIterator.next()) {
+                       EIfcrelassignstogroup now = 
groupAgg.getCurrentMember(groupIterator);
+                       EIfcgroup group = now.getRelatinggroup(null);
+                       if(group.isKindOf(relatingGroupClass)) {
+                               AIfcobjectdefinition relatedObjects = 
now.getRelatedobjects(null);
+                               SdaiIterator objectIterator = 
relatedObjects.createIterator();
+                               while(objectIterator.next()) {
+                                       EIfcobjectdefinition objDef = 
relatedObjects.getCurrentMember(objectIterator);
+                                       if(objDef.isKindOf(relatedObjectClass)) 
{
+                                               
guidList.add(objDef.getGlobalid(null));
+                                       }
+                               }
+                       }
+               }
+               return guidList;
+       }
+}

Modified: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/SystemObject.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/SystemObject.java
      2011-05-30 12:48:27 UTC (rev 7330)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/SystemObject.java
      2011-05-30 20:05:55 UTC (rev 7331)
@@ -3,23 +3,30 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import jsdai.SIfc2x3.AIfcobjectdefinition;
-import jsdai.SIfc2x3.AIfcrelassignstogroup;
-import jsdai.SIfc2x3.EIfcgroup;
+import no.bimconverter.ifc.jaxb.ComponentSystemAssignment;
+import no.bimconverter.ifc.jaxb.SpatialContainerItem;
+
+import jsdai.SIfc2x3.AIfcrelservicesbuildings;
+import jsdai.SIfc2x3.AIfcspatialstructureelement;
+import jsdai.SIfc2x3.EIfcdistributionelement;
 import jsdai.SIfc2x3.EIfcobjectdefinition;
-import jsdai.SIfc2x3.EIfcrelassignstogroup;
-import jsdai.SIfc2x3.EIfcspace;
+import jsdai.SIfc2x3.EIfcrelservicesbuildings;
+import jsdai.SIfc2x3.EIfcspatialstructureelement;
 import jsdai.SIfc2x3.EIfcsystem;
-import jsdai.SIfc2x3.EIfczone;
-import jsdai.lang.EEntity;
 import jsdai.lang.SdaiException;
 import jsdai.lang.SdaiIterator;
address@hidden
-public class SystemObject extends CommonObjectImpl implements 
FacilityManagementEntity{
address@hidden(name="system")
+public class SystemObject extends GroupObject implements 
FacilityManagementEntity{
        final static private Class<EIfcsystem> ifcEntityType = EIfcsystem.class;
+       private ComponentSystemAssignment componentSystemAssignment = new 
ComponentSystemAssignment();
+       private List<SpatialContainerItem> servicesBuildings;
        
+       
+
        public SystemObject() {
        }
        
@@ -35,42 +42,60 @@
                try {
                        this.loadClassification(entity);
                        this.loadProperties(entity);
-                       
+                       this.loadAssignment(entity);
+                       this.loadServicesBuildings(entity);
                } catch (SdaiException e) {
                        e.printStackTrace();
                }
        }
        
-       private void loadAssignment(EIfczone entity) throws SdaiException {
-               List<String> spaceIds = this.loadAssignments(entity, 
EIfczone.class, EIfcspace.class);
-               for ( String spaceId : spaceIds) {
-                       this.zoneAssignment.addSpaceId(spaceId);
+       private void loadAssignment(EIfcsystem entity) throws SdaiException {
+               List<String> componentIds = this.loadAssignments(entity, 
EIfcsystem.class, EIfcdistributionelement.class);
+               for ( String componentId : componentIds) {
+                       
this.componentSystemAssignment.addComponentGuid(componentId);
                }
-               List<String> zoneIds = this.loadAssignments(entity, 
EIfcsystem.class, EIfczone.class);
-               for ( String spaceId : zoneIds) {
-                       this.zoneAssignment.addZoneId(spaceId);
+               List<String> subSystemIds = this.loadAssignments(entity, 
EIfcsystem.class, EIfcsystem.class);
+               for ( String subSystemId : subSystemIds) {
+                       
this.componentSystemAssignment.addSubSystemId(subSystemId);
                }
                
        }
        
-       protected List<String> loadAssignments(EIfcgroup entity, Class<? 
extends EEntity> relatingGroupClass, Class<? extends EEntity> 
relatedObjectClass) throws SdaiException {
-               List<String> guidList = new ArrayList<String>();
-               AIfcrelassignstogroup groupAgg = entity.getIsgroupedby(null, 
null);
-               SdaiIterator groupIterator = groupAgg.createIterator();
-               while(groupIterator.next()) {
-                       EIfcrelassignstogroup now = 
groupAgg.getCurrentMember(groupIterator);
-                       EIfcgroup group = now.getRelatinggroup(null);
-                       if(group.isKindOf(relatingGroupClass)) {
-                               AIfcobjectdefinition relatedObjects = 
now.getRelatedobjects(null);
-                               SdaiIterator objectIterator = 
relatedObjects.createIterator();
-                               while(objectIterator.next()) {
-                                       EIfcobjectdefinition objDef = 
relatedObjects.getCurrentMember(objectIterator);
-                                       if(objDef.isKindOf(relatedObjectClass)) 
{
-                                               
guidList.add(objDef.getGlobalid(null));
-                                       }
+       private void loadServicesBuildings(EIfcsystem entity) throws 
SdaiException {
+               AIfcrelservicesbuildings serviceBuildingsAggregate = 
entity.getServicesbuildings(null, null);
+               SdaiIterator serviceBuildingsIterator = 
serviceBuildingsAggregate.createIterator();
+               while(serviceBuildingsIterator.next()) {
+                       EIfcrelservicesbuildings servicesBuildings = 
serviceBuildingsAggregate.getCurrentMember(serviceBuildingsIterator);
+                       AIfcspatialstructureelement spatialStructureAggregation 
= servicesBuildings.getRelatedbuildings(null);
+                       SdaiIterator spatialStructureIterator = 
spatialStructureAggregation.createIterator();
+                       while(spatialStructureIterator.next()) {
+                               EIfcspatialstructureelement spatialStructure = 
spatialStructureAggregation.getCurrentMember(spatialStructureIterator);
+                               if(this.servicesBuildings == null) {
+                                       this.servicesBuildings = new 
ArrayList<SpatialContainerItem>();
                                }
+                               this.servicesBuildings.add(new 
SpatialContainerItem(spatialStructure.getGlobalid(null), 
spatialStructure.getInstanceType().getName(null), null, null));
                        }
                }
-               return guidList;
        }
+        
+       @XmlElement(name="component-system-assignment")
+       public ComponentSystemAssignment getComponentSystemAssignment() {
+               return componentSystemAssignment;
+       }
+
+       public void setComponentSystemAssignment(
+                       ComponentSystemAssignment componentSystemAssignment) {
+               this.componentSystemAssignment = componentSystemAssignment;
+       }
+       
+       @XmlElementWrapper(name="services-buildings")
+       @XmlElement(name="structure")
+       public List<SpatialContainerItem> getServicesBuildings() {
+               return servicesBuildings;
+       }
+
+       public void setServicesBuildings(List<SpatialContainerItem> 
servicesBuildings) {
+               this.servicesBuildings = servicesBuildings;
+       }
+       
 }

Modified: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/Zone.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/Zone.java
      2011-05-30 12:48:27 UTC (rev 7330)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/Zone.java
      2011-05-30 20:05:55 UTC (rev 7331)
@@ -1,25 +1,18 @@
 package no.bimconverter.ifc.v2x3.object;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlRootElement;
 
 import no.bimconverter.ifc.jaxb.ZoneAssignment;
 
-import jsdai.SIfc2x3.AIfcobjectdefinition;
-import jsdai.SIfc2x3.AIfcrelassignstogroup;
-import jsdai.SIfc2x3.EIfcgroup;
 import jsdai.SIfc2x3.EIfcobjectdefinition;
-import jsdai.SIfc2x3.EIfcrelassignstogroup;
 import jsdai.SIfc2x3.EIfcspace;
 import jsdai.SIfc2x3.EIfcsystem;
 import jsdai.SIfc2x3.EIfczone;
-import jsdai.lang.EEntity;
 import jsdai.lang.SdaiException;
-import jsdai.lang.SdaiIterator;
 @XmlRootElement
-public class Zone extends SystemObject implements FacilityManagementEntity{
+public class Zone extends GroupObject implements FacilityManagementEntity{
        final static private Class<EIfczone> ifcEntityType = EIfczone.class;
        private ZoneAssignment zoneAssignment = new ZoneAssignment();
        public Zone() {

Modified: 
thirdparty/BIM_converter/trunk/src/test/java/no/bimconverter/ifc/v2x3/WholeModelOutputTest.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/test/java/no/bimconverter/ifc/v2x3/WholeModelOutputTest.java
     2011-05-30 12:48:27 UTC (rev 7330)
+++ 
thirdparty/BIM_converter/trunk/src/test/java/no/bimconverter/ifc/v2x3/WholeModelOutputTest.java
     2011-05-30 20:05:55 UTC (rev 7331)
@@ -37,7 +37,6 @@
                assertNotNull(wholeModel);
        }
        @Test
-       @Ignore
        public void testDisplayCovering1() throws JAXBException {
                JAXBContext jc = 
JAXBContext.newInstance(WholeModelOutput.class);
                Marshaller m = jc.createMarshaller();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]