Beispiel #1
0
        public void GetBounds(
            DxfModel model,
            DxfLayout layout,
            ICollection <DxfViewport> viewports,
            Matrix4D postTransform)
        {
            if (viewports == null)
            {
                viewports = (ICollection <DxfViewport>)layout.Viewports;
            }
            IWireframeGraphicsFactory graphicsFactory = this.CreateGraphicsFactory();

            using (DrawContext.Wireframe.PaperToPaperSpace paperToPaperSpace = new DrawContext.Wireframe.PaperToPaperSpace(layout.Model, layout, this.graphicsConfig_0, postTransform))
            {
                foreach (DxfEntity entity in (DxfHandledObjectCollection <DxfEntity>)layout.Entities)
                {
                    entity.Draw((DrawContext.Wireframe)paperToPaperSpace, graphicsFactory);
                }
                layout.DrawFrame((DrawContext.Wireframe)paperToPaperSpace, graphicsFactory);
            }
            foreach (DxfViewport viewport in (IEnumerable <DxfViewport>)viewports)
            {
                if (viewport.ModelSpaceVisible)
                {
                    using (DrawContext.Wireframe.ModelToPaperSpace modelToPaperSpace = new DrawContext.Wireframe.ModelToPaperSpace(layout.Model, layout, this.graphicsConfig_0, viewport, postTransform))
                    {
                        foreach (DxfEntity entity in (DxfHandledObjectCollection <DxfEntity>)model.Entities)
                        {
                            entity.Draw((DrawContext.Wireframe)modelToPaperSpace, graphicsFactory);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            DxfTextStyle textStyle = this.TextStyle;

            if (textStyle == null)
            {
                return;
            }
            ShxFile shxFile = textStyle.GetShxFile();

            if (shxFile == null)
            {
                return;
            }
            ShxShape shapeByIndex = shxFile.GetShapeByIndex(this.ushort_0);

            if (shapeByIndex == null)
            {
                return;
            }
            WW.Math.Point2D endPoint;
            new ns0.Class0((DxfEntity)this, context, graphicsFactory).DrawPath(shapeByIndex.GetGlyphShape(false, out endPoint), this.Transform, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), false, false, this.double_1);
        }
Beispiel #3
0
 public static void CreateDrawables(
     IWireframeGraphicsFactory graphicsFactory,
     GraphicsConfig graphicsConfig,
     DxfModel model,
     DxfLayout layout,
     ICollection <DxfViewport> viewports)
 {
     if (layout.PaperSpace)
     {
         if (viewports == null)
         {
             viewports = (ICollection <DxfViewport>)layout.Viewports;
         }
         bool flag;
         if (flag = (layout.PlotLayoutFlags & PlotLayoutFlags.DrawViewportsFirst) != PlotLayoutFlags.None)
         {
             WireframeGraphicsFactoryUtil.smethod_0(graphicsFactory, graphicsConfig, model, layout, viewports);
         }
         using (DrawContext.Wireframe.PaperToPaperSpace paperToPaperSpace = new DrawContext.Wireframe.PaperToPaperSpace(model, layout, graphicsConfig, Matrix4D.Identity))
             layout.Draw((DrawContext.Wireframe)paperToPaperSpace, graphicsFactory);
         if (flag)
         {
             return;
         }
         WireframeGraphicsFactoryUtil.smethod_0(graphicsFactory, graphicsConfig, model, layout, viewports);
     }
     else
     {
         WireframeGraphicsFactoryUtil.CreateDrawables(graphicsFactory, graphicsConfig, model, Matrix4D.Identity);
     }
 }
Beispiel #4
0
 public void DrawFrame(DrawContext.Wireframe context, IWireframeGraphicsFactory graphicsFactory)
 {
     foreach (DxfEntity dxfEntity in (DxfHandledObjectCollection <DxfViewport>) this.dxfViewportCollection_0)
     {
         dxfEntity.Draw(context, graphicsFactory);
     }
 }
Beispiel #5
0
        public static void CreateDrawables(
            IWireframeGraphicsFactory graphicsFactory,
            GraphicsConfig graphicsConfig,
            DxfModel model,
            IList <DxfEntity> modelSpaceEntities,
            IList <DxfEntity> paperSpaceEntities,
            DxfLayout layout,
            ICollection <DxfViewport> viewports)
        {
            if (viewports == null)
            {
                viewports = (ICollection <DxfViewport>)layout.Viewports;
            }
            bool flag;

            if (flag = (layout.PlotLayoutFlags & PlotLayoutFlags.DrawViewportsFirst) != PlotLayoutFlags.None)
            {
                WireframeGraphicsFactoryUtil.smethod_1(graphicsFactory, graphicsConfig, model, modelSpaceEntities, layout, viewports);
            }
            using (DrawContext.Wireframe.PaperToPaperSpace paperToPaperSpace = new DrawContext.Wireframe.PaperToPaperSpace(model, layout, graphicsConfig, Matrix4D.Identity))
            {
                foreach (DxfEntity paperSpaceEntity in (IEnumerable <DxfEntity>)paperSpaceEntities)
                {
                    paperSpaceEntity.Draw((DrawContext.Wireframe)paperToPaperSpace, graphicsFactory);
                }
            }
            if (flag)
            {
                return;
            }
            WireframeGraphicsFactoryUtil.smethod_1(graphicsFactory, graphicsConfig, model, modelSpaceEntities, layout, viewports);
        }
Beispiel #6
0
 public WireframeGraphicsFactoryColorChanger(
     IWireframeGraphicsFactory graphicsFactory,
     Func <ArgbColor, ArgbColor> colorChanger)
 {
     this.iwireframeGraphicsFactory_0 = graphicsFactory;
     this.func_0 = colorChanger;
 }
Beispiel #7
0
 public void Draw(IWireframeGraphicsFactory graphicsFactory)
 {
     foreach (IWireframeDrawable wireframeDrawable in this.linkedList_0)
     {
         wireframeDrawable.Draw(graphicsFactory);
     }
 }
Beispiel #8
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            IList <Polyline4D>  polylines4D;
            IList <FlatShape4D> shapes;
            bool fill;

            this.GetPolylines4D((DrawContext)context, context.GetTransformer(), out polylines4D, out shapes, out fill);
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (polylines4D.Count > 0)
            {
                graphicsFactory.CreatePath((DxfEntity)this, context, plotColor, false, polylines4D, fill, true);
            }
            if (shapes == null)
            {
                return;
            }
            IPathDrawer pathDrawer = (IPathDrawer) new ns0.Class0((DxfEntity)this, context, graphicsFactory);

            foreach (FlatShape4D flatShape4D in (IEnumerable <FlatShape4D>)shapes)
            {
                pathDrawer.DrawPath(flatShape4D.FlatShape, flatShape4D.Transformation, this.Color.ToColor(), (short)0, flatShape4D.IsFilled, false, this.Thickness);
            }
        }
Beispiel #9
0
        public void UpdateDrawables(
            DxfEntity entity,
            System.Action <DrawContext.Wireframe, IWireframeGraphicsFactory> updateDrawables,
            Func <IWireframeGraphicsFactory, IWireframeGraphicsFactory> graphicsFactoryWrapper)
        {
            if (!this.bool_1)
            {
                throw new Exception("Property AreDrawablesUpdateable is false.");
            }
            List <GDIGraphics3D.Class941> class941List;

            if (!this.dictionary_0.TryGetValue(entity, out class941List))
            {
                return;
            }
            GDIGraphics3D.Class941[]  array                    = class941List.ToArray();
            GDIGraphics3D.Class942    graphicsFactory          = (GDIGraphics3D.Class942) this.CreateGraphicsFactory();
            IWireframeGraphicsFactory wireframeGraphicsFactory = (IWireframeGraphicsFactory)graphicsFactory;

            if (graphicsFactoryWrapper != null)
            {
                wireframeGraphicsFactory = graphicsFactoryWrapper((IWireframeGraphicsFactory)graphicsFactory);
            }
            foreach (GDIGraphics3D.Class941 entityDrawablesInfo in array)
            {
                graphicsFactory.CurrentlyInTextMode = new bool?();
                this.RemoveDrawables(entityDrawablesInfo, true);
                graphicsFactory.CurrentColoredDrawableNode     = new LinkedListNodeRef <Interface12>(entityDrawablesInfo.EntityDrawableNode.List, entityDrawablesInfo.EntityDrawableNode);
                graphicsFactory.CurrentTextColoredDrawableNode = new LinkedListNodeRef <Interface12>(entityDrawablesInfo.TextEntityDrawableNode.List, entityDrawablesInfo.TextEntityDrawableNode);
                graphicsFactory.CurrentEntityDrawablesInfo     = entityDrawablesInfo.Parent;
                graphicsFactory.ExistingEntityDrawablesInfo    = entityDrawablesInfo;
                updateDrawables(entityDrawablesInfo.DrawContext, wireframeGraphicsFactory);
            }
        }
Beispiel #10
0
 public void Draw(DrawContext.Wireframe context, IWireframeGraphicsFactory graphicsFactory)
 {
     foreach (DxfEntity dxfEntity in this.GetEntitiesInDrawingOrder(context.Config))
     {
         dxfEntity.Draw(context, graphicsFactory);
     }
     this.DrawFrame(context, graphicsFactory);
 }
Beispiel #11
0
 public override void DrawInternal(
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory graphicsFactory)
 {
     graphicsFactory.BeginInsert(this);
     this.DrawInternal((DxfInsert.Interface46) new DxfInsert.Class1019((DxfEntity)this, context, graphicsFactory), true);
     graphicsFactory.EndInsert();
 }
Beispiel #12
0
 public void GetBounds(DxfModel model, DxfEntity entity, Matrix4D modelTransform)
 {
     using (DrawContext.Wireframe context = (DrawContext.Wireframe) new DrawContext.Wireframe.ModelSpace(model, this.graphicsConfig_0, modelTransform))
     {
         IWireframeGraphicsFactory graphicsFactory = this.CreateGraphicsFactory();
         entity.Draw(context, graphicsFactory);
     }
 }
Beispiel #13
0
 public Class1019(
     DxfEntity insert,
     DrawContext.Wireframe drawContext,
     IWireframeGraphicsFactory graphicsFactory)
 {
     this.dxfEntity_0 = insert;
     this.wireframe_0 = drawContext;
     this.iwireframeGraphicsFactory_0 = graphicsFactory;
 }
Beispiel #14
0
 public static void CreateDrawables(
     IWireframeGraphicsFactory graphicsFactory,
     GraphicsConfig graphicsConfig,
     DxfModel model,
     Matrix4D modelTransform)
 {
     using (DrawContext.Wireframe context = (DrawContext.Wireframe) new DrawContext.Wireframe.ModelSpace(model, graphicsConfig, modelTransform))
         model.Draw(context, graphicsFactory);
 }
Beispiel #15
0
 public override void DrawInternal(
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory graphicsFactory)
 {
     foreach (Segment4D segment in (IEnumerable <Segment4D>)context.GetTransformer().Transform(new Segment3D(this.point3D_0, this.point3D_0 + 10000000.0 * this.vector3D_0)))
     {
         graphicsFactory.CreateRay((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), segment);
     }
 }
Beispiel #16
0
 public Class0(
     DxfEntity entity,
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory graphicsFactory)
 {
     this.dxfEntity_0 = entity;
     this.wireframe_0 = context;
     this.iwireframeGraphicsFactory_0 = graphicsFactory;
 }
Beispiel #17
0
 public void Draw(DrawContext.Wireframe context, IWireframeGraphicsFactory graphicsFactory)
 {
     graphicsFactory.BeginEntity(this, context);
     if (this.IsEntityVisibleInContext((DrawContext)context, this.UseLayerEnabled))
     {
         this.DrawInternal(context, graphicsFactory);
     }
     graphicsFactory.EndEntity();
 }
Beispiel #18
0
 public void Draw(IWireframeGraphicsFactory graphicsFactory)
 {
     graphicsFactory.BeginEntity(this.dxfEntity_0, this.wireframe_0);
     for (LinkedListNode <IWireframeDrawable> linkedListNode = this.linkedList_0.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
     {
         linkedListNode.Value.Draw(graphicsFactory);
     }
     graphicsFactory.EndEntity();
 }
Beispiel #19
0
 public override void DrawInternal(
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory graphicsFactory)
 {
     if (this.proxyGraphics_0 == null)
     {
         return;
     }
     this.proxyGraphics_0.Draw((DxfEntity)this, context.CreateChildContext((DxfEntity)this, Matrix4D.Identity), graphicsFactory);
 }
Beispiel #20
0
 public void Draw(DrawContext drawContext, IWireframeGraphicsFactory graphicsFactory)
 {
     foreach (WireframeGraphicsCache.Class958 class958 in this.list_0)
     {
         if (drawContext.HaveSameBlockContextChain((DrawContext)class958.DrawContext) && class958.EntityDrawable != null)
         {
             class958.EntityDrawable.Draw(graphicsFactory);
         }
     }
 }
Beispiel #21
0
 public override void DrawInternal(
     DrawContext.Wireframe context,
     IWireframeGraphicsFactory graphicsFactory)
 {
     if (!this.method_17((DrawContext)context))
     {
         return;
     }
     base.DrawInternal(context, graphicsFactory);
 }
Beispiel #22
0
 public void GetBounds(DxfModel model, Matrix4D modelTransform)
 {
     using (DrawContext.Wireframe context = (DrawContext.Wireframe) new DrawContext.Wireframe.ModelSpace(model, this.graphicsConfig_0, modelTransform))
     {
         IWireframeGraphicsFactory graphicsFactory = this.CreateGraphicsFactory();
         foreach (DxfEntity entity in (DxfHandledObjectCollection <DxfEntity>)model.Entities)
         {
             entity.Draw(context, graphicsFactory);
         }
     }
 }
Beispiel #23
0
 public void GetBounds(DxfModel model, IEnumerable <DxfEntity> entities, Matrix4D modelTransform)
 {
     using (DrawContext.Wireframe context = (DrawContext.Wireframe) new DrawContext.Wireframe.ModelSpace(model, this.graphicsConfig_0, modelTransform))
     {
         IWireframeGraphicsFactory graphicsFactory = this.CreateGraphicsFactory();
         foreach (DxfEntity entity in entities)
         {
             entity.Draw(context, graphicsFactory);
         }
     }
 }
Beispiel #24
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            IList <Polyline4D> polylines4D = this.GetPolylines4D(context.GetTransformer());

            if (polylines4D.Count <= 0)
            {
                return;
            }
            graphicsFactory.CreatePath((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), false, polylines4D, context.Model.Header.FillMode && this.vector3D_0.X == 0.0 && this.vector3D_0.Y == 0.0, true);
        }
Beispiel #25
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            Polyline3DT          imageBoundaryPolyline;
            IClippingTransformer transformer;
            IList <Polyline4D>   polylines1 = this.method_16(context, out imageBoundaryPolyline, out transformer);

            if (polylines1.Count <= 0)
            {
                return;
            }
            graphicsFactory.CreatePath((DxfEntity)this, context, context.Config.BackColor, false, polylines1, true, false);
            IList <FlatShape4D> flatShape4DList = (IList <FlatShape4D>)null;

            if (!context.WipeoutVariables.DisplayFrame)
            {
                return;
            }
            IList <WW.Math.Geometry.Polyline3D> polyline3DList;

            if (context.Config.ApplyLineType)
            {
                IList <FlatShape4D> resultShapes = (IList <FlatShape4D>) new List <FlatShape4D>();
                polyline3DList = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>();
                Vector3D upward = Vector3D.CrossProduct(this.XAxis, this.YAxis);
                if (upward == Vector3D.Zero)
                {
                    upward = Vector3D.ZAxis;
                }
                else
                {
                    upward.Normalize();
                }
                DxfUtil.smethod_11(context.Config, polyline3DList, resultShapes, imageBoundaryPolyline, this.GetLineType((DrawContext)context), upward, context.TotalLineTypeScale * this.LineTypeScale, context.GetTransformer().LineTypeScaler);
                if (resultShapes.Count == 0)
                {
                    flatShape4DList = (IList <FlatShape4D>)null;
                }
            }
            else
            {
                polyline3DList = (IList <WW.Math.Geometry.Polyline3D>) new WW.Math.Geometry.Polyline3D[1]
                {
                    imageBoundaryPolyline.ToPolyline3D()
                };
                flatShape4DList = (IList <FlatShape4D>)null;
            }
            IList <Polyline4D> polylines2 = DxfUtil.smethod_36(polyline3DList, false, transformer);

            graphicsFactory.CreatePath((DxfEntity)this, context, this.GetColor((DrawContext)context), false, polylines2, false, true);
        }
Beispiel #26
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            IList <Polyline4D> polylines4D;
            bool fill;

            this.GetPolylines4D(context.GetTransformer(), out polylines4D, out fill);
            if (polylines4D.Count <= 0)
            {
                return;
            }
            graphicsFactory.CreatePath((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), false, polylines4D, fill, true);
        }
