Previous: Showing Points, Up: Point Reference


22.21 Outputting

— Non-member function: ostream& operator<< (ostream& o, Point& p)

Used in Path::output() for writing the x and y values of the projective_coordinates of Points to out_stream. See Path Reference; Outputting. This is a low-level function that ordinary users should never have to invoke directly.

— Function: void output (void)

Writes the MetaPost code for drawing or undrawing a Point to out_stream. Called by Picture::output(), when a Shape on the Picture is a Point. See Picture Reference; Outputting.

— Virtual function: void suppress_output (void)

Sets do_output to false, which causes a Point not to be output. This function is called in Picture::output(), when a Point cannot be projected. See Picture Reference; Outputting.

— Virtual function: virtual void unsuppress_output (void)

Resets do_output to true, so that a Point can potentially be output, if Picture::output() is called again for the Picture the Point is on. This function is called in Picture::output(). See Picture Reference; Outputting.

— Function: vector<shape*> extract (const Focus& f, const unsigned short proj, real factor)

Attempts to project the Point using the arguments passed to Picture::output(), which calls this function. If extract() succeeds, it returns a vector<shape*> containing only the Point. Otherwise, it returns an empty vector<shape*>.

— Virtual function: bool set_extremes (void)

Sets “extreme” values for x, y, and z in projective_coordinates. This is, of course, trivial for Points, because they only have one x, y and z-coordinate. So the maxima and minima for each coordinate are always the same.

— Virtual inline const function: valarray <real> get_extremes (void)

Returns projective_extremes.

— Virtual const function: real get_minimum_z (void)
— Virtual const function: real get_maximum_z (void)
— Virtual const function: real get_mean_z (void)

These functions return the minimum, maximum, and mean z-value of the Point. get_minimum_z() returns projective_extremes[4], get_maximum_z() returns projective_extremes[5], and get_mean_z() returns (projective_extremes[4] + projective_extremes[5]) / 2. However, since a Point has only one z-coordinate (from world_coordinates), these values will all be the same.

These functions are pure virtual functions in Shape, and are called on Points through pointers to Shape. Therefore, they must be consistent with the versions for other types derived from Shape. See Shape Reference; Outputting.