Node:Showing Paths, Next:, Previous:Labelling Paths, Up:Path Reference



Showing

void show ([string text = "", [char coords = 'w', [const bool do_persp = true, [const bool do_apply = true, [Focus* f = 0, [const unsigned short proj = Projections::PERSP, [const real factor = 1]]]]]]]) const function
Prints information about the Path to standard output (stdout). text is simply printed out, unless it's the empty string, in which case "Path:" is printed out. coords indicates which set of coordinates should be shown. Valid values are 'w' for the world_coordinates, 'p' for the projective_coordinates, 'u' for the user_coordinates, and 'v' for the view_coordinates, whereby the latter two are currently not in use (see Point Reference; Data Members). If do_apply is true, apply_transform() is called on each Point, updating its world_coordinates and resetting its transform. Otherwise, it's not. The arguments do_persp, f, proj, and factor are only relevant when showing projective_coordinates. If do_persp is true, the Points are projected using the values of f, proj, and factor (see Path Reference; Outputting). Otherwise, the values currently stored in projective_coordinates are shown. The Points and connectors are printed out alternately to standard output, followed by the word "cycle", if cycle_switch = true.1
          default_focus.set(0, 3, -10, 0, 3, 10, 10);
          Reg_Polygon r(origin, 5, 3, 45);
          r.fill(gray);
          Point p[10];
          for (int i = 0; i < 5; ++i)
              p[i] = r.get_point(i);
          p[5] = Point::intersection_point(p[4], p[0], p[2], p[1]).pt;
          p[6] = Point::intersection_point(p[0], p[1], p[2], p[3]).pt;
          p[7] = Point::intersection_point(p[1], p[2], p[4], p[3]).pt;
          p[8] = Point::intersection_point(p[2], p[3], p[0], p[4]).pt;
          p[9] = Point::intersection_point(p[3], p[4], p[0], p[1]).pt;
          Path q("--", true, &p[0], &p[5], &p[1], &p[6], &p[2], &p[7],
                 &p[3], &p[8], &p[4], &p[9], 0);
          q.draw();
          q.show("q:");
          -| q:
          fill_draw_value == 0
          (0, 1.06066, 1.06066)
          -- (-2.30826, 2.24651, 2.24651)
          -- (-1.42658, 0.327762, 0.327762)
          -- (-3.73485, -0.858092, -0.858092)
          -- (-0.881678, -0.858092, -0.858092)
          -- (4.92996e-07, -2.77684, -2.77684)
          -- (0.881678, -0.858092, -0.858092)
          -- (3.73485, -0.858092, -0.858092)
          -- (1.42658, 0.327762, 0.327762)
          -- (2.30826, 2.24651, 2.24651) -- cycle;
          q.show("q:", 'p');
          -| q:
          fill_draw_value == 0
          Projective coordinates.
          (0, -1.75337, 0.0958948)
          -- (-1.88483, -0.615265, 0.183441)
          -- (-1.38131, -2.58743, 0.031736)
          -- (-4.08541, -4.22023, -0.0938636)
          -- (-0.964435, -4.22023, -0.0938636)
          -- (0, -7.99767, -0.384436)
          -- (0.964436, -4.22023, -0.0938636)
          -- (4.08541, -4.22023, -0.0938636)
          -- (1.38131, -2.58743, 0.031736)
          -- (1.88483, -0.615266, 0.183441) -- cycle;
          


[Figure 135. Not displayed.]

Fig. 135.

void show_colors ([bool = false]) Function
Shows the values of draw_color and fill_color. These will normally be 0, unless the Path is on a Picture.


Footnotes

  1. The following example shows only one Point per line. In actual use, two Points are shown, but this causes overfull boxes in Texinfo.