コード例 #1
0
 public hLine(wPoint Start, wPoint End)
 {
     StartX = Start.X;
     StartY = Start.Y;
     EndX   = End.X;
     EndY   = End.Y;
 }
コード例 #2
0
ファイル: hEllipse.cs プロジェクト: shapediver/Aviary
 public hEllipse(wPoint Center, double UniformRadius)
 {
     CenterX = Center.X;
     CenterY = Center.Y;
     RadiusX = UniformRadius;
     RadiusY = UniformRadius;
 }
コード例 #3
0
ファイル: PointToShape.cs プロジェクト: shapediver/Aviary
        /// <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)
        {
            Point3d P = new Point3d(0, 0, 0);
            double  R = 1.0;

            if (!DA.GetData(0, ref P))
            {
                return;
            }
            if (!DA.GetData(1, ref R))
            {
                return;
            }

            wPoint O   = new wPoint(P.X, P.Y, P.Z);
            wCurve Crv = new wCircle(O, R);

            wShape           Shape  = new wShape(Crv);
            wShapeCollection Shapes = new wShapeCollection(Shape);

            wPlane Pln = new wPlane().XYPlane();

            Pln.Origin = O;

            Shapes.Boundary = new wRectangle(Pln, R, R);
            Shapes.Type     = Crv.GetCurveType;

            Shapes.Graphics = new wGraphic().BlackFill();
            Shapes.Effects  = new wEffects();


            wObject WindObject = new wObject(Shapes, "Hoopoe", Shapes.Type);

            DA.SetData(0, WindObject);
        }
コード例 #4
0
ファイル: wLightPoint.cs プロジェクト: pm-Architect/Aviary
        public wPointLight(wPoint Light_Origin, wColor Light_Color)
        {
            Origin = Light_Origin;

            LightColor = Light_Color;

            SetWPFLight();
        }
コード例 #5
0
ファイル: wCircle.cs プロジェクト: pm-Architect/Aviary
        public wCircle(wPlane BasePlane, double RadiusValue)
        {
            IsClosed = true;

            Plane  = BasePlane;
            Center = Plane.Origin;
            Radius = RadiusValue;
        }
コード例 #6
0
ファイル: wVertex.cs プロジェクト: pm-Architect/Aviary
        public wVertex(wPoint VertexPoint, int VertexIndex)
        {
            X = VertexPoint.X;
            Y = VertexPoint.Y;
            Z = VertexPoint.Z;

            Index = VertexIndex;
        }
コード例 #7
0
ファイル: wCircle.cs プロジェクト: pm-Architect/Aviary
        public wCircle(wPoint CenterPoint, double RadiusValue)
        {
            IsClosed = true;

            Center = CenterPoint;
            Plane.SetOrigin(Center);
            Radius = RadiusValue;
        }
コード例 #8
0
ファイル: wCamera.cs プロジェクト: pm-Architect/Aviary
        private void SetLocation()
        {
            double X = Target.X + Math.Cos(Pivot) * Math.Sin(Tilt) * Distance;
            double Y = Target.Y + Math.Sin(Pivot) * Math.Sin(Tilt) * Distance;
            double Z = Target.Z + Math.Cos(Tilt) * Distance;

            Location = new wPoint(X, Y, Z);
        }
コード例 #9
0
        //
        public wLightSpot(wPoint Light_Location, wPoint Light_Target)
        {
            Location = Light_Location;
            Target   = Light_Target;


            SetWPFLight();
        }
コード例 #10
0
        public wCameraStandard(wPoint PositionPoint, wPoint TargetPoint, wVector UpVector, double Length)
        {
            SetLocation(PositionPoint);
            SetTarget(TargetPoint);

            Up         = UpVector;
            LensLength = Length;
        }
コード例 #11
0
        public wLightSpot(wPoint Light_Location, wPoint Light_Target, wColor Light_Color)
        {
            Location = Light_Location;
            Target   = Light_Target;

            LightColor = Light_Color;

            SetWPFLight();
        }
コード例 #12
0
        public wLightSpot(wPoint Light_Location, wPoint Light_Target, double Light_InnerAngle, double Light_OuterAngle, wColor Light_Color)
        {
            Location = Light_Location;
            Target   = Light_Target;

            LightColor = Light_Color;

            SetWPFLight();
        }
コード例 #13
0
ファイル: hEllipse.cs プロジェクト: shapediver/Aviary
 public hEllipse(wPoint Center, double UniformRadius, double RotationAngle
                 )
 {
     CenterX = Center.X;
     CenterY = Center.Y;
     RadiusX = UniformRadius;
     RadiusY = UniformRadius;
     Angle   = RotationAngle;
 }
