/// <summary>
        /// Process IfcTriangulatedFaceSet instance
        /// </summary>
        /// <param name="ifcTriangulatedFaceSet">the handle</param>
        protected override void Process(IFCAnyHandle ifcTriangulatedFaceSet)
        {
            base.Process(ifcTriangulatedFaceSet);

            IList <IList <double> > normals = IFCImportHandleUtil.GetListOfListOfDoubleAttribute(ifcTriangulatedFaceSet, "Normals");

            if (normals != null)
            {
                if (normals.Count > 0)
                {
                    Normals = normals;
                }
            }

            bool?closed = IFCAnyHandleUtil.GetBooleanAttribute(ifcTriangulatedFaceSet, "Closed");

            if (closed != null)
            {
                Closed = closed;
            }

            IList <IList <int> > coordIndex = IFCImportHandleUtil.GetListOfListOfIntegerAttribute(ifcTriangulatedFaceSet, "CoordIndex");

            if (coordIndex != null)
            {
                if (coordIndex.Count > 0)
                {
                    CoordIndex = coordIndex;
                }
            }

            // Note that obsolete IFC4 files had a "NormalIndex".
            // We ignore this because we can't actually distinguish between these files.
            // "PnIndex" is new to IFC4Add2, so we'll protect here in case we see an obsolete file.
            try
            {
                if (IFCImportFile.TheFile.SchemaVersionAtLeast(IFCSchemaVersion.IFC4))
                {
                    IList <int> pnIndex = IFCAnyHandleUtil.GetAggregateIntAttribute <List <int> >(ifcTriangulatedFaceSet, "PnIndex");
                    if (pnIndex != null)
                    {
                        if (pnIndex.Count > 0)
                        {
                            PnIndex = pnIndex;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (IFCImportFile.HasUndefinedAttribute(ex))
                {
                    IFCImportFile.TheFile.DowngradeIFC4SchemaTo(IFCSchemaVersion.IFC4Add1Obsolete);
                }
                else
                {
                    throw ex;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Process the IfcCartesianPointList handle.
        /// </summary>
        /// <param name="item">The handle</param>
        protected override void Process(IFCAnyHandle item)
        {
            base.Process(item);

            CoordList = new List <XYZ>();

            IList <IList <double> > coordList = IFCImportHandleUtil.GetListOfListOfDoubleAttribute(item, "CoordList");

            if (coordList != null)
            {
                foreach (IList <double> coord in coordList)
                {
                    // TODO: we expect size to be 2 or 3.  Warn if not?
                    if (coord == null)
                    {
                        continue;
                    }

                    int size = coord.Count;
                    CoordList.Add(new XYZ(
                                      (size > 0 ? IFCUnitUtil.ScaleLength(coord[0]) : 0.0),
                                      (size > 1 ? IFCUnitUtil.ScaleLength(coord[1]) : 0.0),
                                      (size > 2 ? IFCUnitUtil.ScaleLength(coord[2]) : 0.0)));
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Process the IfcCartesianPointList3D handle.
        /// </summary>
        /// <param name="item">The handle</param>
        protected override void Process(IFCAnyHandle item)
        {
            base.Process(item);

            IList <IList <double> > coordListAttrbute = IFCImportHandleUtil.GetListOfListOfDoubleAttribute(item, "CoordList");

            if (coordListAttrbute != null)
            {
                m_CoordList = coordListAttrbute;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Process IfcTriangulatedFaceSet instance
        /// </summary>
        /// <param name="ifcTriangulatedFaceSet">the handle</param>
        protected override void Process(IFCAnyHandle ifcTriangulatedFaceSet)
        {
            base.Process(ifcTriangulatedFaceSet);

            // Process the IFCCartesianPointLIst3D
            IFCAnyHandle coordinates = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcTriangulatedFaceSet, "Coordinates", true);

            if (IFCAnyHandleUtil.IsSubTypeOf(coordinates, IFCEntityType.IfcCartesianPointList3D))
            {
                IFCCartesianPointList3D coordList = IFCCartesianPointList3D.processIFCCartesianPointList3D(coordinates);
                if (coordList != null)
                {
                    Coordinates = coordList;
                }
            }

            IList <IList <double> > normals = IFCImportHandleUtil.GetListOfListOfDoubleAttribute(ifcTriangulatedFaceSet, "Normals");

            if (normals != null)
            {
                if (normals.Count > 0)
                {
                    Normals = normals;
                }
            }

            bool?closed = IFCAnyHandleUtil.GetBooleanAttribute(ifcTriangulatedFaceSet, "Closed");

            if (closed != null)
            {
                Closed = closed;
            }

            IList <IList <int> > coordIndex = IFCImportHandleUtil.GetListOfListOfIntegerAttribute(ifcTriangulatedFaceSet, "CoordIndex");

            if (coordIndex != null)
            {
                if (coordIndex.Count > 0)
                {
                    CoordIndex = coordIndex;
                }
            }

            IList <IList <int> > normalIndex = IFCImportHandleUtil.GetListOfListOfIntegerAttribute(ifcTriangulatedFaceSet, "NormalIndex");

            if (normalIndex != null)
            {
                if (normalIndex.Count > 0)
                {
                    NormalIndex = normalIndex;
                }
            }
        }
        protected override void Process(IFCAnyHandle ifcRationalBSplineSurfaceWithKnots)
        {
            base.Process(ifcRationalBSplineSurfaceWithKnots);

            IList <IList <double> > weightsData = IFCImportHandleUtil.GetListOfListOfDoubleAttribute(ifcRationalBSplineSurfaceWithKnots, "WeightsData");

            if (weightsData != null)
            {
                foreach (IList <double> weightsRow in weightsData)
                {
                    WeightsList.AddRange(weightsRow);
                }
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Process IfcTriangulatedFaceSet instance
        /// </summary>
        /// <param name="ifcTriangulatedFaceSet">the handle</param>
        protected override void Process(IFCAnyHandle ifcTriangulatedFaceSet)
        {
            base.Process(ifcTriangulatedFaceSet);

            IList <IList <double> > normals = IFCImportHandleUtil.GetListOfListOfDoubleAttribute(ifcTriangulatedFaceSet, "Normals");

            if (normals != null)
            {
                if (normals.Count > 0)
                {
                    Normals = normals;
                }
            }

            bool?closed = IFCAnyHandleUtil.GetBooleanAttribute(ifcTriangulatedFaceSet, "Closed");

            if (closed != null)
            {
                Closed = closed;
            }

            IList <IList <int> > coordIndex = IFCImportHandleUtil.GetListOfListOfIntegerAttribute(ifcTriangulatedFaceSet, "CoordIndex");

            if (coordIndex != null)
            {
                if (coordIndex.Count > 0)
                {
                    CoordIndex = coordIndex;
                }
            }

            IList <IList <int> > normalIndex;

            if (IFCImportFile.TheFile.SchemaVersion >= IFCSchemaVersion.IFC4Add2)
            {
                normalIndex = coordIndex;
            }
            else
            {
                normalIndex = IFCImportHandleUtil.GetListOfListOfIntegerAttribute(ifcTriangulatedFaceSet, "NormalIndex");
            }

            if (normalIndex != null)
            {
                if (normalIndex.Count > 0)
                {
                    NormalIndex = normalIndex;
                }
            }

            if (IFCImportFile.TheFile.SchemaVersion >= IFCSchemaVersion.IFC4Add2)
            {
                IList <int> pnIndex = IFCAnyHandleUtil.GetAggregateIntAttribute <List <int> >(ifcTriangulatedFaceSet, "PnIndex");
                if (pnIndex != null)
                {
                    if (pnIndex.Count > 0)
                    {
                        PnIndex = pnIndex;
                    }
                }
            }
        }