Inheritance: GeometryGym.Ifc.IfcResourceLevelRelationship
コード例 #1
0
 //internal List<IfcExternalReferenceRelationship> mHasExternalReferences = new List<IfcExternalReferenceRelationship>(); //IFC4
 //internal List<IfcResourceConstraintRelationship> mHasConstraintRelationships = new List<IfcResourceConstraintRelationship>(); //gg
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "HasExternalReferences") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.RelatedResourceObjects.Add(this);
                 }
             }
         }
         else if (string.Compare(name, "HasConstraintRelationships") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
     }
 }
コード例 #2
0
		internal override void ParseXml(XmlElement xml)
		{
			base.ParseXml(xml);
			if (xml.HasAttribute("Name"))
				Name = xml.Attributes["Name"].Value;
			if (xml.HasAttribute("Description"))
				Description = xml.Attributes["Description"].Value;
			foreach (XmlNode child in xml.ChildNodes)
			{
				string name = child.Name;
				if (string.Compare(name, "AppliedValue") == 0)
					AppliedValue = mDatabase.ParseXml<IfcAppliedValueSelect>(child as XmlElement);
				else if (string.Compare(name, "UnitBasis") == 0)
					UnitBasis = mDatabase.ParseXml<IfcMeasureWithUnit>(child as XmlElement);
				else if (string.Compare(name, "Components") == 0)
				{
					foreach (XmlNode node in child.ChildNodes)
					{
						IfcAppliedValue v = mDatabase.ParseXml<IfcAppliedValue>(node as XmlElement);
						if (v != null)
							addComponent(v);
					}
				}
				else if (string.Compare(name, "HasExternalReference") == 0)
				{
					foreach (XmlNode cn in child.ChildNodes)
					{
						IfcExternalReferenceRelationship r = mDatabase.ParseXml<IfcExternalReferenceRelationship>(cn as XmlElement);
						if (r != null)
							r.RelatedResourceObjects.Add(this);
					}
				}
				else if (string.Compare(name, "HasConstraintRelationships") == 0)
				{
					foreach (XmlNode cn in child.ChildNodes)
					{
						IfcResourceConstraintRelationship r = mDatabase.ParseXml<IfcResourceConstraintRelationship>(cn as XmlElement);
						if (r != null)
							r.addRelated(this);
					}
				}
				else if (string.Compare(name, "Name", true) == 0)
					Name = child.InnerText;
				else if (string.Compare(name, "Description", true) == 0)
					Description = child.InnerText;
				else if (string.Compare(name, "Category", true) == 0)
					Category = child.InnerText;
				else if (string.Compare(name, "Condition", true) == 0)
					Condition = child.InnerText;
				else if (string.Compare(name, "ArithmeticOperator", true) == 0)
					Enum.TryParse<IfcArithmeticOperatorEnum>(child.InnerText, true, out mArithmeticOperator);
			}
			//todo
			if (xml.HasAttribute("Category"))
				Category = xml.Attributes["Category"].Value;
			if (xml.HasAttribute("Condition"))
				Condition = xml.Attributes["Condition"].Value;
			if (xml.HasAttribute("ArithmeticOperator"))
				Enum.TryParse<IfcArithmeticOperatorEnum>(xml.Attributes["ArithmeticOperator"].Value, true, out mArithmeticOperator);
		}
コード例 #3
0
 {                                                                                                                                //,IfcExternallyDefinedSurfaceStyle ,IfcExternallyDefinedSymbol ,IfcExternallyDefinedTextFont ,IfcLibraryReference));
     internal override void ParseXml(XmlElement xml)
     {
         base.ParseXml(xml);
         if (xml.HasAttribute("Location"))
         {
             Location = xml.Attributes["Location"].Value;
         }
         if (xml.HasAttribute("Identification"))
         {
             Identification = xml.Attributes["Identification"].Value;
         }
         if (xml.HasAttribute("Name"))
         {
             Name = xml.Attributes["Name"].Value;
         }
         foreach (XmlNode child in xml.ChildNodes)
         {
             string name = child.Name;
             if (string.Compare(name, "HasExternalReferences") == 0)
             {
                 List <IfcExternalReferenceRelationship> references = new List <IfcExternalReferenceRelationship>(child.ChildNodes.Count);
                 foreach (XmlNode cn in child.ChildNodes)
                 {
                     IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                     if (r != null)
                     {
                         references.Add(r);
                     }
                 }
                 mHasExternalReferences = references;
             }
             else if (string.Compare(name, "HasConstraintRelationships") == 0)
             {
                 foreach (XmlNode cn in child.ChildNodes)
                 {
                     IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                     if (r != null)
                     {
                         r.addRelated(this);
                     }
                 }
             }
             else if (string.Compare(name, "ExternalReferenceForResources") == 0)
             {
                 foreach (XmlNode cn in child.ChildNodes)
                 {
                     IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                     if (r != null)
                     {
                         r.addRelated(this);
                     }
                 }
             }
         }
     }
コード例 #4
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);
            if (mRelatingConstraint != host.mIndex)
            {
                obj["RelatingConstraint"] = RelatingConstraint.getJson(this, options);
            }
            JArray array = new JArray();

            foreach (IfcResourceObjectSelect r in RelatedResourceObjects)
            {
                IfcResourceConstraintRelationship rcr = r as IfcResourceConstraintRelationship;
                if (r.Index != host.mIndex)
                {
                    array.Add(mDatabase[r.Index].getJson(this, options));
                }
            }
            if (array.Count > 0)
            {
                obj["RelatedResourceObjects"] = array;
            }
        }
