/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { string T = ""; Plane P = Plane.WorldXY; if (!DA.GetData(0, ref T)) { return; } if (!DA.GetData(1, ref P)) { return; } wPlane Pln = new wPlane(new wPoint(P.Origin.X, P.Origin.Y, P.Origin.Z), new wVector(P.XAxis.X, P.XAxis.Y, P.XAxis.Z), new wVector(P.YAxis.X, P.YAxis.Y, P.YAxis.Z)); wText Txt = new wText(T); wTextObject TxtObj = new wTextObject(Txt, Pln); TxtObj.Angle = (Vector3d.VectorAngle(Vector3d.YAxis, P.YAxis, Plane.WorldXY) / Math.PI * 180); wShape Shape = new wShape(TxtObj); wShapeCollection Shapes = new wShapeCollection(Shape); Shapes.Type = "Text"; Shapes.Graphics = new wGraphic().BlackFill(); Shapes.Effects = new wEffects(); wObject WindObject = new wObject(Shapes, "Hoopoe", Shapes.Type); DA.SetData(0, WindObject); }
public Path WpfText(wCurve Shp, wGraphic Graphics, wEffects ShapeEffects) { Path X = new Path(); wTextObject Z = (wTextObject)Shp; wText Y = Z.Text; wFontMedia F = Y.Font.ToMediaFont(); FormattedText T = new FormattedText("Test", CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight, new Typeface("Arial"), 24, new SolidColorBrush(Colors.Black)); //FormattedText T = new FormattedText(Y.Text,CultureInfo.GetCultureInfo("en-us"),FlowDirection.LeftToRight, F.GetTypeFace(),F.Size, Graphics.WpfFill); X.Data = T.BuildGeometry(new System.Windows.Point(Z.Plane.Origin.X, Z.Plane.Origin.Y)); X.RenderTransform = Xform; //X = SetPathFill(X, Graphics); //X = SetPathEffects(X, ShapeEffects); //X = SetPathStroke(X, Graphics); group.Shapes.Add(new wShape(Shp, Graphics)); return(X); }
public wTextObject(wText WindText, wPlane PlaneObject) { Text = WindText; Plane = PlaneObject; }
public wTextObject(wText WindText) { Text = WindText; }