Esempio n. 1
0
 public GraphicElementInsert GetGraphicElementInsert(
     DxfLayer layer,
     EntityColor byBlockColor,
     DxfLineType byBlockLineType)
 {
     foreach (IGraphicElement graphicElement in this.list_0)
     {
         GraphicElementInsert graphicElementInsert = graphicElement as GraphicElementInsert;
         if (graphicElementInsert != null && graphicElementInsert.Matches(layer, byBlockColor, byBlockLineType))
         {
             return(graphicElementInsert);
         }
     }
     return((GraphicElementInsert)null);
 }
Esempio n. 2
0
        public bool GetGraphicElementInsert(
            IGraphicElementBlock graphicElementBlock,
            DxfEntity insert,
            DxfLayer layer,
            EntityColor byBlockColor,
            DxfLineType byBlockLineType,
            out GraphicElementInsert graphicElement)
        {
            Graphics.EntityInfo entityInfo;
            bool flag;

            if (this.dictionary_0.TryGetValue(insert, out entityInfo))
            {
                graphicElement = entityInfo.GetGraphicElementInsert(layer, byBlockColor, byBlockLineType);
                if (graphicElement == null)
                {
                    flag           = true;
                    graphicElement = new GraphicElementInsert();
                    entityInfo.GraphicElements.Add((IGraphicElement)graphicElement);
                }
                else
                {
                    flag = false;
                }
            }
            else
            {
                graphicElement = new GraphicElementInsert();
                this.dictionary_0.Add(insert, new Graphics.EntityInfo()
                {
                    GraphicElements =
                    {
                        (IGraphicElement)graphicElement
                    }
                });
                flag = true;
            }
            graphicElementBlock.Add((IGraphicElement)graphicElement);
            return(flag);
        }
Esempio n. 3
0
            public void Visit(GraphicElementInsert visitee)
            {
                ProcessedGraphicElementBlock second = (ProcessedGraphicElementBlock)null;
                Matrix4D matrix4D = ProcessedGraphics.smethod_1(visitee.InsertCells[0, 0].Transform);

                ProcessedGraphics.Class734 class734;
                if (this.processedGraphics_0.dictionary_2.TryGetValue(visitee.UnclippedBlock, out class734))
                {
                    second = class734.method_0(matrix4D);
                }
                bool flag;

                if (!(flag = second != null))
                {
                    second = new ProcessedGraphicElementBlock(visitee.UnclippedBlock.Transform);
                }
                if (class734 == null)
                {
                    class734 = new ProcessedGraphics.Class734();
                    this.processedGraphics_0.dictionary_2.Add(visitee.UnclippedBlock, class734);
                }
                class734.Blocks.Add(new Pair <Matrix4D, ProcessedGraphicElementBlock>(matrix4D, second));
                ProcessedGraphicElementInsert graphicElementInsert = new ProcessedGraphicElementInsert()
                {
                    UnclippedBlock = second
                };

                if (!flag)
                {
                    GraphicElementInsert.InsertCell insertCell = visitee.InsertCells[0, 0];
                    ProcessedGraphics.Class731      class731   = new ProcessedGraphics.Class731(this.processedGraphics_0, this.graphicsConfig_0, graphicElementInsert.UnclippedBlock, this.matrix4D_0 * insertCell.Transform);
                    foreach (IGraphicElement graphicElement in visitee.UnclippedBlock.GraphicElements)
                    {
                        graphicElement.Accept((IGraphicElementVisitor)class731);
                    }
                }
                int length1 = visitee.InsertCells.GetLength(0);
                int length2 = visitee.InsertCells.GetLength(1);

                graphicElementInsert.InsertCells = new ProcessedGraphicElementInsert.InsertCell[length1, length2];
                for (int index1 = 0; index1 < length1; ++index1)
                {
                    for (int index2 = 0; index2 < length2; ++index2)
                    {
                        GraphicElementInsert.InsertCell insertCell = visitee.InsertCells[index1, index2];
                        graphicElementInsert.InsertCells[index1, index2] = new ProcessedGraphicElementInsert.InsertCell(insertCell.Transform)
                        {
                            ClippedBlock = graphicElementInsert.UnclippedBlock
                        };
                    }
                }
                if (visitee.AttributeBlock != null)
                {
                    ProcessedGraphicElementBlock graphicElementBlock;
                    if (this.processedGraphics_0.dictionary_1.TryGetValue(visitee.AttributeBlock, out graphicElementBlock))
                    {
                        graphicElementInsert.AttributeBlock = graphicElementBlock;
                    }
                    else
                    {
                        graphicElementInsert.AttributeBlock = new ProcessedGraphicElementBlock(visitee.AttributeBlock.Transform);
                        foreach (IGraphicElement graphicElement in visitee.AttributeBlock.GraphicElements)
                        {
                            GraphicElement1 graphicElement1 = graphicElement as GraphicElement1;
                            if (graphicElement1 != null)
                            {
                                graphicElementInsert.AttributeBlock.GraphicElements.Add(graphicElement1);
                            }
                        }
                        this.processedGraphics_0.dictionary_1.Add(visitee.AttributeBlock, graphicElementBlock);
                    }
                    graphicElementInsert.AttributeBlockCells = visitee.AttributeBlockCells;
                }
                this.processedGraphicElementBlock_0.Inserts.Add(graphicElementInsert);
            }