fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7293] add BuildingServiceElement


From: Sigurd Nes
Subject: [Fmsystem-commits] [7293] add BuildingServiceElement
Date: Mon, 23 May 2011 11:32:26 +0000

Revision: 7293
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7293
Author:   sigurdne
Date:     2011-05-23 11:32:25 +0000 (Mon, 23 May 2011)
Log Message:
-----------
add BuildingServiceElement

Modified Paths:
--------------
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/IfcModelImpl.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/WholeModelOutput.java

Added Paths:
-----------
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/BuildingServiceElement.java
    
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/type/BuildingServiceElementType.java

Modified: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/IfcModelImpl.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/IfcModelImpl.java
     2011-05-23 10:26:17 UTC (rev 7292)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/IfcModelImpl.java
     2011-05-23 11:32:25 UTC (rev 7293)
@@ -9,6 +9,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import jsdai.SIfc2x3.EIfcdistributionelement;
 import jsdai.SIfc2x3.EIfcdoor;
 import jsdai.SIfc2x3.EIfcfurnishingelement;
 import jsdai.SIfc2x3.EIfcobjectdefinition;
@@ -42,6 +43,7 @@
 import no.bimconverter.ifc.v2x3.object.Site;
 import no.bimconverter.ifc.v2x3.object.Space;
 import no.bimconverter.ifc.v2x3.object.Zone;
+import no.bimconverter.ifc.v2x3.object.element.BuildingServiceElement;
 import no.bimconverter.ifc.v2x3.object.element.Covering;
 import no.bimconverter.ifc.v2x3.object.element.Door;
 import no.bimconverter.ifc.v2x3.object.element.Furnishing;
@@ -67,6 +69,8 @@
        private List<Door> doors = null;
        private List<Furnishing> furnishingElements = null;
        private List<Zone> zones = null;
+       private List<BuildingServiceElement> buildingServiceElements = null;
+       
        public IfcModelImpl() {
                super();
        }
@@ -414,6 +418,27 @@
                
                return null;
        }
+       public List<BuildingServiceElement> getBuildingServiceElement() {
+               super.openSdaiSession();
+               try {
+                       makeModelAvailable();
+                       
+                       try {
+                               this.buildingServiceElements = 
(List<BuildingServiceElement>) (new CommonLoader()).load(model, 
EIfcdistributionelement.class, BuildingServiceElement.class);
+                               return this.buildingServiceElements;
+                       } catch (IfcSdaiException e) {
+                               logger.info("No buildingServiceElements found");
+                               return null;
+                       }
+               } catch (SdaiException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               } finally {
+                       super.closeSdaiSession();
+               }
+               
+               return null;
+       }
        public SdaiModel getModel() {
                return model;
        }

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-23 10:26:17 UTC (rev 7292)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/WholeModelOutput.java
 2011-05-23 11:32:25 UTC (rev 7293)
@@ -12,6 +12,7 @@
 import no.bimconverter.ifc.v2x3.object.Site;
 import no.bimconverter.ifc.v2x3.object.Space;
 import no.bimconverter.ifc.v2x3.object.Zone;
+import no.bimconverter.ifc.v2x3.object.element.BuildingServiceElement;
 import no.bimconverter.ifc.v2x3.object.element.Covering;
 import no.bimconverter.ifc.v2x3.object.element.Door;
 import no.bimconverter.ifc.v2x3.object.element.Furnishing;
@@ -32,6 +33,7 @@
        private List<Door> doors = null;
        private List<Furnishing> furnishingElements = null;
        private List<Zone> zones = null;
+       private List<BuildingServiceElement> buildingServiceElements = null;
        
        public WholeModelOutput() {
        }
@@ -47,6 +49,7 @@
                this.doors = model.getDoors();
                this.furnishingElements = model.getFurnishing();
                this.zones = model.getZones();
+               this.buildingServiceElements = 
model.getBuildingServiceElement();
                
        }
        public ModelInformation getModelInformation() {
@@ -132,5 +135,14 @@
        public void setZones(List<Zone> zones) {
                this.zones = zones;
        }
+       @XmlElementWrapper(name="buildingServiceElements")
+       @XmlElement(name="buildingServiceElement") 
+       public List<BuildingServiceElement> getBuildingServiceElements() {
+               return buildingServiceElements;
+       }
+       public void setBuildingServiceElements(
+                       List<BuildingServiceElement> buildingServiceElements) {
+               this.buildingServiceElements = buildingServiceElements;
+       }
 
 }

Added: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/BuildingServiceElement.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/BuildingServiceElement.java
                            (rev 0)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/BuildingServiceElement.java
    2011-05-23 11:32:25 UTC (rev 7293)
