Пример #1
0
        private void method_4(
            Class374 modelBuilder,
            DxfPolyline3DBase polyline,
            Class285 entityBuilder)
        {
            modelBuilder.Messages.Add(new DxfMessage(DxfStatus.InvalidPolylineVertexEntityType, Severity.Error, "EntityType", entityBuilder.Entity == null ? (object)"null" : (object)entityBuilder.Entity.GetType().Name)
            {
                Parameters =
                {
                    {
                        "ExpectedEntityType",
                        (object)typeof(DxfVertex3D).Name
                    },
                    {
                        "target",
                        (object)polyline
                    },
                    {
                        "VertexObject",
                        (object)entityBuilder.Entity
                    }
                }
            });
            DxfBlock objectSoftReference = polyline.OwnerObjectSoftReference as DxfBlock;

            this.IsValid = false;
            if (objectSoftReference == null)
            {
                return;
            }
            ((Class318)modelBuilder.method_5(objectSoftReference.Handle)).method_1((DxfEntity)polyline);
        }
Пример #2
0
        private void method_3(
            Class374 modelBuilder,
            DxfPolyline3DSpline spline,
            Class285 entityBuilder)
        {
            if (entityBuilder == null)
            {
                return;
            }
            Class301 class301 = entityBuilder as Class301;

            if (class301 == null)
            {
                this.method_4(modelBuilder, (DxfPolyline3DBase)spline, entityBuilder);
            }
            else
            {
                DxfVertex3D handledObject = (DxfVertex3D)class301.HandledObject;
                if (class301.IsSplineControlPoint)
                {
                    spline.ControlPoints.Add(handledObject);
                }
                else
                {
                    spline.ApproximationPoints.Add(handledObject);
                }
            }
        }
Пример #3
0
        private static void smethod_0(DxfPolyfaceMesh mesh, Class285 entityBuilder)
        {
            Class301 class301 = entityBuilder as Class301;

            if (class301 == null)
            {
                return;
            }
            mesh.Vertices.Add((DxfVertex3D)class301.Entity);
        }
Пример #4
0
 private int method_2(DxfPolygonMesh polygonMesh, Class285 entityBuilder, ref int vertexIndex)
 {
     if (entityBuilder != null)
     {
         Class301 class301 = (Class301)entityBuilder;
         polygonMesh.Vertices.Add((DxfVertex3D)class301.Entity);
         ++vertexIndex;
     }
     return(vertexIndex);
 }
Пример #5
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            DxfPolyfaceMesh entity = (DxfPolyfaceMesh)this.Entity;

            if (entity != null)
            {
                if (this.ulong_6 != 0UL)
                {
                    for (Class285 entityBuilder = modelBuilder.method_6(this.ulong_6); entityBuilder != null; entityBuilder = modelBuilder.method_7(entityBuilder))
                    {
                        Class304.smethod_0(entity, entityBuilder);
                        if ((long)entityBuilder.HandledObject.Handle == (long)this.ulong_7)
                        {
                            break;
                        }
                    }
                    for (Class285 entityBuilder = modelBuilder.method_6(this.ulong_6); entityBuilder != null; entityBuilder = modelBuilder.method_7(entityBuilder))
                    {
                        this.method_2(modelBuilder, entity, entityBuilder);
                        if ((long)entityBuilder.HandledObject.Handle == (long)this.ulong_7)
                        {
                            break;
                        }
                    }
                }
                else if (this.list_1 != null)
                {
                    for (int index = 0; index < this.list_1.Count; ++index)
                    {
                        ulong handle = this.list_1[index];
                        Class304.smethod_0(entity, modelBuilder.method_6(handle));
                    }
                    for (int index = 0; index < this.list_1.Count; ++index)
                    {
                        ulong handle = this.list_1[index];
                        this.method_2(modelBuilder, entity, modelBuilder.method_6(handle));
                    }
                }
            }
            if (this.ulong_8 == 0UL)
            {
                return;
            }
            DxfSequenceEnd dxfSequenceEnd = modelBuilder.method_4 <DxfSequenceEnd>(this.ulong_8);

            if (dxfSequenceEnd == null)
            {
                return;
            }
            entity.SeqEnd = dxfSequenceEnd;
        }
