Esempio n. 1
0
        private static void smethod_12(
            Polyline4D polyline,
            ITransformer4D transformation,
            Point2D p0,
            Point2D p1,
            Point2D p2,
            Point2D p3,
            double epsilonSquared)
        {
            Vector2D dp01 = p1 - p0;
            Vector2D dp12 = p2 - p1;
            Vector2D dp23 = p3 - p2;

            if (ShapeTool.smethod_10(dp01, dp12, dp23, p3 - p0, epsilonSquared))
            {
                polyline.Add(transformation.TransformTo4D(p1));
                polyline.Add(transformation.TransformTo4D(p2));
                polyline.Add(transformation.TransformTo4D(p3));
            }
            else
            {
                Point2D  p1_1      = p0 + 0.5 * dp01;
                Point2D  point2D1  = p1 + 0.5 * dp12;
                Point2D  p2_1      = p2 + 0.5 * dp23;
                Vector2D vector2D1 = point2D1 - p1_1;
                Vector2D vector2D2 = p2_1 - point2D1;
                Point2D  p2_2      = p1_1 + 0.5 * vector2D1;
                Point2D  p1_2      = point2D1 + 0.5 * vector2D2;
                Vector2D vector2D3 = p1_2 - p2_2;
                Point2D  point2D2  = p2_2 + 0.5 * vector2D3;
                ShapeTool.smethod_12(polyline, transformation, p0, p1_1, p2_2, point2D2, epsilonSquared);
                ShapeTool.smethod_12(polyline, transformation, point2D2, p1_2, p2_1, p3, epsilonSquared);
            }
        }
Esempio n. 2
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     for (int index = 0; index < this.interface23_0.Length; ++index)
     {
         this.interface23_0[index].Transform(transformer);
     }
 }
Esempio n. 3
0
        private static void smethod_8(
            Polyline4D polyline,
            ITransformer4D transformation,
            Point2D p0,
            Point2D p1,
            Point2D p2,
            double epsilonSquared)
        {
            Vector2D dp02 = p2 - p0;
            Vector2D dp01 = p1 - p0;
            Vector2D dp12 = p2 - p1;

            if (ShapeTool.smethod_9(dp01, dp12, dp02, epsilonSquared))
            {
                polyline.Add(transformation.TransformTo4D(p1));
                polyline.Add(transformation.TransformTo4D(p2));
            }
            else
            {
                Point2D  p1_1     = p0 + 0.5 * dp01;
                Point2D  p1_2     = p1 + 0.5 * dp12;
                Vector2D vector2D = p1_2 - p1_1;
                Point2D  point2D  = p1_1 + 0.5 * vector2D;
                ShapeTool.smethod_8(polyline, transformation, p0, p1_1, point2D, epsilonSquared);
                ShapeTool.smethod_8(polyline, transformation, point2D, p1_2, p2, epsilonSquared);
            }
        }
Esempio n. 4
0
        public IShape4D GetFlattened(ITransformer4D transformer, double shapeFlattenEpsilon)
        {
            Transformer4DList transformer4Dlist = new Transformer4DList(2);

            transformer4Dlist.Add((ITransformer4D)this.matrix4D_0);
            transformer4Dlist.Add(transformer);
            return((IShape4D) new PolylineShape4D((IList <Polyline4D>)ShapeTool.GetFlattened((ITransformer4D)transformer4Dlist, (IShape2D)this.fillableShape2D_0, shapeFlattenEpsilon), this.fillableShape2D_0.Filled));
        }
Esempio n. 5
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     if (this.nullable_0.HasValue)
     {
         this.nullable_0 = new Vector4D?(transformer.Transform(this.nullable_0.Value));
     }
     this.segment4D_0.Start = transformer.Transform(this.segment4D_0.Start);
     this.segment4D_0.End   = transformer.Transform(this.segment4D_0.End);
 }
