예제 #1
0
        /// <summary>
        /// Create a geometry object(s) described by stored face sets, if possible.
        /// Usually a single-element IList conatining either Solid or Mesh is returned.
        /// A two-elemant IList containing a Solid as the 1st element and a Mesh as
        /// the 2nd is returned if while building multiple face sets, a fallback
        /// was used for some but not all sets.
        /// </summary>
        /// <returns>The IList created, or null. The IList can contain a Solid and/or a Mesh.
        /// If Solid is present, it always the 1st element.</returns>
        private IList <GeometryObject> CreateGeometryObjects(string guid,
                                                             out bool hasInvalidData, out TessellatedShapeBuilderOutcome outcome)
        {
            m_TessellatedShapeBuilder.CloseConnectedFaceSet();

            // The OwnerInfo is currently unused; the value doesn't really matter.
            m_TessellatedShapeBuilder.LogString  = IFCImportFile.TheFileName;
            m_TessellatedShapeBuilder.LogInteger = IFCImportFile.TheBrepCounter;
            m_TessellatedShapeBuilder.OwnerInfo  = guid != null ? guid : "Temporary Element";
            TessellatedShapeBuilderResult result = m_TessellatedShapeBuilder.Build(
                TargetGeometry, FallbackGeometry, GraphicsStyleId);

            // It is important that we clear the TSB after we build above, otherwise we will "collect" geometries
            // in the DirectShape and create huge files with redundant data.
            m_TessellatedShapeBuilder.Clear();
            hasInvalidData = result.HasInvalidData;
            outcome        = result.Outcome;
            return(result.GetGeometricalObjects());
        }
예제 #2
0
 private void ClearTessellatedShapeBuilder()
 {
     TessellatedShapeBuilder.Clear();
     CreatedFacesCount = 0;
 }