コード例 #5
0
    {                                                                                                                                //,IfcExternallyDefinedSurfaceStyle ,IfcExternallyDefinedSymbol ,IfcExternallyDefinedTextFont ,IfcLibraryReference));
        internal override void ParseXml(XmlElement xml)
        {
            base.ParseXml(xml);
            XmlAttribute attribute = xml.Attributes["Location"];

            if (attribute != null)
            {
                Location = attribute.Value;
            }
            attribute = xml.Attributes["Identification"];
            if (attribute == null)
            {
                attribute = xml.Attributes["ItemReference"];
            }
            if (attribute != null)
            {
                Identification = attribute.Value;
            }
            attribute = xml.Attributes["Name"];
            if (attribute != null)
            {
                Name = attribute.Value;
            }
            foreach (XmlNode child in xml.ChildNodes)
            {
                string name = child.Name;
                if (string.Compare(name, "HasExternalReference") == 0)
                {
                    foreach (XmlNode cn in child.ChildNodes)
                    {
                        IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                        if (r != null)
                        {
                            mHasExternalReference.Add(r);
                        }
                    }
                }
                else if (string.Compare(name, "HasConstraintRelationships") == 0)
                {
                    foreach (XmlNode cn in child.ChildNodes)
                    {
                        IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                        if (r != null)
                        {
                            r.RelatedResourceObjects.Add(this);
                        }
                    }
                }
                else if (string.Compare(name, "ExternalReferenceForResources") == 0)
                {
                    foreach (XmlNode cn in child.ChildNodes)
                    {
                        IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                        if (r != null)
                        {
                            r.RelatedResourceObjects.Add(this);
                        }
                    }
                }
            }
        }
コード例 #6
0
ファイル: IFC O.cs プロジェクト: jddaigle/GeometryGymIFC
 public void AddConstraintRelationShip(IfcResourceConstraintRelationship constraintRelationship)
 {
     mHasConstraintRelationships.Add(constraintRelationship);
 }
コード例 #7
0
ファイル: IFC R.cs プロジェクト: jenca-cloud/ggIFC
		internal static void parseFields(IfcResourceConstraintRelationship a, List<string> arrFields, ref int ipos, Schema schema) { IfcResourceLevelRelationship.parseFields(a, arrFields, ref ipos,schema); a.mRelatingConstraint = ParserSTEP.ParseLink(arrFields[ipos++]); a.mRelatedResourceObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); }
コード例 #8
0
ファイル: IFC R.cs プロジェクト: jenca-cloud/ggIFC
		internal static IfcResourceConstraintRelationship Parse(string strDef, Schema schema) { IfcResourceConstraintRelationship a = new IfcResourceConstraintRelationship(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; }
コード例 #9
0
ファイル: IFC R.cs プロジェクト: jenca-cloud/ggIFC
		internal IfcResourceConstraintRelationship(IfcResourceConstraintRelationship o) : base(o) { mRelatingConstraint = o.mRelatingConstraint; }
コード例 #10
0
ファイル: IFC C XML.cs プロジェクト: wsy8648/GeometryGymIFC
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     if (xml.HasAttribute("Name"))
     {
         Name = xml.Attributes["Name"].Value;
     }
     if (xml.HasAttribute("Description"))
     {
         Description = xml.Attributes["Description"].Value;
     }
     if (xml.HasAttribute("ConstraintGrade"))
     {
         Enum.TryParse <IfcConstraintEnum>(xml.Attributes["ConstraintGrade"].Value, true, out mConstraintGrade);
     }
     if (xml.HasAttribute("ConstraintSource"))
     {
         ConstraintSource = xml.Attributes["ConstraintSource"].Value;
     }
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "CreatingActor") == 0)
         {
             CreatingActor = mDatabase.ParseXml <IfcActorSelect>(child as XmlElement);
         }
         else if (string.Compare(name, "HasExternalReferences") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
         else if (string.Compare(name, "PropertiesForConstraint") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.RelatingConstraint = this;
                 }
             }
         }
         else if (string.Compare(name, "HasConstraintRelationships") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
     }
     if (xml.HasAttribute("UserDefinedGrade"))
     {
         UserDefinedGrade = xml.Attributes["UserDefinedGrade"].Value;
     }
 }