Esempio n. 6
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     if (this.linkedList_0 == null)
     {
         return;
     }
     for (LinkedListNode <Interface12> linkedListNode = this.linkedList_0.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
     {
         linkedListNode.Value.Transform(transformer, graphicsConfig);
     }
 }
Esempio n. 7
0
 public void Transform(ITransformer4D transformer)
 {
     if (this.vector4D_0 == null)
     {
         return;
     }
     for (int index = 0; index < this.vector4D_0.Length; ++index)
     {
         this.vector4D_0[index] = transformer.Transform(this.vector4D_0[index]);
     }
 }
Esempio n. 8
0
        public IShape4D GetFlattened(ITransformer4D transformer, double shapeFlattenEpsilon)
        {
            IList <Polyline4D> polylines = (IList <Polyline4D>) new List <Polyline4D>(this.ilist_0.Count);

            for (int index1 = 0; index1 < this.ilist_0.Count; ++index1)
            {
                Polyline4D polyline4D1 = this.ilist_0[index1];
                Polyline4D polyline4D2 = new Polyline4D(polyline4D1.Count, polyline4D1.Closed);
                for (int index2 = 0; index2 < polyline4D1.Count; ++index2)
                {
                    polyline4D2.Add(transformer.Transform(polyline4D1[index2]));
                }
                polylines.Add(polyline4D2);
            }
            return((IShape4D) new PolylineShape4D(polylines, this.bool_0));
        }
Esempio n. 9
0
 public Class1039(
     Graphics graphics,
     SmoothingMode?textSmoothingMode,
     BlinnClipper4D drawingBoundsClipper,
     ITransformer4D transformer,
     Interface22 nonTextColorContext,
     Interface22 textColorContext)
 {
     this.graphics_0       = graphics;
     this.smoothingMode_0  = graphics.SmoothingMode;
     this.nullable_0       = textSmoothingMode;
     this.blinnClipper4D_0 = drawingBoundsClipper;
     this.itransformer4D_0 = transformer;
     this.interface22_1    = nonTextColorContext;
     this.interface22_2    = textColorContext;
     this.interface22_0    = nonTextColorContext;
 }
Esempio n. 10
0
 public void TransformDrawables(ITransformer4D transformer)
 {
     if (this.linkedList_0 != null)
     {
         foreach (Interface12 nterface12 in this.linkedList_0)
         {
             nterface12.Transform(transformer, this.graphicsConfig_0);
         }
     }
     if (this.linkedList_1 == null)
     {
         return;
     }
     foreach (Interface12 nterface12 in this.linkedList_1)
     {
         nterface12.Transform(transformer, this.graphicsConfig_0);
     }
 }
Esempio n. 11
0
        public void Transform(ITransformer4D transformer)
        {
            WW.Math.Point3D position  = this.Position;
            Vector4D        vector4D1 = new Vector4D(position.X, position.Y, position.Z, 1.0);

            WW.Math.Point3D point3D1  = transformer.TransformToPoint3D(this.matrix4D_0 * vector4D1);
            Bounds2D        bounds    = this.interface34_0.Font.Metrics.GetBounds(this.interface34_0.Text, Enum24.flag_0);
            Vector4D        vector4D2 = vector4D1 + new Vector4D(bounds.Delta.X, 0.0, 0.0, 0.0);

            WW.Math.Point3D point3D2  = transformer.TransformToPoint3D(this.matrix4D_0 * vector4D2);
            Vector4D        vector4D3 = vector4D1 + new Vector4D(0.0, bounds.Delta.Y, 0.0, 0.0);

            WW.Math.Point3D point3D3  = transformer.TransformToPoint3D(this.matrix4D_0 * vector4D3);
            Vector3D        vector3D1 = (point3D2 - point3D1) / bounds.Delta.X;
            Vector3D        vector3D2 = (point3D3 - point3D1) / bounds.Delta.Y;
            Vector3D        zaxis     = Vector3D.CrossProduct(vector3D1, vector3D2);

            this.matrix4D_0 = Transformation4D.GetCoordSystem(vector3D1, vector3D2, zaxis, point3D1);
        }
