示例#1
0
        private bool SkipSections( )
        {
            dxfPair = new DXFPair(dxSourcefFile, this);
            for ( ; ;)
            {
                if (dxfPair == null)
                {
                    break;
                }

                if (dxfPair == "EOF")
                {
                    dxfPair.Log(0);
                    break;
                }
                if (dxfPair == "SECTION")
                {
                    dxfPair.Log(0);
                    dxfPair = new DXFPair(dxSourcefFile, this);
                    if (dxfPair == null)
                    {
                        return(false);
                    }

                    if (dxfPair != "ENTITIES")
                    {
                        if (!ReadaSection( ))
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        dxfPair.Log(0);
                        dxfPair = new DXFPair(dxSourcefFile, this);
                        break;
                    }
                }
            }
            return(true);
        }
示例#2
0
 private bool    ReadaSection( )
 {
     dxfPair.Log(0);
     dxfPair = new DXFPair(dxSourcefFile, this);
     for ( ; dxfPair != null;)
     {
         if (dxfPair == "ENDSEC")
         {
             dxfPair.Log(0);
             dxfPair = new DXFPair(dxSourcefFile, this);
             return(true);
         }
         dxfPair = new DXFPair(dxSourcefFile, this);
     }
     return(true);
 }
示例#3
0
        private bool ReadEntities( )
        {
            dxfPair.Log(0);
            dxfPair = new DXFPair(dxSourcefFile, this);

            for ( ; dxfPair != null;)
            {
                if (!ReadaEntity( ))
                {
                    return(false);
                }

                if (dxfPair == "ENDSEC")
                {
                    dxfPair.Log(0);
                    dxfPair = new DXFPair(dxSourcefFile, this);
                    return(true);
                }
            }
            return(true);
        }
示例#4
0
        public bool ScanAll( )
        {
            dxfPair = new DXFPair(dxSourcefFile, this);
            for ( ; ;)
            {
                if (dxfPair == null)
                {
                    break;
                }

                if (dxfPair == "EOF")
                {
                    dxfPair.Log(0);
                    break;
                }
                if (dxfPair == "SECTION")
                {
                    ScanSection();
                }
            }
            return(true);
        }
示例#5
0
        private bool ScanSection()
        {
            dxfPair.Log(0);
            dxfPair = new DXFPair(dxSourcefFile, this);
            if (dxfPair == null)
            {
                return(false);
            }

            if (dxfPair == "HEADER")
            {
                return(ReadHeader( ));
            }
            if (dxfPair == "CLASSES")
            {
                return(ReadClasses( ));
            }
            if (dxfPair == "TABLES")
            {
                return(ReadTables( ));
            }
            if (dxfPair == "BLOCKS")
            {
                return(ReadBlocks( ));
            }
            if (dxfPair == "ENTITIES")
            {
                return(ReadEntities( ));
            }
            if (dxfPair == "THUMBNAILIMAGE")
            {
                return(ReadTNI( ));
            }
            if (dxfPair == "OBJECTS")
            {
                return(ReadObjects( ));
            }

            return(false);
        }
示例#6
0
        private bool    ReadaEntity( )
        {
            if (dxfPair == "ENDSEC")
            {
                return(false);
            }

            if (dxfPair == "LINE")
            {
                current = new DXFObject(DXFUnitNative.LINE);
                EntityLog(dxfPair.Value, true);
                return(ReadLine(current));
            }

            if (dxfPair == "TEXT")
            {
                current = new DXFObject(DXFUnitNative.TEXT);
                EntityLog(dxfPair.Value, true);
                return(GetXYFromDXFEntity(current, true, true));
            }

            if (dxfPair == "POINT")
            {
                current = new DXFObject(DXFUnitNative.POINT);
                EntityLog(dxfPair.Value, true);
                return(GetXYFromDXFEntity(current, true, true));
            }

            if (dxfPair == "POLYLINE")
            {
                DXFFileReader.unitcount++;

                current = new DXFObject(DXFUnitNative.POLYLINE);
                EntityLog(dxfPair.Value, true);
                if (!GetXYFromDXFEntity(current, false, true))
                {
                    return(false);
                }

                for ( ;;)
                {
                    if (dxfPair == "VERTEX")
                    {
                        if (!GetXYFromDXFEntity(current, true, false))
                        {
                            break;
                        }
                        continue;
                    }
                    if (dxfPair == "SEQEND")
                    {
                        if (!GetXYFromDXFEntity(current, false, false))
                        {
                            break;
                        }
                        return(true);
                    }
                }
                return(true);
            }

            EntityLog("\n" + dxfPair.Value);
            dxfPair.Log(4);

            for ( ; dxfPair != null;)
            {
                dxfPair = new DXFPair(dxSourcefFile, this);
                if (dxfPair == null)
                {
                    return(true);
                }

//				if( dxfPair == 8 )
//					dxfPair.Log( 5 );

                if (dxfPair == 0)
                {
                    EntityLog("\n" + dxfPair.Value);
                    dxfPair.Log(4);
                    break;
                }
            }
            return(true);
        }