Beispiel #1
0
        /// <summary>
        /// Создание полигона
        /// </summary>
        /// <param name="pointNum1">Индекс первой вершины</param>
        /// <param name="pointNum2">Индекс второй вершины</param>
        /// <param name="pointNum3">Индекс третей вершины</param>
        public Polygon3D(int pointNum1, int pointNum2, int pointNum3)
        {
            PointIndex    = new int[3];
            color         = new Color[2];
            LightingColor = new Color[2];
            Matte         = new float[2];

            PointIndex[0] = pointNum1;
            PointIndex[1] = pointNum2;
            PointIndex[2] = pointNum3;

            Normal      = new Point3D();
            NormalZ     = 0;
            Center      = new Point3D();
            DoubleSided = false;
            FillType    = PolygonFillType.Solid;

            Matte[0] = Matte[1] = (float)0.5;
            color[0] = color[1] = Color.White;
        }
Beispiel #2
0
        public Polygon3D(Polygon3D source)
        {
            PointIndex    = new int[3];
            color         = new Color[2];
            LightingColor = new Color[2];
            Matte         = new float[2];

            PointIndex[0] = source.PointIndex[0];
            PointIndex[1] = source.PointIndex[1];
            PointIndex[2] = source.PointIndex[2];

            Normal      = new Point3D();
            NormalZ     = 0;
            Center      = new Point3D(source.Center);
            DoubleSided = source.DoubleSided;
            FillType    = source.FillType;

            Matte[0] = source.Matte[0];
            Matte[1] = source.Matte[1];
            color[0] = source.color[0];
            color[1] = source.color[1];
        }
Beispiel #3
0
        /// <summary>
        /// Makes a copy of the specified source shape.
        /// </summary>
        public override void Copy(Shape sourceShape)
        {
            // Call the base class implementation
            base.Copy(sourceShape);

            // Copy the shape fill type
            FillType = ((PointBasedShape)sourceShape).FillType;

            // Clear the existing points on the destination
            Points.Clear();

            // Loop over the points on the source shape
            foreach (PolygonPoint pt in ((PointBasedShape)sourceShape).Points)
            {
                // Create a new point
                PolygonPoint newPoint = new PolygonPoint();
                newPoint.X = pt.X;
                newPoint.Y = pt.Y;

                // Add the point to the destination
                Points.Add(newPoint);
            }
        }