Example #1
0
 public GraphicElement2 GetGraphicElement2(
     ArgbColor color,
     DxfLineType lineType,
     double lineTypeScale,
     bool plinegen)
 {
     foreach (IGraphicElement graphicElement in this.list_0)
     {
         GraphicElement2 graphicElement2 = graphicElement as GraphicElement2;
         if (graphicElement2 != null && graphicElement2.Matches(color, lineType, lineTypeScale, plinegen))
         {
             return(graphicElement2);
         }
     }
     return((GraphicElement2)null);
 }
Example #2
0
        public bool AddExistingGraphicElement2(
            IGraphicElementBlock graphicElementBlock,
            DxfEntity entity,
            ArgbColor color,
            DxfLineType lineType,
            double lineTypeScale,
            bool plinegen)
        {
            bool flag = true;

            Graphics.EntityInfo entityInfo;
            if (this.dictionary_0.TryGetValue(entity, out entityInfo))
            {
                GraphicElement2 graphicElement2 = entityInfo.GetGraphicElement2(color, lineType, lineTypeScale, plinegen);
                if (graphicElement2 == null)
                {
                    graphicElement2 = new GraphicElement2(entityInfo.Geometry, color, lineType, lineTypeScale, plinegen);
                    entityInfo.GraphicElements.Add((IGraphicElement)graphicElement2);
                }
                graphicElementBlock.Add((IGraphicElement)graphicElement2);
                flag = false;
            }
            return(flag);
        }
Example #3
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);
            }