示例#1
0
        /// <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);
        }
示例#2
0
        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);
        }
示例#3
0
 public wTextObject(wText WindText, wPlane PlaneObject)
 {
     Text  = WindText;
     Plane = PlaneObject;
 }
示例#4
0
 public wTextObject(wText WindText)
 {
     Text = WindText;
 }