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); }
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)); }
void define(WordList relationName) { // Get the relation for the name; if none exists, add the structure Dictionary<ZObject,ZEdge> relation; if (!relation2.TryGetValue(relationName, out relation)) { // Define a structure to hold the relation relation2[relationName] = relation = new Dictionary<ZObject,ZEdge>(); } // Create a delegate to add the items in directed relation2Add[relationName] = delegate(ZObject source, ZObject sink) { ZEdge edge; // Add the entry to the table.. if none exists. if (!relation.TryGetValue(source, out edge)) { // Doesn't exist, create the relation relation[source] = new ZEdge(newName(), sink, null); return; } // Check that the relation is sensible if (edge.sink == sink) return; // Oh-oh, there is a problem. }; }