Пример #1
0
        void GenerateGeometry(IntPtr ifcModel, IFCItem ifcItem, ref int a)
        {
            while (ifcItem != null)
            {
                // Generate WireFrames Geometry
                IfcEngine.Setting setting = IfcEngine.Setting.Default;
                IfcEngine.Mask    mask    = IfcEngine.Mask.Default;
                mask |= IfcEngine.Mask.DoublePrecision; //    PRECISION (32/64 bit)
                mask |= IfcEngine.Mask.UseIndex64;      //	   INDEX ARRAY (32/64 bit)
                mask |= IfcEngine.Mask.GenNormals;      //    NORMALS
                mask |= IfcEngine.Mask.GenTriangles;    //    TRIANGLES
                mask |= IfcEngine.Mask.GenWireFrame;    //    WIREFRAME


                //                if (IntPtr.Size == 8) {
                //                    setting |= IfcEngine.Setting.UseIndex64; // 64 BIT INDEX ARRAY (Int64)
                //                }

                setting |= IfcEngine.Setting.GenWireframe; //    WIREFRAME ON


                _ifcEngine.SetFormat(ifcModel, setting, mask);

                GenerateWireFrameGeometry(ifcModel, ifcItem);

                // Generate Faces Geometry
                setting = IfcEngine.Setting.Default;

                //                if (IntPtr.Size == 8) {
                //                    setting |= IfcEngine.Setting.UseIndex64; //    64 BIT INDEX ARRAY (Int64)
                //                }

                setting |= IfcEngine.Setting.GenNormals;   //    NORMALS ON
                setting |= IfcEngine.Setting.GenTriangles; //    TRIANGLES ON

                _ifcEngine.SetFormat(ifcModel, setting, mask);

                GenerateFacesGeometry(ifcModel, ifcItem);

                _ifcEngine.CleanMemory(ifcModel);

                GenerateGeometry(ifcModel, ifcItem.child, ref a);
                ifcItem = ifcItem.next;
            }
        }