Пример #6
0
        private void method_2(Class374 modelBuilder, DxfPolyfaceMesh mesh, Class285 entityBuilder)
        {
            Class286 class286 = entityBuilder as Class286;

            if (class286 == null)
            {
                return;
            }
            DxfMeshFace entity = (DxfMeshFace)class286.Entity;

            if (class286.Vertex0Index != (short)0)
            {
                int index = Math.Abs((int)class286.Vertex0Index) - 1;
                if (index >= mesh.Vertices.Count)
                {
                    this.method_3(modelBuilder, mesh, (int)class286.Vertex0Index);
                    return;
                }
                entity.Corners.Add(new DxfMeshFace.Corner(mesh.Vertices[index], class286.Vertex0Index > (short)0));
            }
            if (class286.Vertex1Index != (short)0)
            {
                int index = Math.Abs((int)class286.Vertex1Index) - 1;
                if (index >= mesh.Vertices.Count)
                {
                    this.method_3(modelBuilder, mesh, (int)class286.Vertex1Index);
                    return;
                }
                entity.Corners.Add(new DxfMeshFace.Corner(mesh.Vertices[index], class286.Vertex1Index > (short)0));
            }
            if (class286.Vertex2Index != (short)0)
            {
                int index = Math.Abs((int)class286.Vertex2Index) - 1;
                if (index >= mesh.Vertices.Count)
                {
                    this.method_3(modelBuilder, mesh, (int)class286.Vertex2Index);
                    return;
                }
                entity.Corners.Add(new DxfMeshFace.Corner(mesh.Vertices[index], class286.Vertex2Index > (short)0));
            }
            if (class286.Vertex3Index != (short)0)
            {
                int index = Math.Abs((int)class286.Vertex3Index) - 1;
                if (index >= mesh.Vertices.Count)
                {
                    this.method_3(modelBuilder, mesh, (int)class286.Vertex3Index);
                    return;
                }
                entity.Corners.Add(new DxfMeshFace.Corner(mesh.Vertices[index], class286.Vertex3Index > (short)0));
            }
            mesh.Faces.Add(entity);
        }
Пример #7
0
        private static void smethod_1(DxfPolyline2DSpline spline, Class285 vertexBuilder)
        {
            DxfVertex2D handledObject = (DxfVertex2D)vertexBuilder.HandledObject;

            if (handledObject.IsSplineControlPoint)
            {
                spline.ControlPoints.Add(handledObject);
            }
            else
            {
                spline.ApproximationPoints.Add(handledObject);
            }
        }
Пример #8
0
        private void method_2(Class374 modelBuilder, DxfPolyline3D polyline, Class285 entityBuilder)
        {
            if (entityBuilder == null)
            {
                return;
            }
            Class301 class301 = entityBuilder as Class301;

            if (class301 == null)
            {
                this.method_4(modelBuilder, (DxfPolyline3DBase)polyline, entityBuilder);
            }
            else
            {
                DxfVertex3D handledObject = (DxfVertex3D)class301.HandledObject;
                polyline.Vertices.Add(handledObject);
            }
        }
Пример #9
0
        private void method_3(
            DxfPolygonSplineMesh splineMesh,
            Class285 entityBuilder,
            ref int controlPointIndex,
            ref int approximationPointIndex)
        {
            if (entityBuilder == null)
            {
                return;
            }
            Class301 class301 = (Class301)entityBuilder;

            if (class301.IsSplineControlPoint)
            {
                splineMesh.ControlPoints.Add((DxfVertex3D)class301.Entity);
                ++controlPointIndex;
            }
            else
            {
                splineMesh.ApproximationPoints.Add((DxfVertex3D)class301.Entity);
                ++approximationPointIndex;
            }
        }
Пример #10
0
        private static void smethod_0(
            Class374 modelBuilder,
            DxfPolyline2D polyline,
            Class285 vertexBuilder)
        {
            DxfVertex2D handledObject = vertexBuilder.HandledObject as DxfVertex2D;

            if (handledObject != null)
            {
                polyline.Vertices.Add(handledObject);
            }
            else
            {
                if (vertexBuilder.HandledObject == null)
                {
                    return;
                }
                modelBuilder.Messages.Add(new DxfMessage(DxfStatus.WrongType, Severity.Warning)
                {
                    Parameters =
                    {
                        {
                            "Class",
                            (object)"AcDb2dPolyline"
                        },
                        {
                            "Handle",
                            (object)polyline.HandleString
                        },
                        {
                            "Bad vertex handle",
                            (object)vertexBuilder.HandledObject.HandleString
                        }
                    }
                });
            }
        }
