Node:Point Data Members, Next:, Previous:Point Reference, Up:Point Reference



Data Members

valarray<real> world_coordinates Private variable
The set of four homogeneous coordinates x, y, z, and w that represent the position of the Point within 3DLDF's global coordinate system.

valarray<real> projective_coordinates Private variable
The set of four homogeneous coordinates x, y, z, and w that represent the position of the projection of the Point onto a two-dimensional plane for output. The x and y values are used in the MetaPost code written to out_stream. The z value is used in the hidden surface algorithm (which is currently rather primitive and doesn't work very well. see Surface Hiding). The w value can be != 1 , depending on the projection used; the perspective projection is non-affine, so w can take on other values.

valarray<real> user_coordinates Private variable
A set of four homogeneous coordinates x, y, z, and w.

user_coordinates currently has no function. It is intended for use in user-defined coordinate systems. For example, a coordinate system could be defined with respect to a plane surface that isn't parallel to one of the major planes. Such a coordinate system would be convenient for drawing on the plane. A Transform would make it possible to convert between user_coordinates and world_coordinates.

valarray<real> view_coordinates Private variable
A set of four homogeneous coordinates x, y, z, and w.

view_coordinates currently has no function. It may be useful for displaying multiple views in an interactive graphical user interface, or for some other purpose.

Transform transform Private variable
Contains the product of the transformations applied to the Point. When apply_transform() is called for the Point, directly or indirectly, the world_coordinates are updated and transform is reset to the identity Transform. See Point Reference; Applying Transformations.

bool on_free_store Private variable
Returns on_free_store. This should only be true if the Point was dynamically allocated on the free store. Points should only ever be dynamically allocated by create_new<Point>(), which uses set_on_free_store() to set on_free_store to true. See Point Reference; Constructors and Setting Functions, and Point Reference; Modifying.

signed short drawdot_value Private variable
Used to tell Point::output() what MetaPost drawing command (drawdot() or undrawdot()) to write to out_stream when outputting a Point.

When drawdot() or undrawdot() is called on a Point, the Point is copied and put onto the Picture, which was passed to drawdot() or undrawdot() as an argument (current_picture by default). drawdot_value is either set to Shape::DRAWDOT or Shape::UNDRAWDOT on the copy; this->drawdot is not set.

const Color* drawdot_color Private variable
Used to tell Point::output() what string to write to out_stream for the color when outputting a Point.

string pen Private variable
Used to tell Point::output() what string to write to out_stream for the pen when outputting a Point.

valarray<real> projective_extremes Protected variable
A set of 6 real values indicating the maximum and minumum x, y, and z-coordinates of the Point. Used for determining whether a Point is projectable with the parameters of a particular invocation of Picture::output(). See Picture Reference; Outputting.

Obviously, the maxima and minima will always be the same for a Point, namely the x, y, and z-coordinates. However, set_extremes() and get_extremes(), the functions that access projective_extremes, are pure virtual functions in class Shape, so the Point versions must be consistent with the versions for other types derived from Shape.

bool do_output Protected variable
true by default. Set to false by suppress_output(), which is called on a Shape by Picture::output(), if the Shape is not projectable. See Picture Reference; Outputting.

string measurement_units Public static variable
The unit of measurement for all distances within a Picture, "cm" (for centimeters) by default. The x and y-coordinates of the projected Points are always followed by measurement_units when they're written to out_stream. Unlike Metafont, units of measurement cannot be indicated for individual coordinates. Nor can measurement_unit be changed within a Picture.

When I write an input routine, I plan to make it behave the way Metafont does, however, 3DLDF will probably also convert all of the input values to a standard unit, as Metafont does.

real CURR_Y Public static variable
real CURR_Z Public static variable
Default values for the y and z-coordinate of Points, when the x-coordinate, or the x and y-coordinates only are specified. Both are 0 by default.

These values only used in the constructor and setting function taking one required real value (for the x-coordinate), and two optional real values (for the y and z-coordinates). They are not used when a Point is declared using the default constructor with no arguments. In this case, the x, y, and z-coordinates will all be 0. See Point Reference; Constructors and Setting Functions.

          Point A(1);
          A.show("A:");
          -| A: (1, 0, 0);
          CURR_Y = 5;
          A.set(2);
          A.show("A:");
          -| A: (2, 5, 0);
          CURR_Z = 12;
          Point B(3);
          B.show("B:");
          -| B: (3, 5, 12);
          Point C;
          C.show("C:");
          -| C: (0, 0, 0);