Exemplo n.º 1
0
 public void DeferAddEntityExecution(DXFLayer _lay)
 {
     if (_lay != null)
     {
         this.for_deferred_AdEntity_execution.Add(_lay);
     }
 }
Exemplo n.º 2
0
        public DXFLayer RetrieveLayer(string _name)
        {
            DXFLayer result = null;

            if (_name == null)
            {
                return(null);
            }

            string queryName = _name.ToLower();

            foreach (var layer in this.FLayers.ecEntities)
            {
                string layerName = layer.EntName.ToLower();
                if (queryName.Equals(layerName))
                {
                    DXFLayer dxf_layer = layer as DXFLayer;
                    result = dxf_layer;
                    break;
                }
            }

            // in case the posLayer could not be found
            if (result == null)
            {
                result = new DXFLayer(_name);
                this.FLayers.AddEntity(result);
            }

            return(result);
        }
Exemplo n.º 3
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // ====================================== GEOMETRY CONVERSION METHODS ===================================== //
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public List <DXFLayer> GetLayers()
        {
            List <DXFLayer> layers = new List <DXFLayer>();

            if (this.FLayers == null)
            {
                return(layers);
            }

            int n = this.FLayers.ecEntities.Count;

            for (int i = 0; i < n; i++)
            {
                DXFEntity e     = this.FLayers.ecEntities[i];
                DXFLayer  layer = e as DXFLayer;
                if (layer != null)
                {
                    layers.Add(layer);
                }
            }

            return(layers);
        }
Exemplo n.º 4
0
        public DXFEntity CreateEntity(string _name_prefix = "")
        {
            DXFEntity E;

            switch (this.FValue)
            {
            case DXFUtils.SECTION_END:
            case DXFUtils.SEQUENCE_END:
                this.PositionToOutputWindow("Decoder NULL");
                return(null);

            case DXFUtils.SECTION_START:
                E = new DXFSection();
                this.PositionToOutputWindow("Decoder DXFSection");
                break;

            case DXFUtils.ENTITY_SEQUENCE:
                E = new DXFHierarchicalContainer("of " + _name_prefix);     // helper for ENTITIES containing hierarchical structures (e.g. Layer)
                this.PositionToOutputWindow("Decoder DXFHierarchicalContainer");
                break;

            case DXFUtils.ENTITY_CONTINUE:
                E = new DXFContinue();     // helper for ENTITIES containing hierarchical structures (e.g. Layer)
                this.PositionToOutputWindow("Decoder DXFContinue");
                break;

            case DXFUtils.GV_LAYER:
                E = new DXFLayer();
                this.PositionToOutputWindow("Decoder DXFLayer");
                break;

            case DXFUtils.GV_ZONEDPOLY:
                E = new DXFZonedPolygon();
                this.PositionToOutputWindow("Decoder DXFZonedPolygon");
                break;

            case DXFUtils.GV_ZONEDPOLY_OPENING:
                E = new DXFZoneOpening();
                this.PositionToOutputWindow("Decoder DXFZoneOpening");
                break;

            case DXFUtils.GV_ZONEDLEVEL:
                E = new DXFZonedPolygonGroup();
                this.PositionToOutputWindow("Decoder DXFZonedPolygonGroup");
                break;

            case DXFUtils.GV_ZONEDVOL:
                E = new DXFZonedVolume();
                this.PositionToOutputWindow("Decoder DXFZonedVolume");
                break;

            case DXFUtils.GV_MATERIAL:
                E = new DXFMaterial();
                this.PositionToOutputWindow("Decoder DXFMaterial");
                break;

            default:
                E = new DXFDummy(this.FValue);
                this.PositionToOutputWindow("Decoder DXFDummy");
                break;
            }
            E.Decoder = this;
            return(E);
        }
Exemplo n.º 5
0
        public DXFEntity CreateEntity()
        {
            DXFEntity E;

            switch (this.FValue)
            {
            case "ENDSEC":
            case "ENDTAB":
            case "ENDBLK":
            case "SEQEND":
                return(null);

            case "SECTION":
                E = new DXFSection();
                break;

            case "TABLE":
                E = new DXFTable();
                break;

            case "BLOCK":
                E = new DXFBlock();
                break;

            case "ATTDEF":
            case "ATTRIB":
                E = new DXFAttribute();
                break;

            case "INSERT":
                E = new DXFInsert();
                break;

            case "LAYER":
                E = new DXFLayer();
                break;

            case "LINE":
                E = new DXFLine();
                break;

            case "CIRCLE":
            case "ARC":
                E = new DXFCircle();
                break;

            case "ELLIPSE":
                E = new DXFEllipse();
                break;

            case "LWPOLYLINE":
                E = new DXFLWPolyLine();
                break;

            case "TEXT":
                E = new DXFText();
                break;

            case "MTEXT":
                E = new DXFMText();
                break;

            case "POLYLINE":
                E = new DXFPolyLine();
                break;

            case "VERTEX":
                E = new DXFPositionable();
                break;

            default:
                E = new DXFDummy(this.FValue);
                break;
            }
            E.Converter = this;
            return(E);
        }