Exemplo n.º 1
0
 public void Turn(double angleX = 0, double angleY = 0, double angleZ = 0)
 {
     XEdge = startXEdge.TurnAroundAxis(Point3.Axes.X, angleX);
     YEdge = startYEdge.TurnAroundAxis(Point3.Axes.X, angleX);
     ZEdge = startZEdge.TurnAroundAxis(Point3.Axes.X, angleX);
     XEdge = XEdge.TurnAroundAxis(Point3.Axes.Y, angleY);
     YEdge = YEdge.TurnAroundAxis(Point3.Axes.Y, angleY);
     ZEdge = ZEdge.TurnAroundAxis(Point3.Axes.Y, angleY);
     XEdge = XEdge.TurnAroundAxis(Point3.Axes.Z, angleZ);
     YEdge = YEdge.TurnAroundAxis(Point3.Axes.Z, angleZ);
     ZEdge = ZEdge.TurnAroundAxis(Point3.Axes.Z, angleZ);
 }
Exemplo n.º 2
0
        public void Draw(Graphics g, Pen pen, Brush brush, Font font, int offset)
        {
            var center = Center.GetDrawingPoint(scrWidth, scrHeight);
            var gPen   = new Pen(Brushes.Green, 2);
            var bPen   = new Pen(Brushes.Blue, 2);
            var mPen   = new Pen(Brushes.DarkMagenta, 2);

            //X
            g.DrawLine(gPen, center, XEdge.GetDrawingPoint(scrWidth, scrHeight));
            g.DrawString("X", font, brush, new Point3(XEdge.X - offset, XEdge.Y, XEdge.Z).GetDrawingPoint(scrWidth, scrHeight));
            //Y
            g.DrawLine(bPen, YEdge.GetDrawingPoint(scrWidth, scrHeight), center);
            g.DrawString("Y", font, brush, new Point3(YEdge.X, YEdge.Y - offset, YEdge.Z).GetDrawingPoint(scrWidth, scrHeight));
            //Z
            g.DrawLine(mPen, center, ZEdge.GetDrawingPoint(scrWidth, scrHeight));
            g.DrawString("Z", font, brush, new Point3(ZEdge.X, ZEdge.Y, ZEdge.Z - offset).GetDrawingPoint(scrWidth, scrHeight));
        }
        static void ProcessLinks(Dictionary <DrawingObject, IViewerObjectX> vObjectsMapping, Graph g, Dictionary <string, Subgraph> subgraphTable, Microsoft.Msagl.Drawing.Graph drawingGraph)
        {
            foreach (GraphLink gl in g.Links)
            {
                var sourceId = gl.Source.Id.LiteralValue;
                var targetId = gl.Target.Id.LiteralValue;

                Subgraph sourceSubgraph;
                Node     source = !subgraphTable.TryGetValue(sourceId, out sourceSubgraph) ? drawingGraph.FindNode(sourceId) : sourceSubgraph;

                Subgraph targetSubgraph;
                Node     target = !subgraphTable.TryGetValue(targetId, out targetSubgraph) ? drawingGraph.FindNode(targetId) : targetSubgraph;

                foreach (GraphCategory gc in gl.Categories)
                {
                    string c = gc.ToString().Replace("CodeSchema_", "");
                    if (c == "Contains")
                    {
                        if (targetSubgraph != null)
                        {
                            sourceSubgraph.AddSubgraph(targetSubgraph);
                        }
                        else
                        {
                            sourceSubgraph.AddNode(target);
                        }
                    }
                    else
                    {
                        Edge edge = new Edge(source, target, ConnectionToGraph.Connected);

                        edge.Label = new Label(c);
                        XEdge xEdge = new XEdge(edge, c);
                        vObjectsMapping[edge] = xEdge;
                    }
                }
            }
        }