Beispiel #27
0
 public static void CreateDrawables(
     IWireframeGraphicsFactory graphicsFactory,
     GraphicsConfig graphicsConfig,
     DxfModel model,
     IList <DxfEntity> entities,
     Matrix4D modelTransform)
 {
     using (DrawContext.Wireframe context = (DrawContext.Wireframe) new DrawContext.Wireframe.ModelSpace(model, graphicsConfig, modelTransform))
     {
         foreach (DxfEntity entity in (IEnumerable <DxfEntity>)entities)
         {
             entity.Draw(context, graphicsFactory);
         }
     }
 }
Beispiel #28
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            IClippingTransformer transformer = context.GetTransformer();
            Vector3D             vector3D    = 10000000.0 * this.vector3D_0;

            WW.Math.Point3D start = this.point3D_0 - vector3D;
            WW.Math.Point3D end   = this.point3D_0 + vector3D;
            foreach (Segment4D segment in (IEnumerable <Segment4D>)transformer.Transform(new Segment3D(start, end)))
            {
                Vector4D?startPoint = transformer.Transform(this.point3D_0);
                graphicsFactory.CreateXLine((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), startPoint, segment);
            }
        }
Beispiel #29
0
        public void DrawPath(
            IShape2D path,
            Matrix4D transform,
            Color color,
            short lineWeight,
            bool filled,
            bool forText,
            double extrusion)
        {
            if (!path.HasSegments)
            {
                return;
            }
            IClippingTransformer transformer = (IClippingTransformer)this.wireframe_0.GetTransformer().Clone();

            transformer.SetPreTransform(transform);
            IWireframeGraphicsFactory graphicsFactory0 = this.iwireframeGraphicsFactory_0;

            if (extrusion == 0.0)
            {
                IShape4D shape1 = (IShape4D) new FlatShape4D((IShape2D)(path as GeneralShape2D ?? new GeneralShape2D(path, true)), filled);
                IShape4D shape2 = transformer.Transform(shape1);
                if (shape2.IsEmpty)
                {
                    return;
                }
                graphicsFactory0.CreateShape(this.dxfEntity_0, this.wireframe_0, this.wireframe_0.GetPlotColor(this.dxfEntity_0, color), forText, shape2);
            }
            else
            {
                IList <Polyline2D> flattened  = (IList <Polyline2D>)ShapeTool.GetFlattened(path, this.wireframe_0.Config.ShapeFlattenEpsilon);
                IList <Polyline4D> polylines1 = DxfUtil.smethod_39(flattened, filled, transformer);
                ArgbColor          plotColor  = this.wireframe_0.GetPlotColor(this.dxfEntity_0, color);
                graphicsFactory0.CreatePathAsOne(this.dxfEntity_0, this.wireframe_0, plotColor, forText, polylines1, false, true);
                transformer.SetPreTransform(Transformation4D.Translation(0.0, 0.0, extrusion));
                IList <Polyline4D> polylines2 = DxfUtil.smethod_39(flattened, filled, transformer);
                graphicsFactory0.CreatePathAsOne(this.dxfEntity_0, this.wireframe_0, plotColor, forText, polylines2, false, true);
                for (int index1 = polylines1.Count - 1; index1 >= 0; --index1)
                {
                    Polyline4D polyline4D1 = polylines1[index1];
                    Polyline4D polyline4D2 = polylines2[index1];
                    for (int index2 = polyline4D1.Count - 1; index2 >= 0; --index2)
                    {
                        graphicsFactory0.CreateLine(this.dxfEntity_0, this.wireframe_0, plotColor, forText, polyline4D1[index2], polyline4D2[index2]);
                    }
                }
            }
        }
Beispiel #30
0
        internal void method_20(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            ArgbColor[] argbColorArray = new ArgbColor[10] {
                ArgbColors.Red, ArgbColors.Green, ArgbColors.Blue, ArgbColors.Magenta, ArgbColors.Cyan, ArgbColors.Violet, ArgbColors.Orange, ArgbColors.YellowGreen, ArgbColors.Purple, ArgbColors.DarkOrchid
            };
            ArgbColor          color     = argbColorArray[(int)this.Id % argbColorArray.Length];
            IList <Polyline4D> polylines = this.method_21((DrawContext)context, context.GetTransformer());

            if (polylines.Count <= 0)
            {
                return;
            }
            graphicsFactory.CreatePath((DxfEntity)this, context, color, false, polylines, false, true);
        }