Inheritance: IfcProductRepresentation, IfcProductRepresentationSelect
示例#1
0
 protected IfcGeotechnicalStratum(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation)
     : base(host.Database)
 {
     host.AddNested(this);
     ObjectPlacement = placement;
     Representation  = representation;
 }
示例#2
0
        private void removeExistingFromShapeRep(List <IfcGridAxis> axis)
        {
            if (axis == null || axis.Count == 0)
            {
                return;
            }
            IfcProductDefinitionShape pds = Representation as IfcProductDefinitionShape;

            if (pds != null)
            {
                foreach (IfcShapeModel sm in pds.Representations)
                {
                    IfcShapeRepresentation sr = sm as IfcShapeRepresentation;
                    if (sr != null)
                    {
                        foreach (IfcRepresentationItem gri in sr.Items)
                        {
                            IfcGeometricCurveSet curveSet = gri as IfcGeometricCurveSet;
                            if (curveSet != null)
                            {
                                axis.ForEach(x => curveSet.Elements.Remove(x.AxisCurve));
                            }
                        }
                    }
                }
            }
        }
示例#3
0
        private void setShapeRep(List <IfcGridAxis> axis)
        {
            if (axis == null || axis.Count == 0)
            {
                return;
            }
            IfcProductDefinitionShape pds = Representation as IfcProductDefinitionShape;

            if (pds == null)
            {
                Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(new IfcGeometricCurveSet(axis.ConvertAll(x => (IfcGeometricSetSelect)x.AxisCurve))));
            }
            else
            {
                foreach (IfcShapeModel sm in pds.Representations)
                {
                    IfcShapeRepresentation sr = sm as IfcShapeRepresentation;
                    if (sr != null)
                    {
                        foreach (IfcRepresentationItem gri in sr.Items)
                        {
                            IfcGeometricCurveSet curveSet = gri as IfcGeometricCurveSet;
                            if (curveSet != null)
                            {
                                curveSet.addElements(axis.ConvertAll(x => (IfcGeometricSetSelect)x.AxisCurve));
                                return;
                            }
                        }
                    }
                }
            }
        }
示例#4
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            IfcObjectPlacement placement    = ObjectPlacement;
            JObject            placementObj = null;

            if (placement != null)
            {
                if (string.IsNullOrEmpty(placement.mGlobalId))
                {
                    placement.setGlobalId(ParserIfc.EncodeGuid(Guid.NewGuid()));
                }
                placementObj = placement.getJson(this, options);
            }
            base.setJSON(obj, host, options);

            if (placementObj != null)
            {
                obj["ObjectPlacement"] = placementObj;
            }
            if (options.Style != SetJsonOptions.JsonStyle.Repository)
            {
                IfcProductDefinitionShape representation = Representation;
                if (representation != null)
                {
                    obj["Representation"] = representation.getJson(this, options);
                }
            }
            //internal List<IfcRelAssignsToProduct> mReferencedBy = new List<IfcRelAssignsToProduct>();//	 :	SET OF IfcRelAssignsToProduct FOR RelatingProduct;
        }
示例#5
0
 public IfcWindow(IfcOpeningElement host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) :
     base(host.Database)
 {
     ObjectPlacement = placement;
     Representation  = representation;
     IfcRelFillsElement relFillsElement = new IfcRelFillsElement(host, this);
 }
示例#6
0
        private void setShapeRep(List <IfcGridAxis> axis)
        {
            if (axis == null || axis.Count == 0)
            {
                return;
            }
            IfcProductDefinitionShape pds = Representation as IfcProductDefinitionShape;

            if (pds == null)
            {
                List <IfcGeometricSetSelect> set = new List <IfcGeometricSetSelect>();
                foreach (IfcGridAxis a in axis)
                {
                    IfcCurve c = a.AxisCurve;
                    if (c != null)
                    {
                        set.Add(c);
                    }
                }
                if (set.Count > 0)
                {
                    Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.FootPrint), new IfcGeometricCurveSet(set), ShapeRepresentationType.GeometricCurveSet));
                }
            }
            else
            {
                foreach (IfcShapeModel sm in pds.Representations)
                {
                    IfcShapeRepresentation sr = sm as IfcShapeRepresentation;
                    if (sr != null)
                    {
                        foreach (IfcRepresentationItem gri in sr.Items)
                        {
                            IfcGeometricCurveSet curveSet = gri as IfcGeometricCurveSet;
                            if (curveSet != null)
                            {
                                foreach (IfcGridAxis a in axis)
                                {
                                    IfcCurve c = a.AxisCurve;
                                    if (c != null && !curveSet.Elements.Contains(c))
                                    {
                                        curveSet.Elements.Add(c);
                                    }
                                }
                                return;
                            }
                        }
                    }
                }
            }
        }
示例#7
0
        public IfcGeotechnicalStratum(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation)
            : base(host.Database)
        {
            IfcSpatialElement spatialElement = host as IfcSpatialElement;

            if (spatialElement != null)
            {
                spatialElement.AddElement(this);
            }
            else
            {
                host.AddNested(this);
            }
            ObjectPlacement = placement;
            Representation  = representation;
        }