@@ -0,0 +1,59 @@
+package no.bimconverter.ifc.v2x3.object.element;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import no.bimconverter.ifc.v2x3.object.element.type.BuildingServiceElementType;
+import no.bimconverter.ifc.v2x3.object.element.type.WindowStyle;
+
+import jsdai.SIfc2x3.EIfcbuildingelementtype;
+import jsdai.SIfc2x3.EIfcbuildingstorey;
+import jsdai.SIfc2x3.EIfcdistributionelement;
+import jsdai.SIfc2x3.EIfcdistributionelementtype;
+import jsdai.SIfc2x3.EIfcobjectdefinition;
+import jsdai.SIfc2x3.EIfctypeobject;
+import jsdai.SIfc2x3.EIfcwindow;
+import jsdai.SIfc2x3.EIfcwindowstyle;
+import jsdai.lang.SdaiException;
+
address@hidden
+public class BuildingServiceElement extends CommonElement{
+       private BuildingServiceElementType buildingServiceElemenType = null;
+       
+       
+       public BuildingServiceElement() {
+               super();
+       }
+       @Override
+       public void load(EIfcobjectdefinition object) {
+               super.load(object);
+               EIfcdistributionelement entity = (EIfcdistributionelement) 
object;
+               try {
+                       this.loadSpatialContainer(entity);
+                       this.loadBuildingServiceElementType(entity);
+               } catch (SdaiException e) {
+                       e.printStackTrace();
+               }
+       }
+
+       private void loadSpatialContainer(EIfcdistributionelement entity) 
throws SdaiException {
+               this.loadParentItemsIntoSpatialContainer(entity, 
EIfcbuildingstorey.class);
+               
+       }
+       
+       private void loadBuildingServiceElementType(EIfcdistributionelement 
entity) throws SdaiException {
+               EIfctypeobject typeObject = super.getTypeObject(entity);
+               if(typeObject != null && 
typeObject.isKindOf(EIfcdistributionelementtype.class)) {
+                       this.buildingServiceElemenType = new 
BuildingServiceElementType();
+                       
this.buildingServiceElemenType.load((EIfcdistributionelementtype) typeObject);
+               }
+       }
+       public BuildingServiceElementType getBuildingServiceElemenType() {
+               return buildingServiceElemenType;
+       }
+       public void setBuildingServiceElemenType(
+                       BuildingServiceElementType buildingServiceElemenType) {
+               this.buildingServiceElemenType = buildingServiceElemenType;
+       }
+       
+       
+}

Added: 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/type/BuildingServiceElementType.java
===================================================================
--- 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/type/BuildingServiceElementType.java
                           (rev 0)
+++ 
thirdparty/BIM_converter/trunk/src/main/java/no/bimconverter/ifc/v2x3/object/element/type/BuildingServiceElementType.java
   2011-05-23 11:32:25 UTC (rev 7293)
@@ -0,0 +1,50 @@
+package no.bimconverter.ifc.v2x3.object.element.type;
+
+import no.bimconverter.ifc.v2x3.object.TypeObject;
+import jsdai.SIfc2x3.EIfcdistributionelementtype;
+import jsdai.SIfc2x3.EIfcwindowstyle;
+import jsdai.SIfc2x3.EIfcwindowstyleconstructionenum;
+import jsdai.SIfc2x3.EIfcwindowstyleoperationenum;
+import jsdai.lang.SdaiException;
+
+
+public class BuildingServiceElementType extends TypeObject{
+       
+       public void load(EIfcdistributionelementtype entity) {
+               try {
+                       this.loadAttributes(entity);
+                       this.loadClassification(entity);
+                       this.loadMaterial(entity);
+                       this.loadTypeProperties(entity);
+                       //this.loadProperties(entity);
+                       /*
+                       this.loadClassification(entity);
+                       this.loadBaseQuantities(entity);
+                       this.loadProperties(entity);
+                       */
+               } catch (SdaiException e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void loadAttributes(EIfcdistributionelementtype windowStyle) 
throws SdaiException {
+               super.loadAttributes(windowStyle);
+//             this.attributes.put(Attribute.CONSTRUCTION_TYPE.key, 
EIfcwindowstyleconstructionenum.toString(windowStyle.getConstructiontype(null)));
+//             this.attributes.put(Attribute.OPERATION_TYPE.key, 
EIfcwindowstyleoperationenum.toString(windowStyle.getOperationtype(null)));
+       //      
this.attributes.setConstructionType(EIfcwindowstyleconstructionenum.toString(windowStyle.getConstructiontype(null)));
+       //      
this.attributes.setOperationType(EIfcwindowstyleoperationenum.toString(windowStyle.getOperationtype(null)));
+       }
+       
+       public enum Attribute {
+               CONSTRUCTION_TYPE("Construction type"),
+               OPERATION_TYPE("Operation type");
+               private final String key;
+               Attribute(String key) {
+               this.key = key;
+           }
+               public String getKey() {
+                       return key;
+               }
+       }
+
+}




reply via email to

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