Esempio n. 1
0
        protected override void MarkLineInternal(Surface <T> surface, Utensil <T> utensil, VectorF2 point1, VectorF2 point2)
        {
            VectorF2 diff      = point2 - point1;
            VectorF2 step_diff = diff;

            Marker_Stroker <T> stroker = new Marker_Stroker <T>(surface, utensil, point1, internal_tool_line);

            while (diff.IsComplyingDirection(step_diff))
            {
                VectorF2 point = stroker.Stroke(step_diff.GetJitteredDirectionAngleInRadians(angle_delta) * stroke_length);

                step_diff = point2 - point;
            }
        }
Esempio n. 2
0
        protected override void MarkLineInternal(Surface <T> surface, Utensil <T> utensil, VectorF2 point1, VectorF2 point2)
        {
            float    distance;
            float    spacing = spacing_in_brush_width_percent * utensil.GetWidth();
            VectorF2 step    = point1.GetDirection(point2, out distance) * spacing;

            VectorF2 point        = point1;
            int      number_steps = (int)(distance / spacing);

            utensil.Mark(surface, point);
            for (int i = 1; i < number_steps; i++)
            {
                point += step;
                utensil.Mark(surface, point);
            }
        }
Esempio n. 3
0
        protected override void MarkLineInternal(Surface <T> texture, Utensil <T> utensil, VectorF2 point1, VectorF2 point2)
        {
            float start = 0.0f;
            float end   = point1.GetDistanceTo(point2);

            for (float position = start; position < end; position += scratch_internode)
            {
                float pos1 = start - margin_rand.Get();
                float pos2 = (position + length_rand.Get()).BindBelow(end) + margin_rand.Get();

                internal_line_tool.MarkLines(texture, utensil,
                                             RandVectorF2.GetNearLinePoint(point1, point2, pos1, scratch_radius),
                                             RandVectorF2.GetNearLinePoint(point1, point2, pos2, scratch_radius)
                                             );
            }
        }
Esempio n. 4
0
 public void MarkLoop(Surface <T> surface, Utensil <T> utensil, params VectorF2[] points)
 {
     MarkLoop(surface, utensil, (IEnumerable <VectorF2>)points);
 }
Esempio n. 5
0
 public void MarkLoop(Surface <T> surface, Utensil <T> utensil, IEnumerable <VectorF2> points)
 {
     MarkLines(surface, utensil, points.CloseLoop());
 }
Esempio n. 6
0
 public abstract void MarkLines(Surface <T> surface, Utensil <T> utensil, IEnumerable <VectorF2> points);
Esempio n. 7
0
 public Marker_Stroker(Surface <T> s, Utensil <T> u, VectorF2 p, SurfaceTool_Line <T> l) : base(u, s)
 {
     current_point = p;
     line_tool     = l;
 }
Esempio n. 8
0
 public override void MarkLines(Surface <T> surface, Utensil <T> utensil, IEnumerable <VectorF2> points)
 {
     points.ProcessConnections((p, c) => MarkLineInternal(surface, utensil, p, c));
 }
Esempio n. 9
0
 protected abstract void MarkLineInternal(Surface <T> surface, Utensil <T> utensil, VectorF2 point1, VectorF2 point2);
Esempio n. 10
0
 public Marker(Utensil <T> u, Surface <T> s)
 {
     utensil = u;
     surface = s;
 }