示例#8
0
        public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height)
            : base(container, new IfcLocalPlacement(container.Placement, placement), null)
        {
            DatabaseIfc db  = mDatabase;
            double      tol = mDatabase.Tolerance;

            setMaterial(layerSetUsage);

            IfcShapeRepresentation asr  = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db, 0, 0, 0), new IfcCartesianPoint(db, length, 0, 0)));
            List <IfcShapeModel>   reps = new List <IfcShapeModel>();

            reps.Add(asr);
            double t = layerSetUsage.ForLayerSet.MaterialLayers.ToList().ConvertAll(x => x.LayerThickness).Sum();

            reps.Add(new IfcShapeRepresentation(new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db, "", length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db, length / 2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t / 2.0, 0)), height)));
            Representation = new IfcProductDefinitionShape(reps);
        }
示例#9
0
 public IfcUnitaryControlElement(IfcObjectDefinition host, IfcObjectPlacement p, IfcProductDefinitionShape r, IfcDistributionSystem system) : base(host, p, r, system)
 {
 }
示例#10
0
 public IfcUnitaryEquipment(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
示例#11
0
        public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height)
            : base(container,new IfcLocalPlacement(container.Placement, placement),null)
        {
            DatabaseIfc db = mDatabase;
            double tol = mDatabase.Tolerance;
            setMaterial(layerSetUsage);

            IfcShapeRepresentation asr = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db,0,0,0),new IfcCartesianPoint(db,length,0,0)));
            List<IfcShapeModel> reps = new List<IfcShapeModel>();
            reps.Add(asr);
            double t = layerSetUsage.ForLayerSet.MaterialLayers.ConvertAll(x=>x.LayerThickness).Sum();

            reps.Add(new IfcShapeRepresentation( new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db,"",length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db,length/2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t/2.0, 0)), height)));
            Representation = new IfcProductDefinitionShape(reps);
        }
示例#12
0
		internal static void parseFields(IfcProductDefinitionShape s, List<string> arrFields, ref int ipos) { IfcProductRepresentation.parseFields(s, arrFields, ref ipos); }
示例#13
0
		protected IfcElement(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length) : base(host,new IfcLocalPlacement(host.Placement,placement), null)
		{
			List<IfcShapeModel> reps = new List<IfcShapeModel>();
			IfcCartesianPoint cp = new IfcCartesianPoint(mDatabase, 0, 0, length);
			IfcPolyline ipl = new IfcPolyline(mDatabase.Factory.Origin, cp);
			reps.Add(IfcShapeRepresentation.GetAxisRep(ipl));
			
			profile.Associates.addAssociation(this);

			IfcMaterialProfileSet ps = profile.ForProfileSet;
			IfcMaterialProfileSetUsageTapering psut = profile as IfcMaterialProfileSetUsageTapering;
			if (psut != null)
				throw new Exception("Tapering Elements not implemented yet!");
			IfcProfileDef pd = null;
			if (ps.mCompositeProfile > 0)
				pd = ps.CompositeProfile;
			else
			{
				if (ps.mMaterialProfiles.Count > 0)
					pd = ps.MaterialProfiles[0].Profile;
				else
					throw new Exception("Profile not provided");
			}
			if (pd != null)
				reps.Add(new IfcShapeRepresentation( new IfcExtrudedAreaSolid(pd, pd.CalculateTransform(profile.CardinalPoint), length))); 
			
			Representation = new IfcProductDefinitionShape(reps);
		
		}