コード例 #14
0
ファイル: wLightPoint.cs プロジェクト: pm-Architect/Aviary
        public wPointLight(double Light_Intensity, wPoint Light_Origin, wColor Light_Color)
        {
            Origin = Light_Origin;

            Intensity  = Light_Intensity;
            LightColor = new AdjustColor(Light_Color).SetLuminance(Intensity / 100.00);

            SetWPFLight();
        }
コード例 #15
0
ファイル: wVertex.cs プロジェクト: pm-Architect/Aviary
        public wVertex(wPoint VertexPoint, int VertexIndex, int VertexTopologyIndex)
        {
            X = VertexPoint.X;
            Y = VertexPoint.Y;
            Z = VertexPoint.Z;

            Index         = VertexIndex;
            TopologyIndex = VertexTopologyIndex;
        }
コード例 #16
0
ファイル: wEllipse.cs プロジェクト: pm-Architect/Aviary
        public wEllipse(wPoint CenterPoint, double XRadius, double YRadius)
        {
            IsClosed = true;

            Center = CenterPoint;
            Plane.SetOrigin(Center);
            RadiusX = XRadius;
            RadiusY = YRadius;
        }
コード例 #17
0
ファイル: wEllipse.cs プロジェクト: pm-Architect/Aviary
        public wEllipse(wPlane BasePlane, double XRadius, double YRadius)
        {
            IsClosed = true;

            Plane   = BasePlane;
            Center  = Plane.Origin;
            RadiusX = XRadius;
            RadiusY = YRadius;
        }
コード例 #18
0
ファイル: wBezierSpline.cs プロジェクト: pm-Architect/Aviary
 public wBezierSpline(wPoint A, wPoint B, wPoint C, wPoint D)
 {
     Spans.Add(new wBezierSpans(0, 1, 2, 3));
     Points.AddRange(new List <wPoint>()
     {
         A, B, C, D
     });
     Segments.Add(new wCubicBezier(A, B, C, D));
 }
コード例 #19
0
        public wLightSpot(double Light_Intensity, wPoint Light_Location, wPoint Light_Target, double Light_InnerAngle, double Light_OuterAngle, wColor Light_Color)
        {
            Location = Light_Location;
            Target   = Light_Target;

            Intensity  = Light_Intensity;
            LightColor = new AdjustColor(Light_Color).SetLuminance(Intensity / 100.00);

            SetWPFLight();
        }
コード例 #20
0
        public wLightSpot(wPoint Light_Location, wPoint Light_Target, double Light_InnerAngle, double Light_OuterAngle)
        {
            Location = Light_Location;
            Target   = Light_Target;

            ConeAngleIn  = Light_InnerAngle;
            ConeAngleOut = Light_OuterAngle;

            SetWPFLight();
        }
コード例 #21
0
        public void AddPoint(wPoint WindPoint, wColor WindColor, double Radius)
        {
            PointsVisual3D VisPoint = new PointsVisual3D();

            VisPoint.Size  = Radius;
            VisPoint.Color = WindColor.ToMediaColor();

            VisPoint.Points.Add(WindPoint.ToPoint3D());

            ViewPort.Children.Add(VisPoint);
        }
コード例 #22
0
ファイル: wBezierSpline.cs プロジェクト: pm-Architect/Aviary
        public void AddSpan(wPoint A, wPoint B, wPoint C, wPoint D)
        {
            int i = Points.Count - 1;

            Points.AddRange(new List <wPoint>()
            {
                B, C, D
            });
            Spans.Add(new wBezierSpans(i, i + 1, i + 2, i + 3));
            Segments.Add(new wCubicBezier(A, B, C, D));
        }
コード例 #23
0
 public wLine(wPoint StartPoint, wVector Direction, double Length)
 {
     Points.AddRange(new List <wPoint>()
     {
         Start, End
     });
     Indices.AddRange(new List <int>()
     {
         0, 1
     });
 }
コード例 #24
0
        public wArc(wPoint CenterPoint, double RadiusValue, double AngleStart, double AngleEnd)
        {
            Center = CenterPoint;
            Plane.SetOrigin(Center);
            Radius     = RadiusValue;
            StartAngle = AngleStart;
            EndAngle   = AngleEnd;
            Angle      = EndAngle - StartAngle;

            StartPoint = new wPoint(Center.X + Radius * Math.Cos(Math.PI * StartAngle / 180.0), Center.Y + Radius * Math.Sin(Math.PI * StartAngle / 180.0), Center.Z);
            EndPoint   = new wPoint(Center.X + Radius * Math.Cos(Math.PI * EndAngle / 180.0), Center.Y + Radius * Math.Sin(Math.PI * EndAngle / 180.0), Center.Z);
        }