Esempio n. 12
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     if (this.polyline4D_0 != null)
     {
         for (int index = this.polyline4D_0.Count - 1; index >= 0; --index)
         {
             this.polyline4D_0[index] = transformer.Transform(this.polyline4D_0[index]);
         }
     }
     if (this.polyline4D_1 != null)
     {
         for (int index = this.polyline4D_1.Count - 1; index >= 0; --index)
         {
             this.polyline4D_1[index] = transformer.Transform(this.polyline4D_1[index]);
         }
     }
     this.vector4D_0 = transformer.Transform(this.vector4D_0);
     this.vector4D_1 = transformer.Transform(this.vector4D_1);
     this.vector4D_2 = transformer.Transform(this.vector4D_2);
 }
Esempio n. 13
0
 public IShape4D GetFlattened(ITransformer4D transformer, double shapeFlattenEpsilon)
 {
     return((IShape4D)this);
 }
Esempio n. 14
0
 public void Transform(ITransformer4D transformer)
 {
     this.vector4D_0 = transformer.Transform(this.vector4D_0);
 }
Esempio n. 15
0
        public static List <Polyline4D> GetFlattened(
            ITransformer4D transformation,
            IShape2D shape,
            double epsilon)
        {
            if (epsilon == 0.0)
            {
                epsilon = -0.01;
            }
            List <Polyline4D> polyline4DList = new List <Polyline4D>();

            if (epsilon < 0.0)
            {
                Bounds2D bounds = ShapeTool.GetBounds(shape);
                if (!bounds.Initialized)
                {
                    return(polyline4DList);
                }
                epsilon *= -System.Math.Max(bounds.Delta.X, bounds.Delta.Y);
            }
            epsilon *= epsilon;
            ISegment2DIterator iterator = shape.CreateIterator();

            if (iterator.MoveNext())
            {
                Point2D[]  points   = new Point2D[3];
                Polyline4D polyline = (Polyline4D)null;
                Point2D    p0       = new Point2D();
                do
                {
                    switch (iterator.Current(points, 0))
                    {
                    case SegmentType.MoveTo:
                        polyline = new Polyline4D();
                        polyline4DList.Add(polyline);
                        polyline.Add(transformation.TransformTo4D(points[0]));
                        p0 = points[0];
                        break;

                    case SegmentType.LineTo:
                        polyline.Add(transformation.TransformTo4D(points[0]));
                        p0 = points[0];
                        break;

                    case SegmentType.QuadTo:
                        ShapeTool.smethod_8(polyline, transformation, p0, points[0], points[1], epsilon);
                        p0 = points[1];
                        break;

                    case SegmentType.CubicTo:
                        ShapeTool.smethod_12(polyline, transformation, p0, points[0], points[1], points[2], epsilon);
                        p0 = points[2];
                        break;

                    case SegmentType.Close:
                        polyline.Closed = true;
                        if (polyline.Count > 1 && polyline[polyline.Count - 1] == polyline[0])
                        {
                            polyline.RemoveAt(polyline.Count - 1);
                            break;
                        }
                        break;
                    }
                }while (iterator.MoveNext());
            }
            return(polyline4DList);
        }
Esempio n. 16
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     this.interface23_0.Transform(transformer);
 }
Esempio n. 17
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     this.vector4D_0 = transformer.Transform(this.vector4D_0);
     this.vector4D_1 = transformer.Transform(this.vector4D_1);
     this.vector4D_2 = transformer.Transform(this.vector4D_2);
 }
Esempio n. 18
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
 }
Esempio n. 19
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     this.ishape4D_0 = this.ishape4D_0.GetFlattened(transformer, graphicsConfig.ShapeFlattenEpsilon);
 }
Esempio n. 20
0
 public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig)
 {
     this.class908_0.Transform(transformer);
 }