Esempio n. 1
0
        public new object Clone()
        {
            CEntityVertex entity;

            entity = new CEntityVertex();

            CloneEntity(entity);

            entity.StartingWidth            = StartingWidth;
            entity.EndingWidth              = EndingWidth;
            entity.Bulge                    = Bulge;
            entity.CurveFitTangentDirection = CurveFitTangentDirection;

            entity.ExtraVertexCreatedByCurveFitting = ExtraVertexCreatedByCurveFitting;
            entity.HasCurveFitTangent = HasCurveFitTangent;
            entity.SplineVertexCreatedBySplineFitting = SplineVertexCreatedBySplineFitting;
            entity.SplineFrameControlPoint            = SplineFrameControlPoint;
            entity.Is3DPolylineVertex    = Is3DPolylineVertex;
            entity.Is3DPolygonMeshVertex = Is3DPolygonMeshVertex;
            entity.IsPolyFaceMeshVertex  = IsPolyFaceMeshVertex;

            return(entity);
        }
Esempio n. 2
0
        public override void ReadGroupCodes()
        {
            BitArray      flags;
            BitArray      comparer;
            bool          processingVertices;
            CEntityVertex vertex;

            VertexList         = new ArrayList();
            processingVertices = false;
            vertex             = null;


            foreach (CGroupCode gc in GroupCodeList)
            {
                if (gc.Code == 0)
                {
                    if (gc.Value.Trim().ToUpper() == "VERTEX")
                    {
                        processingVertices = true;

                        if (vertex != null)
                        {
                            vertex.ReadGroupCodes();
                            VertexList.Add(vertex);
                        }

                        vertex            = new CEntityVertex();
                        vertex.EntityName = "VERTEX";
                        vertex.LayerName  = LayerName;
                    }
                    else if (gc.Value.Trim().ToUpper() == "SEQEND")
                    {
                        processingVertices = false;
                        if (vertex != null)
                        {
                            vertex.ReadGroupCodes();
                            VertexList.Add(vertex);
                        }
                    }
                }
                else if (gc.Code == 30 && processingVertices == false)
                {
                    Elevation = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 40 && processingVertices == false)
                {
                    DefaultStartingWidth = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 41 && processingVertices == false)
                {
                    DefaultEndingWidth = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 70 && processingVertices == false)
                {
                    flags = new BitArray(new int[] { CGlobals.ConvertToInt(gc.Value.Trim()) });

                    comparer         = new BitArray(new int[] { 1 });
                    IsClosedPolyline = flags.And(comparer)[0];

                    comparer            = new BitArray(new int[] { 2 });
                    HasCurveFitVertices = flags.And(comparer)[0];

                    comparer             = new BitArray(new int[] { 4 });
                    HasSplineFitVertices = flags.And(comparer)[0];

                    comparer     = new BitArray(new int[] { 8 });
                    Is3DPolyline = flags.And(comparer)[0];

                    comparer = new BitArray(new int[] { 16 });
                    Is3DMesh = flags.And(comparer)[0];

                    comparer = new BitArray(new int[] { 32 });
                    MeshClosedInTheNDirection = flags.And(comparer)[0];

                    comparer       = new BitArray(new int[] { 64 });
                    IsPolyfaceMesh = flags.And(comparer)[0];

                    comparer           = new BitArray(new int[] { 128 });
                    ContinuousLineType = flags.And(comparer)[0];
                }
                else if (gc.Code == 71 && processingVertices == false)
                {
                    PolygonMeshMVertexCount = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 72 && processingVertices == false)
                {
                    PolygonMeshNVertexCount = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 73 && processingVertices == false)
                {
                    SmoothSurfaceMDensity = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 74 && processingVertices == false)
                {
                    SmoothSurfaceNDensity = CGlobals.ConvertToDouble(gc.Value.Trim());
                }
                else if (gc.Code == 75 && processingVertices == false)
                {
                    if (CGlobals.ConvertToInt(gc.Value.Trim()) == 0)
                    {
                        NoSmoothSurfaceFitted = true;
                    }
                    else if (CGlobals.ConvertToInt(gc.Value.Trim()) == 5)
                    {
                        QuadraticBSplineSurface = true;
                    }
                    else if (CGlobals.ConvertToInt(gc.Value.Trim()) == 6)
                    {
                        CubicBSplineSurface = true;
                    }
                    else if (CGlobals.ConvertToInt(gc.Value.Trim()) == 8)
                    {
                        BezierSurface = true;
                    }
                }
                else
                {
                    if (processingVertices && vertex != null)
                    {
                        if (gc.Code == 5)
                        {
                            // Handle

                            vertex.Handle = gc.Value.Trim();
                        }
                        else if (gc.Code == 6)
                        {
                            // Line Type

                            vertex.LineType = gc.Value.Trim();
                        }
                        else if (gc.Code == 8)
                        {
                            // Layer Name

                            vertex.LayerName = gc.Value.Trim();
                        }
                        else
                        {
                            vertex.GroupCodeList.Add(gc);
                        }
                    }
                }
            }
        }