JWS C++ Library
C++ language utility library
jwscxx::graphics::Cuboid_f Class Reference

Cuboid defined by a width, height and length at the origin or a specified postion. More...

#include <cuboid.h>

Inheritance diagram for jwscxx::graphics::Cuboid_f:
Collaboration diagram for jwscxx::graphics::Cuboid_f:

List of all members.

Public Member Functions

 Cuboid_f (float width, float height, float length) throw (jwscxx::base::Arg_error)
 Constructs a cuboid at the origin.
 Cuboid_f (float width, float height, float length, float x, float y, float z) throw (jwscxx::base::Arg_error)
 Constructs a cuboid at a particular location.
 Cuboid_f (float width, float height, float length, const jwsc::Vector_f *p) throw (jwscxx::base::Arg_error)
 Constructs a cuboid at a particular location.
 Cuboid_f (const Cuboid_f &c)
 Constructs a cuboid by copying another.
 Cuboid_f (const char *fname) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error)
 Reads a cuboid from an input file.
 Cuboid_f (std::istream &in) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error)
 Reads a cuboid from an input stream.
virtual ~Cuboid_f ()
 Deletes this cuboid.
virtual Cuboid_foperator= (const Cuboid_f &c)
 Copies a cuboid into this one.
virtual Cuboid_fclone () const
 Clones this cuboid.

Detailed Description

Cuboid defined by a width, height and length at the origin or a specified postion.

Definition at line 70 of file cuboid.h.


Constructor & Destructor Documentation

Cuboid_f::Cuboid_f ( float  width,
float  height,
float  length 
) throw (jwscxx::base::Arg_error)

Constructs a cuboid at the origin.

The mapping of width, height and length to the ordinates is as follows:

                                   height
                                      y
        +------------+                +
        |\           |\               |
        |  +------------+             |
        |  |         |  |             |
        |  |         |  |    ---->    |
        |  |         |  |             |
        +--|---------+  |           O +------------+ x width
         \ |          \ |              \
           +------------+               +
                                         z
                                       length
Parameters:
widthWidth along x.
heightHeight along y.
lengthLengthh along z.
Exceptions:
jwscxx::base::Arg_errorDimensions must be > 0.
See also:
jwscxx::graphics::Parapiped_f For information about face indices.

Definition at line 95 of file cuboid.cpp.

Cuboid_f::Cuboid_f ( float  width,
float  height,
float  length,
float  x,
float  y,
float  z 
) throw (jwscxx::base::Arg_error)

Constructs a cuboid at a particular location.

The mapping of width, height and length to the ordinates is as follows:

                                   height
                                      y
        +------------+                +
        |\           |\               |
        |  +------------+             |
        |  |         |  |             |
        |  |         |  |    ---->    |
        |  |         |  |             |
        +--|---------+  |     (x,y,z) +------------+ x width
         \ |          \ |              \
           +------------+               +
                                         z
                                       length
Parameters:
widthWidth along x.
heightHeight along y.
lengthLengthh along z.
xX-coord to position the corner of the cuboid at.
yY-coord to position the corner of the cuboid at.
zZ-coord to position the corner of the cuboid at.
Exceptions:
jwscxx::base::Arg_errorDimensions must be > 0.
See also:
jwscxx::graphics::Parapiped_f For information about face indices.

Definition at line 137 of file cuboid.cpp.

Cuboid_f::Cuboid_f ( float  width,
float  height,
float  length,
const jwsc::Vector_f *  p 
) throw (jwscxx::base::Arg_error)

Constructs a cuboid at a particular location.

The mapping of width, height and length to the ordinates is as follows:

                                   height
                                      y
        +------------+                +
        |\           |\               |
        |  +------------+             |
        |  |         |  |             |
        |  |         |  |    ---->    |
        |  |         |  |             |
        +--|---------+  |           p +------------+ x width
         \ |          \ |              \
           +------------+               +
                                         z
                                       length
Parameters:
widthWidth along x.
heightHeight along y.
lengthLengthh along z.
pPosition of the primary corner of the cuboid.
Exceptions:
jwscxx::base::Arg_errorDimensions must be > 0. Vector postition must be in R^3.
See also:
jwscxx::graphics::Parapiped_f For information about face indices.

Definition at line 185 of file cuboid.cpp.

Cuboid_f::Cuboid_f ( const Cuboid_f c)

Constructs a cuboid by copying another.

Parameters:
cCuboid to copy into this one.

Definition at line 214 of file cuboid.cpp.

Cuboid_f::Cuboid_f ( const char *  fname) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error)

Reads a cuboid from an input file.

The file format is big-endian binary.

Parameters:
fnameInput file to read this cuboid from.
Exceptions:
jwscxx::base::IO_errorCould not read from in.
jwscxx::base::Arg_errorInvalid arguments in file to read from.

Definition at line 227 of file cuboid.cpp.

Cuboid_f::Cuboid_f ( std::istream &  in) throw (jwscxx::base::Arg_error, jwscxx::base::IO_error)

Reads a cuboid from an input stream.

The file format is big-endian binary.

Parameters:
inInput stream to read this cuboid from.
Exceptions:
jwscxx::base::IO_errorCould not read from in.
jwscxx::base::Arg_errorInvalid arguments in file to read from.

Definition at line 243 of file cuboid.cpp.

Cuboid_f::~Cuboid_f ( ) [virtual]

Deletes this cuboid.

Definition at line 251 of file cuboid.cpp.


Member Function Documentation

Cuboid_f & Cuboid_f::operator= ( const Cuboid_f c) [virtual]

Copies a cuboid into this one.

Parameters:
cCuboid to copy into this one.
Returns:
A reference to this cuboid.

Definition at line 261 of file cuboid.cpp.

Cuboid_f * Cuboid_f::clone ( ) const [virtual]

Clones this cuboid.

Returns:
A new copy of this cuboid.

Reimplemented from jwscxx::graphics::Parapiped_f.

Definition at line 270 of file cuboid.cpp.


The documentation for this class was generated from the following files: