Next: , Previous: Installing and Running 3DLDF, Up: Top


12 Typedefs and Utility Structures

3DLDF defines a number of data types for various reasons, e.g., for the sake of convenience, for use in conditional compilation, or as return values of functions. Some of these data types can be defined using typedef, while others are defined as structs.

The typedefs and utility structures described in this chapter are found in pspglb.web. Others, that contain objects of types defined in 3DLDF, are described in subsequent chapters.

— typedef: real

Synonymous either with float or double, depending on the values of the preprocessor variables LDF_REAL_FLOAT and LDF_REAL_DOUBLE. The meaning of real is determined by means of conditional compilation. If real is float, 3DLDF will require less memory than if real is double, but its calculations will be less precise. real is “typedeffed” to float by default.

— typedef: real_pair first second

Synonymous with pair<real, real>.

— struct: real_triple first second third

All three data elements of real_triple are reals. It also has two constructors, described below. There are no other member functions.

— Constructor: void real_triple (void)
— Constructor: void real_triple (real a, real b, real c)

The constructor taking no arguments sets first, second, and third to 0. The constructor taking three real arguments sets first to a, second to b, and third to c.

— typedef: Matrix

A Matrix is a 4 X 4 array of real, e.g., Matrix M; == real M[4][4]. It is used in class Transform for storing transformation matrices. See Transforms, and See Transform Reference, for more information.

— typedef: real_short first second

Synonymous with pair<real, signed short>. It is the return type of Plane::get_distance().

— typedef: bool_pair first second

Synonymous with pair<bool, bool>.

— typedef: bool_real first second

Synonymous with pair<bool, real>.