Пример #11
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            DxfInsertBase handledObject = (DxfInsertBase)this.HandledObject;

            if (this.ulong_6 != 0UL)
            {
                DxfBlock dxfBlock = modelBuilder.method_3(this.ulong_6) as DxfBlock;
                if (dxfBlock != null)
                {
                    handledObject.Block = dxfBlock;
                }
                else
                {
                    modelBuilder.Messages.Add(new DxfMessage(DxfStatus.UnresolvedReference, Severity.Warning)
                    {
                        Parameters =
                        {
                            {
                                "Type",
                                (object)"BLOCK_RECORD"
                            },
                            {
                                "Handle",
                                (object)this.ulong_6
                            },
                            {
                                "Insert",
                                (object)handledObject
                            },
                            {
                                "InsertHandle",
                                (object)handledObject.Handle
                            }
                        }
                    });
                }
            }
            else if (!string.IsNullOrEmpty(this.string_2))
            {
                handledObject.Block = modelBuilder.Model.GetBlockWithName(this.string_2);
                if (handledObject.Block == null)
                {
                    modelBuilder.Messages.Add(new DxfMessage(DxfStatus.UnresolvedReference, Severity.Warning)
                    {
                        Parameters =
                        {
                            {
                                "Type",
                                (object)"BLOCK_RECORD"
                            },
                            {
                                "Name",
                                (object)this.string_2
                            },
                            {
                                "Insert",
                                (object)handledObject
                            },
                            {
                                "InsertHandle",
                                (object)handledObject.Handle
                            }
                        }
                    });
                }
            }
            if (this.ulong_7 != 0UL)
            {
                for (Class285 entityBuilder = modelBuilder.method_6(this.ulong_7); entityBuilder != null; entityBuilder = modelBuilder.method_7(entityBuilder))
                {
                    handledObject.Attributes.Add((DxfAttribute)entityBuilder.Entity);
                    if ((long)entityBuilder.HandledObject.Handle == (long)this.ulong_8)
                    {
                        break;
                    }
                }
            }
            else if (this.list_1 != null)
            {
                foreach (ulong handle in this.list_1)
                {
                    DxfAttribute dxfAttribute = modelBuilder.method_4 <DxfAttribute>(handle);
                    if (dxfAttribute != null)
                    {
                        handledObject.Attributes.Add(dxfAttribute);
                    }
                }
            }
            if (this.ulong_9 == 0UL)
            {
                return;
            }
            DxfSequenceEnd dxfSequenceEnd = modelBuilder.method_4 <DxfSequenceEnd>(this.ulong_9);

            if (dxfSequenceEnd == null)
            {
                return;
            }
            handledObject.AttributesSeqEnd = dxfSequenceEnd;
        }
Пример #12
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            DxfPolyline2DBase   entity = (DxfPolyline2DBase)this.Entity;
            DxfPolyline2DSpline spline = entity as DxfPolyline2DSpline;

            if (spline != null)
            {
                if (this.ulong_6 != 0UL)
                {
                    for (Class285 class285 = modelBuilder.method_6(this.ulong_6); class285 != null; class285 = modelBuilder.method_7(class285))
                    {
                        Class297.smethod_1(spline, class285);
                        if ((long)class285.HandledObject.Handle == (long)this.ulong_7)
                        {
                            break;
                        }
                    }
                }
                else if (this.list_1 != null)
                {
                    for (int index = 0; index < this.list_1.Count; ++index)
                    {
                        ulong handle = this.list_1[index];
                        Class297.smethod_1(spline, modelBuilder.method_6(handle));
                    }
                }
            }
            else
            {
                DxfPolyline2D polyline = entity as DxfPolyline2D;
                if (polyline != null)
                {
                    if (this.ulong_6 != 0UL)
                    {
                        for (Class285 class285 = modelBuilder.method_6(this.ulong_6); class285 != null; class285 = modelBuilder.method_7(class285))
                        {
                            Class297.smethod_0(modelBuilder, polyline, class285);
                            if ((long)class285.HandledObject.Handle == (long)this.ulong_7)
                            {
                                break;
                            }
                        }
                    }
                    else if (this.list_1 != null)
                    {
                        for (int index = 0; index < this.list_1.Count; ++index)
                        {
                            ulong handle = this.list_1[index];
                            Class297.smethod_0(modelBuilder, polyline, modelBuilder.method_6(handle));
                        }
                    }
                }
            }
            if (this.ulong_8 == 0UL)
            {
                return;
            }
            DxfSequenceEnd dxfSequenceEnd = modelBuilder.method_4 <DxfSequenceEnd>(this.ulong_8);

            if (dxfSequenceEnd == null)
            {
                return;
            }
            entity.SeqEnd = dxfSequenceEnd;
        }