示例#14
0
 public IfcWasteTerminal(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
示例#15
0
		public IfcBuiltElement(IfcObjectDefinition host, IfcObjectPlacement p, IfcProductDefinitionShape r) : base(host, p, r) { }
示例#16
0
 public IfcImpactProtectionDevice(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation)
 {
 }
示例#17
0
		public IfcBuilding(IfcFacility host, string name, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, name, placement, representation) { setDefaultAddress(); }
示例#18
0
		internal IfcBuilding(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation) { setDefaultAddress(); }
示例#19
0
		internal IfcBridge(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation) { }
示例#20
0
		public IfcBridge(IfcFacility host, string name, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation) { Name = name; }
示例#21
0
		public IfcBeam(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape shape) : base(host, placement, shape) { }
示例#22
0
 public IfcLightFixture(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
示例#23
0
		public IfcBuildingElementPart(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation) { }
示例#24
0
 public IfcInterceptor(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
示例#25
0
		public IfcBuildingElementProxy(IfcObjectDefinition host, IfcObjectPlacement p, IfcProductDefinitionShape r) : base(host, p, r) { Name = "NOTDEFINED"; }
示例#26
0
 public IfcOpeningStandardCase(DatabaseIfc db, IfcObjectPlacement placement, IfcExtrudedAreaSolid eas) : base(db)
 {
     Placement = placement; Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(eas));
 }
示例#27
0
 protected IfcGeotechnicalElement(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation)
 {
 }
示例#28
0
		public IfcElement GenerateMappedItemElement(IfcProduct container, IfcCartesianTransformationOperator transform)  
		{
			string typename = this.GetType().Name;
			typename = typename.Substring(0, typename.Length - 4);
			IfcProductDefinitionShape pds = new IfcProductDefinitionShape(new IfcShapeRepresentation(new IfcMappedItem(RepresentationMaps[0], transform)));
			IfcElement element = IfcElement.constructElement(typename, container,null, pds);
			element.RelatingType = this;
			return element;
		}
示例#29
0
 public IfcGeographicElement(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation)
 {
     if (mDatabase.mRelease < ReleaseVersion.IFC4)
     {
         throw new Exception(StepClassName + " only supported in IFC4!");
     }
 }
示例#30
0
 public IfcWaterStratum(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation)
 {
 }
示例#31
0
		internal IfcProductDefinitionShape(IfcProductDefinitionShape i) : base(i) { }
示例#32
0
		protected IfcElement(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple<double,double> arcOrigin, double arcAngle) : base(host, new IfcLocalPlacement(host.Placement, placement), null)
		{
			IfcMaterialProfileSet ps = profile.ForProfileSet;
			profile.Associates.addAssociation(this);
			IfcMaterialProfile mp = ps.MaterialProfiles[0];
			IfcProfileDef pd = mp.Profile;
			DatabaseIfc db = host.mDatabase; 
			List<IfcShapeModel> reps = new List<IfcShapeModel>();
			double length = Math.Sqrt(Math.Pow(arcOrigin.Item1, 2) + Math.Pow(arcOrigin.Item2, 2)), angMultipler = 1 / mDatabase.mContext.UnitsInContext.getScaleSI(IfcUnitEnum.PLANEANGLEUNIT);
			Tuple<double, double> normal = new Tuple<double, double>(-arcOrigin.Item2 / length, arcOrigin.Item1 / length);
			reps.Add(IfcShapeRepresentation.GetAxisRep(new IfcTrimmedCurve(new IfcCircle(new IfcAxis2Placement3D(new IfcCartesianPoint(db,arcOrigin.Item1,arcOrigin.Item2,0),new IfcDirection(db, normal.Item1,normal.Item2, 0), new IfcDirection(db,-arcOrigin.Item1,-arcOrigin.Item2,0)),length),new IfcTrimmingSelect(0),new IfcTrimmingSelect(arcAngle*angMultipler),true, IfcTrimmingPreference.PARAMETER)));
			IfcAxis2Placement3D translation = pd.CalculateTransform(profile.CardinalPoint);
			Tuple<double,double,double> pt = translation.Location.Coordinates;
			IfcAxis1Placement axis = new IfcAxis1Placement(new IfcCartesianPoint(db, arcOrigin.Item1 - pt.Item1, arcOrigin.Item2 - pt.Item2), new IfcDirection(db, normal.Item1, normal.Item2));
			reps.Add(new IfcShapeRepresentation(new IfcRevolvedAreaSolid(pd, translation, axis, arcAngle * angMultipler)));
			Representation = new IfcProductDefinitionShape(reps);
		}
示例#33
0
		internal new static IfcProductDefinitionShape Parse(string strDef) { IfcProductDefinitionShape s = new IfcProductDefinitionShape(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; }
示例#34
0
 public IfcGeoslice(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation)
 {
 }
示例#35
0
 public IfcLinearPositioningElement(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape shape) : base(host, placement, shape)
 {
 }
示例#36
0
		public IfcBuildingStorey(IfcFacility host, string name, IfcObjectPlacement p, IfcProductDefinitionShape r) : base(host, p, r) { Name = name; }
示例#37
0
 private void setShapeRep(List<IfcGridAxis> axis)
 {
     if (axis == null || axis.Count == 0)
         return;
     IfcProductDefinitionShape pds = Representation as IfcProductDefinitionShape;
     if (pds == null)
         Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(new IfcGeometricCurveSet(axis.ConvertAll(x => (IfcGeometricSetSelect)x.AxisCurve))));
     else
     {
         foreach (IfcShapeModel sm in pds.Representations)
         {
             IfcShapeRepresentation sr = sm as IfcShapeRepresentation;
             if (sr != null)
             {
                 foreach (IfcRepresentationItem gri in sr.Items)
                 {
                     IfcGeometricCurveSet curveSet = gri as IfcGeometricCurveSet;
                     if (curveSet != null)
                     {
                         curveSet.addElements(axis.ConvertAll(x => (IfcGeometricSetSelect)x.AxisCurve));
                         return;
                     }
                 }
             }
         }
     }
 }
示例#38
0
		internal IfcBuildingStorey(IfcObjectDefinition host, IfcObjectPlacement p, IfcProductDefinitionShape r) : base(host, p, r) { }
示例#39
0
		public IfcOpeningStandardCase(DatabaseIfc db, IfcObjectPlacement placement, IfcExtrudedAreaSolid eas) : base(db) { Placement = placement; Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(eas)); }