コード例 #25
0
        public hText(wTextObject WindText, wFont WindFont)
        {
            Text   = WindText.Text.Text;
            Font   = WindFont;
            Origin = WindText.Plane.Origin;
            Angle  = WindText.Angle;

            HorizontalAlignment = (hAlign)(int)Font.HorizontalAlignment;
            VerticalAlignment   = (vAlign)(int)Font.VerticalAlignment;
            FontItalic          = (fStyle)Convert.ToInt32(WindFont.IsItalic);
            FontBold            = (fWeight)Convert.ToInt32(WindFont.IsBold);
        }
コード例 #26
0
ファイル: wCurve.cs プロジェクト: pm-Architect/Aviary
        public bool IsPointInside(wPoint TestPoint, double Tolerance = 0.000001)
        {
            int    count    = Points.Count - 1;
            double sumAngle = new wVector(Points[count].X - TestPoint.X, Points[count].Y - TestPoint.Y, 0).GetAngle(new wVector(Points[0].X - TestPoint.X, Points[0].Y - TestPoint.Y, 0));

            for (int i = 0; i < count; i++)
            {
                sumAngle += new wVector(Points[i].X - TestPoint.X, Points[i].Y - TestPoint.Y, 0).GetAngle(new wVector(Points[i + 1].X - TestPoint.X, Points[i + 1].Y - TestPoint.Y, 0));
            }

            return(Math.Abs(sumAngle) > (0.000001));
        }
コード例 #27
0
ファイル: wCamera.cs プロジェクト: pm-Architect/Aviary
        public void SetOrientation(wPoint CenterPoint, double PivotAngle, double TiltAngle, double CameraDistance)
        {
            Target = CenterPoint;

            Pivot    = PivotAngle;
            Tilt     = TiltAngle;
            Distance = CameraDistance;

            SetLocation();
            SetDirection();
            SetUp();
        }
コード例 #28
0
        public wArc(wPlane BasePlane, double RadiusValue, double AngleStart, double AngleEnd)
        {
            Plane      = BasePlane;
            Center     = Plane.Origin;
            Radius     = RadiusValue;
            StartAngle = AngleStart;
            EndAngle   = AngleEnd;
            Angle      = EndAngle - StartAngle;

            StartPoint = new wPoint(Center.X + Radius * Math.Cos(Math.PI * StartAngle / 180), Center.Y + Radius * Math.Sin(Math.PI * StartAngle / 180), Center.Z);
            EndPoint   = new wPoint(Center.X + Radius * Math.Cos(Math.PI * EndAngle / 180), Center.Y + Radius * Math.Sin(Math.PI * EndAngle / 180), Center.Z);
        }
コード例 #29
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)
        {
            IGH_Goo     Z = null;
            Rectangle3d R = new Rectangle3d(Plane.WorldXY, 150, 150);

            if (!DA.GetData(0, ref Z))
            {
                return;
            }
            if (!DA.GetData(0, ref R))
            {
                return;
            }

            Bitmap A = null;

            if (Z != null)
            {
                Z.CastTo(out A);
            }

            // Check if is pline
            Curve C = R.ToNurbsCurve();

            BoundingBox B = C.GetBoundingBox(true);
            wPoint      O = new wPoint(B.Center.X, B.Center.Y, B.Center.Z);

            wShape           Shape  = new wShape(new wRectangle());
            wShapeCollection Shapes = new wShapeCollection(Shape);

            wPlane Pln = new wPlane().XYPlane();

            Pln.Origin = O;

            Shapes.Boundary = new wRectangle(Pln, B.Diagonal.X, B.Diagonal.Y);
            //Shapes.Type = Crv.GetCurveType;

            if (C.IsClosed)
            {
                Shapes.Graphics = new wGraphic().BlackFill();
            }
            else
            {
                Shapes.Graphics = new wGraphic().BlackOutline();
            }
            Shapes.Effects = new wEffects();


            wObject WindObject = new wObject(Shapes, "Hoopoe", Shapes.Type);

            DA.SetData(0, WindObject);
        }
コード例 #30
0
ファイル: wCamera.cs プロジェクト: pm-Architect/Aviary
        public wCamera(wPoint CenterPoint, double PivotAngle, double TiltAngle, double CameraDistance, double lensLength)
        {
            Target = CenterPoint;

            Pivot    = PivotAngle;
            Tilt     = TiltAngle;
            Distance = CameraDistance;

            LensLength = lensLength;

            SetLocation();
            SetDirection();
            SetUp();
        }