Пример #13
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            DxfBlock handledObject1 = (DxfBlock)this.HandledObject;

            if (this.ulong_2 != 0UL)
            {
                handledObject1.BlockBegin = modelBuilder.method_4 <DxfBlockBegin>(this.ulong_2);
            }
            if (this.ulong_6 != 0UL)
            {
                Class284 class284 = modelBuilder.method_5(this.ulong_6) as Class284;
                if (class284 != null)
                {
                    if ((long)class284.AssociatedBockRecordHandle == (long)handledObject1.Handle)
                    {
                        DxfLayout handledObject2 = (DxfLayout)class284.HandledObject;
                        if (handledObject2 != null)
                        {
                            handledObject1.Layout = handledObject2;
                        }
                    }
                    else
                    {
                        modelBuilder.Messages.Add(new DxfMessage(DxfStatus.BlockLayoutReferenceCorrupt, Severity.Warning, "BlockHandle", (object)handledObject1.Handle)
                        {
                            Parameters =
                            {
                                {
                                    "BlockName",
                                    (object)handledObject1.Name
                                }
                            }
                        });
                    }
                }
            }
            if (this.ulong_3 != 0UL && this.ulong_4 != 0UL)
            {
                for (Class285 entityBuilder = modelBuilder.method_6(this.ulong_3); entityBuilder != null; entityBuilder = modelBuilder.method_7(entityBuilder))
                {
                    DxfEntity entity = entityBuilder.Entity;
                    this.method_3(modelBuilder, handledObject1, entity);
                    if ((long)entityBuilder.HandledObject.Handle == (long)this.ulong_4)
                    {
                        break;
                    }
                }
            }
            else if (this.list_1 != null)
            {
                foreach (ulong handle in this.list_1)
                {
                    Class285 class285 = modelBuilder.method_6(handle);
                    if (class285 != null)
                    {
                        DxfEntity entity = class285.Entity;
                        this.method_3(modelBuilder, handledObject1, entity);
                    }
                }
            }
            if (this.ulong_5 != 0UL)
            {
                handledObject1.BlockEnd = modelBuilder.method_4 <DxfBlockEnd>(this.ulong_5);
            }
            if (handledObject1.ExtensionDictionary == null || !handledObject1.ExtensionDictionary.Entries.Contains("ACAD_UNLOAD"))
            {
                return;
            }
            handledObject1.IsExternalReferenceUnloaded = true;
        }
Пример #14
0
        public override void ResolveReferences(Class374 modelBuilder)
        {
            base.ResolveReferences(modelBuilder);
            DxfPolygonMeshBase   entity     = (DxfPolygonMeshBase)this.Entity;
            DxfPolygonSplineMesh splineMesh = entity as DxfPolygonSplineMesh;

            if (splineMesh != null)
            {
                splineMesh.MControlPointCount    = this.ushort_0;
                splineMesh.NControlPointCount    = this.ushort_1;
                splineMesh.SmoothSurfaceMDensity = this.ushort_2;
                splineMesh.SmoothSurfaceNDensity = this.ushort_3;
                int controlPointIndex       = 0;
                int approximationPointIndex = 0;
                if (this.ulong_6 != 0UL)
                {
                    for (Class285 entityBuilder = modelBuilder.method_6(this.ulong_6); entityBuilder != null; entityBuilder = modelBuilder.method_7(entityBuilder))
                    {
                        this.method_3(splineMesh, entityBuilder, ref controlPointIndex, ref approximationPointIndex);
                        if ((long)entityBuilder.HandledObject.Handle == (long)this.ulong_7)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    if (this.list_1 == null)
                    {
                        return;
                    }
                    for (int index = 0; index < this.list_1.Count; ++index)
                    {
                        ulong handle = this.list_1[index];
                        this.method_3(splineMesh, modelBuilder.method_6(handle), ref controlPointIndex, ref approximationPointIndex);
                    }
                }
            }
            else
            {
                DxfPolygonMesh polygonMesh = (DxfPolygonMesh)entity;
                polygonMesh.MVertexCount = this.ushort_0;
                polygonMesh.NVertexCount = this.ushort_1;
                int vertexIndex = 0;
                if (this.ulong_6 != 0UL)
                {
                    for (Class285 entityBuilder = modelBuilder.method_6(this.ulong_6); entityBuilder != null; entityBuilder = modelBuilder.method_7(entityBuilder))
                    {
                        this.method_2(polygonMesh, entityBuilder, ref vertexIndex);
                        if ((long)entityBuilder.HandledObject.Handle == (long)this.ulong_7)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    if (this.list_1 == null)
                    {
                        return;
                    }
                    for (int index = 0; index < this.list_1.Count; ++index)
                    {
                        ulong    handle        = this.list_1[index];
                        Class285 entityBuilder = modelBuilder.method_6(handle);
                        this.method_2(polygonMesh, entityBuilder, ref vertexIndex);
                    }
                }
            }
        }