@c typeglb.texi
         
@c This file is part of the 3DLDF User and Reference Manual.
@c Copyright (C) 2003, 2004 Laurence D. Finston 
@c See the section "GNU Free Documentation License" in the file 
@c fdl.texi for copying conditions.

@c $Id: typeglb.texi,v 1.4 2004/01/12 18:43:34 lfinsto1 Exp lfinsto1 $

@comment  node-name,  next,  previous,  up
@node Typedefs and Utility Structures, Global Constants and Variables, Installing and Running 3DLDF, Top
@chapter 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
@code{typedef}, while others are defined as @code{structs}.

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

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


@deftp typedef real_pair first second
Synonymous with @code{pair<real, real>}.
@end deftp

@deftp struct real_triple first second third
All three data elements of @code{real_triple} are @code{reals}.  
It also has two constructors, described below.  There are no other
member functions.
@end deftp 

@deftypefn Constructor void real_triple (void)
@deftypefnx Constructor void real_triple (real @var{a}, real @var{b}, real @var{c})
The constructor taking no arguments sets @code{first}, @code{second},
and @code{third} to 0.  The constructor taking three @code{real}
arguments sets @code{first} to @var{a}, @code{second} to @var{b}, and
@code{third} to @var{c}. 
@end deftypefn 

@deftp typedef Matrix
A @code{Matrix} is a @BYM{4,4} array of @code{real}, e.g., 
@code{Matrix M;} @equiv{} @code{real M[4][4]}. 
It is used in @code{class Transform} for storing transformation
matrices.  @xref{Transforms}, and @xref{Transform Reference}, for more
information. 
@end deftp

@deftp typedef real_short first second
Synonymous with @code{pair<real, signed short>}.
It is the return type of @code{Plane::get_distance()}.
@end deftp 

@deftp typedef bool_pair first second
Synonymous with @code{pair<bool, bool>}.
@end deftp

@deftp typedef bool_real first second
Synonymous with @code{pair<bool, real>}.
@end deftp



 
