Esempio n. 1
0
 public GraphicElement1 GetGraphicElement1(ArgbColor color)
 {
     foreach (IGraphicElement graphicElement in this.list_0)
     {
         GraphicElement1 graphicElement1 = graphicElement as GraphicElement1;
         if (graphicElement1 != null && graphicElement1.Matches(color))
         {
             return(graphicElement1);
         }
     }
     return((GraphicElement1)null);
 }
Esempio n. 2
0
            public GraphicElement1 method_0(Matrix4D toPwcsTransform)
            {
                GraphicElement1 graphicElement1 = (GraphicElement1)null;

                foreach (Pair <Matrix4D, GraphicElement1> pair in this.list_0)
                {
                    if (Matrix4D.AreApproxEqual(pair.First, toPwcsTransform))
                    {
                        graphicElement1 = pair.Second;
                        break;
                    }
                }
                return(graphicElement1);
            }
Esempio n. 3
0
 public void AddNewGraphicElement(
     DxfEntity entity,
     IGraphicElementBlock graphicElementBlock,
     GraphicElement1 graphicElement)
 {
     if (graphicElement.Geometry == null)
     {
         throw new Exception();
     }
     Graphics.EntityInfo entityInfo = new Graphics.EntityInfo()
     {
         Geometry = graphicElement.Geometry
     };
     entityInfo.GraphicElements.Add((IGraphicElement)graphicElement);
     this.dictionary_0.Add(entity, entityInfo);
     graphicElementBlock.Add((IGraphicElement)graphicElement);
 }
Esempio n. 4
0
 public Class732(
     GraphicsConfig graphicsConfig,
     GraphicElement1 graphicElementWithoutLineType,
     GraphicElement1 graphicElementWithLineType,
     Matrix4D toPseudoWcsTransform,
     DxfLineType lineType,
     double lineTypeScale,
     bool plinegen)
 {
     this.graphicsConfig_0  = graphicsConfig;
     this.graphicElement1_0 = graphicElementWithoutLineType;
     this.graphicElement1_1 = graphicElementWithLineType;
     this.matrix4D_0        = toPseudoWcsTransform;
     this.dxfLineType_0     = lineType;
     this.double_0          = lineTypeScale;
     this.bool_0            = plinegen;
 }
Esempio n. 5
0
        public bool AddExistingGraphicElement1(
            IGraphicElementBlock graphicElementBlock,
            DxfEntity entity,
            ArgbColor color)
        {
            bool flag = true;

            Graphics.EntityInfo entityInfo;
            if (this.dictionary_0.TryGetValue(entity, out entityInfo))
            {
                GraphicElement1 graphicElement1 = entityInfo.GetGraphicElement1(color);
                if (graphicElement1 == null)
                {
                    graphicElement1 = new GraphicElement1(entityInfo.Geometry, color);
                    entityInfo.GraphicElements.Add((IGraphicElement)graphicElement1);
                }
                graphicElementBlock.Add((IGraphicElement)graphicElement1);
                flag = false;
            }
            return(flag);
        }
Esempio n. 6
0
            public void Visit(GraphicElement2 visitee)
            {
                GraphicElement1 graphicElement1_1 = (GraphicElement1)null;
                GraphicElement1 graphicElement1_2 = (GraphicElement1)null;

                ProcessedGraphics.Class733 class733_1;
                if (this.processedGraphics_0.dictionary_0.TryGetValue(visitee, out class733_1))
                {
                    graphicElement1_1 = class733_1.GraphicElementWithoutLineType;
                    graphicElement1_2 = class733_1.method_0(this.matrix4D_1);
                }
                if (ProcessedGraphics.smethod_0(visitee.LineType))
                {
                    if (graphicElement1_1 == null)
                    {
                        graphicElement1_1 = (GraphicElement1)visitee;
                        ProcessedGraphics.Class733 class733_2 = new ProcessedGraphics.Class733()
                        {
                            GraphicElementWithoutLineType = graphicElement1_1
                        };
                        this.processedGraphics_0.dictionary_0.Add(visitee, class733_2);
                    }
                }
                else
                {
                    if (graphicElement1_2 == null)
                    {
                        GraphicElement1 graphicElementWithoutLineType = (GraphicElement1)null;
                        if (graphicElement1_1 == null)
                        {
                            graphicElementWithoutLineType = new GraphicElement1(new WW.Cad.Drawing.Surface.Geometry(), visitee.Color);
                            if (visitee.Geometry.HasExtrusion)
                            {
                                graphicElementWithoutLineType.Geometry.Extrusion = visitee.Geometry.Extrusion;
                            }
                        }
                        graphicElement1_2 = new GraphicElement1(new WW.Cad.Drawing.Surface.Geometry(), visitee.Color);
                        if (visitee.Geometry.HasExtrusion)
                        {
                            graphicElement1_2.Geometry.Extrusion = visitee.Geometry.Extrusion;
                        }
                        ProcessedGraphics.Class731.Class732 class732 = new ProcessedGraphics.Class731.Class732(this.graphicsConfig_0, graphicElementWithoutLineType, graphicElement1_2, this.matrix4D_1, visitee.LineType, visitee.LineTypeScale, visitee.Plinegen);
                        foreach (IPrimitive primitive in (List <IPrimitive>)visitee.Geometry)
                        {
                            primitive.Accept((IPrimitiveVisitor)class732);
                        }
                        if (graphicElement1_1 == null)
                        {
                            graphicElement1_1 = graphicElementWithoutLineType;
                        }
                    }
                    if (class733_1 == null)
                    {
                        class733_1 = new ProcessedGraphics.Class733()
                        {
                            GraphicElementWithoutLineType = graphicElement1_1
                        };
                        this.processedGraphics_0.dictionary_0.Add(visitee, class733_1);
                    }
                    class733_1.GraphicElementsWithLineType.Add(new Pair <Matrix4D, GraphicElement1>(this.matrix4D_1, graphicElement1_2));
                }
                if (graphicElement1_1 != null && graphicElement1_1.Geometry.Count > 0)
                {
                    this.processedGraphicElementBlock_0.GraphicElements.Add(graphicElement1_1);
                }
                if (graphicElement1_2 == null || graphicElement1_2.Geometry.Count <= 0)
                {
                    return;
                }
                this.processedGraphicElementBlock_0.GraphicElements.Add(graphicElement1_2);
            }
Esempio n. 7
0
 public void Visit(GraphicElement1 visitee)
 {
     this.processedGraphicElementBlock_0.GraphicElements.Add(visitee);
 }
Esempio n. 8
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);
            }