Beispiel #1
0
        internal static DxfObject FromBuffer(DxfCodePairBufferReader buffer)
        {
            var first = buffer.Peek();

            buffer.Advance();
            DxfObject obj;

            switch (first.StringValue)
            {
            case "ACAD_PROXY_OBJECT":
                obj = new DxfAcadProxyObject();
                break;

            case "ACDBDICTIONARYWDFLT":
                obj = new DxfDictionaryWithDefault();
                break;

            case "ACDBPLACEHOLDER":
                obj = new DxfPlaceHolder();
                break;

            case "DATATABLE":
                obj = new DxfDataTable();
                break;

            case "DICTIONARY":
                obj = new DxfDictionary();
                break;

            case "DICTIONARYVAR":
                obj = new DxfDictionaryVariable();
                break;

            case "DIMASSOC":
                obj = new DxfDimensionAssociativity();
                break;

            case "FIELD":
                obj = new DxfField();
                break;

            case "GEODATA":
                obj = new DxfGeoData();
                break;

            case "GROUP":
                obj = new DxfGroup();
                break;

            case "IDBUFFER":
                obj = new DxfIdBuffer();
                break;

            case "IMAGEDEF":
                obj = new DxfImageDefinition();
                break;

            case "IMAGEDEF_REACTOR":
                obj = new DxfImageDefinitionReactor();
                break;

            case "LAYER_FILTER":
                obj = new DxfLayerFilter();
                break;

            case "LAYER_INDEX":
                obj = new DxfLayerIndex();
                break;

            case "LAYOUT":
                obj = new DxfLayout();
                break;

            case "LIGHTLIST":
                obj = new DxfLightList();
                break;

            case "MATERIAL":
                obj = new DxfMaterial();
                break;

            case "MLEADERSTYLE":
                obj = new DxfMLeaderStyle();
                break;

            case "MLINESTYLE":
                obj = new DxfMLineStyle();
                break;

            case "OBJECT_PTR":
                obj = new DxfObjectPointer();
                break;

            case "PLOTSETTINGS":
                obj = new DxfPlotSettings();
                break;

            case "RASTERVARIABLES":
                obj = new DxfRasterVariables();
                break;

            case "MENTALRAYRENDERSETTINGS":
                obj = new DxfMentalRayRenderSettings();
                break;

            case "RENDERENVIRONMENT":
                obj = new DxfRenderEnvironment();
                break;

            case "RENDERGLOBAL":
                obj = new DxfRenderGlobal();
                break;

            case "SECTIONMANAGER":
                obj = new DxfSectionManager();
                break;

            case "SECTIONSETTINGS":
                obj = new DxfSectionSettings();
                break;

            case "SORTENTSTABLE":
                obj = new DxfSortentsTable();
                break;

            case "SPATIAL_FILTER":
                obj = new DxfSpatialFilter();
                break;

            case "SPATIAL_INDEX":
                obj = new DxfSpatialIndex();
                break;

            case "SUNSTUDY":
                obj = new DxfSunStudy();
                break;

            case "TABLESTYLE":
                obj = new DxfTableStyle();
                break;

            case "UNDERLAYDEFINITION":
                obj = new DxfUnderlayDefinition();
                break;

            case "VBA_PROJECT":
                obj = new DxfVbaProject();
                break;

            case "VISUALSTYLE":
                obj = new DxfVisualStyle();
                break;

            case "WIPEOUTVARIABLES":
                obj = new DxfWipeoutVariables();
                break;

            case "XRECORD":
                obj = new DxfXRecordObject();
                break;

            default:
                SwallowObject(buffer);
                obj = null;
                break;
            }

            if (obj != null)
            {
                obj = obj.PopulateFromBuffer(buffer);
            }

            return(obj);
        }
Beispiel #2
0
 public void WriteLightListTest()
 {
     var lightList = new DxfLightList();
     lightList.Version = 42;
     lightList.Lights.Add(new DxfLightList.DxfLightListItem() { Handle = 0x111, Name = "uno" });
     lightList.Lights.Add(new DxfLightList.DxfLightListItem() { Handle = 0x222, Name = "dos" });
     lightList.Lights.Add(new DxfLightList.DxfLightListItem() { Handle = 0x333, Name = "tres" });
     var file = new DxfFile();
     file.Objects.Add(lightList);
     VerifyFileContains(file, @"
      90
     42
      90
     3
       5
     111
       1
     uno
       5
     222
       1
     dos
       5
     333
       1
     tres
     ");
 }