const
function: 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]]]]]]])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 theworld_coordinates
,'p'
for theprojective_coordinates
,'u'
for theuser_coordinates
, and'v'
for theview_coordinates
, whereby the latter two are currently not in use (see Point Reference; Data Members). If do_apply istrue
,apply_transform()
is called on eachPoint
, updating itsworld_coordinates
and resetting itstransform
. Otherwise, it's not. The arguments do_persp, f, proj, and factor are only relevant when showingprojective_coordinates
. Ifdo_persp
istrue
, thePoints
are projected using the values of f, proj, and factor (see Path Reference; Outputting). Otherwise, the values currently stored inprojective_coordinates
are shown. ThePoints
and connectors are printed out alternately to standard output, followed by the word “cycle”, ifcycle_switch = true
.1default_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;
![]()
Fig. 135.
false
])Shows the values of
draw_color
andfill_color
. These will normally be 0, unless thePath
is on aPicture
.
[1] The following example shows only one Point
per
line. In actual use, two Points
are shown, but this causes
overfull boxes in Texinfo.