コード例 #11
0
ファイル: IFC A XML.cs プロジェクト: wsy8648/GeometryGymIFC
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     if (xml.HasAttribute("Name"))
     {
         Name = xml.Attributes["Name"].Value;
     }
     if (xml.HasAttribute("Description"))
     {
         Description = xml.Attributes["Description"].Value;
     }
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "AppliedValue") == 0)
         {
             AppliedValue = mDatabase.ParseXml <IfcAppliedValueSelect>(child as XmlElement);
             if (mAppliedValueIndex == 0)
             {
                 mAppliedValueValue = extractValue(child.FirstChild);
             }
         }
         else if (string.Compare(name, "UnitBasis") == 0)
         {
             UnitBasis = mDatabase.ParseXml <IfcMeasureWithUnit>(child as XmlElement);
         }
         else if (string.Compare(name, "Components") == 0)
         {
             foreach (XmlNode node in child.ChildNodes)
             {
                 IfcAppliedValue v = mDatabase.ParseXml <IfcAppliedValue>(node as XmlElement);
                 if (v != null)
                 {
                     addComponent(v);
                 }
             }
         }
         else if (string.Compare(name, "HasExternalReferences") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcExternalReferenceRelationship r = mDatabase.ParseXml <IfcExternalReferenceRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
         else if (string.Compare(name, "HasConstraintRelationships") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcResourceConstraintRelationship r = mDatabase.ParseXml <IfcResourceConstraintRelationship>(cn as XmlElement);
                 if (r != null)
                 {
                     r.addRelated(this);
                 }
             }
         }
     }
     //todo
     if (xml.HasAttribute("Category"))
     {
         Category = xml.Attributes["Category"].Value;
     }
     if (xml.HasAttribute("Condition"))
     {
         Condition = xml.Attributes["Condition"].Value;
     }
     if (xml.HasAttribute("ArithmeticOperator"))
     {
         Enum.TryParse <IfcArithmeticOperatorEnum>(xml.Attributes["ArithmeticOperator"].Value, true, out mArithmeticOperator);
     }
 }
コード例 #12
0
            internal void setAggregate(BaseClassIfc obj)
            {
                IfcProduct product = obj as IfcProduct;

                if (product != null)
                {
                    mProducts.Add(product);
                    IfcBuildingStorey buildingStorey = obj as IfcBuildingStorey;
                    if (buildingStorey != null)
                    {
                        mBuildingStories.Add(buildingStorey);
                    }
                    IfcGrid grid = obj as IfcGrid;
                    if (grid != null)
                    {
                        mGrids.Add(grid);
                    }
                    IfcSlab slab = product as IfcSlab;
                    if (slab != null)
                    {
                        mSlabs.Add(slab);
                    }
                    IfcStructuralItem structuralItem = obj as IfcStructuralItem;
                    if (structuralItem != null)
                    {
                        mStructItems.Add(structuralItem);
                    }
                    IfcWall wall = product as IfcWall;
                    if (wall != null)
                    {
                        mWalls.Add(wall);
                    }
                    return;
                }
                //IfcApplication application = obj as IfcApplication;
                //if (application != null)
                //	mApplications.Add(application);
                IfcComplexProperty cp = obj as IfcComplexProperty;

                if (cp != null)
                {
                    mComplexProperties.Add(cp);
                    return;
                }
                IfcCoordinateOperation coordOp = obj as IfcCoordinateOperation;

                if (coordOp != null)
                {
                    mCoordinateOperations.Add(coordOp);
                    return;
                }

                IfcEdgeCurve edgeCurve = obj as IfcEdgeCurve;

                if (edgeCurve != null)
                {
                    mEdgeCurves.Add(edgeCurve);
                    return;
                }
                IfcExternalReferenceRelationship externalReferenceRelationship = obj as IfcExternalReferenceRelationship;

                if (externalReferenceRelationship != null)
                {
                    mExternalRelationships.Add(externalReferenceRelationship);
                    return;
                }
                //IfcExtrudedAreaSolid extrudedAreaSolid = result as IfcExtrudedAreaSolid;
                //if(extrudedAreaSolid != null)
                //{
                //	if(result as IfcExtrudedAreaSolidTapered == null)
                //		aggregate.mExtrusions.Add(extrudedAreaSolid);
                //	return extrudedAreaSolid;
                //}
                IfcGeometricRepresentationSubContext geometricRepresentationContext = obj as IfcGeometricRepresentationSubContext;

                if (geometricRepresentationContext != null)
                {
                    mGeomContexts.Add(geometricRepresentationContext);
                    return;
                }


                IfcGroup group = obj as IfcGroup;

                if (group != null)
                {
                    IfcZone zone = group as IfcZone;
                    if (zone != null)
                    {
                        mZones.Add(zone);
                        return;
                    }
                    mGroups.Add(group);
                    return;
                }
                IfcIndexedColourMap indexedColourMap = obj as IfcIndexedColourMap;

                if (indexedColourMap != null)
                {
                    mIndexedColourMap.Add(indexedColourMap);
                    return;
                }
                IfcIndexedTextureMap indexedTextureMap = obj as IfcIndexedTextureMap;

                if (indexedTextureMap != null)
                {
                    mIndexedTextureMap.Add(indexedTextureMap);
                    return;
                }
                IfcLocalPlacement localPlacement = obj as IfcLocalPlacement;

                if (localPlacement != null)
                {
                    mLocalPlacements.Add(localPlacement);
                    return;
                }
                IfcMappedItem mi = obj as IfcMappedItem;

                if (mi != null)
                {
                    mMappedItems.Add(mi);
                    return;
                }
                IfcMaterial material = obj as IfcMaterial;

                if (material != null)
                {
                    mMaterials.Add(material);
                    return;
                }
                IfcMaterialProperties materialProperties = obj as IfcMaterialProperties;

                if (materialProperties != null)
                {
                    mMaterialProperties.Add(materialProperties);
                    return;
                }
                IfcMaterialPropertiesSuperSeded materialPropertiesSS = obj as IfcMaterialPropertiesSuperSeded;

                if (materialPropertiesSS != null)
                {
                    mMaterialPropertiesSS.Add(materialPropertiesSS);
                    return;
                }
                //	IfcMechanicalFastener mechanicalFastener = result as IfcMechanicalFastener;
                //if(mechanicalFastener != null)
                //{
                //	mFasteners.Add(mechanicalFastener);
                //	return mechanicalFastener;
                //}
                //IfcOwnerHistory ownerHistory = result as IfcOwnerHistory;
                //if(ownerHistory != null)
                //{
                //	mOwnHistories.Add(ownerHistory);
                //	return ownerHistory;
                //}
                IfcPresentationLayerAssignment presentationLayerAssignment = obj as IfcPresentationLayerAssignment;

                if (presentationLayerAssignment != null)
                {
                    mPresentationLayerAssignments.Add(presentationLayerAssignment);
                    return;
                }
                IfcProductRepresentation productRepresentation = obj as IfcProductRepresentation;

                if (productRepresentation != null)
                {
                    mProductReps.Add(productRepresentation);
                    return;
                }
                IfcPropertySet propSet = obj as IfcPropertySet;

                if (propSet != null)
                {
                    mPropertySets.Add(propSet);
                    return;
                }
                //IfcProfileDef profileDef = obj as IfcProfileDef;
                //if (profileDef != null)
                //{
                //	mProfiles.Add(profileDef);
                //	return profileDef;
                //}
                IfcRelationship relationship = obj as IfcRelationship;

                if (relationship != null)
                {
                    mRelationships.Add(relationship);
                    return;
                }
                IfcRepresentation representation = obj as IfcRepresentation;

                if (representation != null)
                {
                    mRepresentations.Add(representation);
                    return;
                }
                //IfcRepresentationMap representationMap = obj as IfcRepresentationMap;
                //if (representationMap != null)
                //{
                //	mRepMaps.Add(representationMap);
                //	return representationMap;
                //}
                IfcResourceConstraintRelationship rcr = obj as IfcResourceConstraintRelationship;

                if (rcr != null)
                {
                    mConstraintRelationships.Add(rcr);
                    return;
                }
                IfcShapeAspect shapeAspect = obj as IfcShapeAspect;

                if (shapeAspect != null)
                {
                    mShapeAspects.Add(shapeAspect);
                    return;
                }
                IfcStyledItem styledItem = obj as IfcStyledItem;

                if (styledItem != null)
                {
                    mStyledItems.Add(styledItem);
                    return;
                }

                IfcTypeProduct typeProduct = obj as IfcTypeProduct;

                if (typeProduct != null)
                {
                    mTypeProducts.Add(typeProduct);
                    return;
                }
                setCustomAggregate(obj);
            }