Node:Cuboid Constructors and Setting Functions, Next:, Previous:Cuboid Data Members, Up:Cuboid Reference



Constructors and Setting Functions

void Cuboid (void) Default constructor
Creates an empty Cuboid.

void Cuboid (const Cuboid& c) Copy constructor
Creates a new Cuboid and makes it a copy of c.

void Cuboid (const Point& c, const real h, const real w, const real d, [const real x = 0, [const real y = 0, [const real z = 0]]]) Constructor
Creates a Cuboid with center at the origin, with height == h, width == w, and depth == d. If x, y, or z is non-zero, the Cuboid is rotated by the amounts indicated around the corresponding main axes. Finally, the Cuboid is shifted such that center comes to lie at c.
          Point P(-3, -2, 12);
          Cuboid c(P, 3, 5, 2.93, 35, 10, 60);
          


[Figure 186. Not displayed.]

Fig. 186.

Cuboid* create_new<Cuboid> (const Cuboid* c) Template specializations
Cuboid* create_new<Cuboid> (const Cuboid& c)
Pseudo-constructors for dynamic allocation of Cuboids. They create a Cuboid on the free store and allocate memory for it using new(Cuboid). They return a pointer to the new Cuboid.

If c is a non-zero pointer or a reference, the new Cuboid will be a copy of c. If the new object is not meant to be a copy of an existing one, 0 must be passed to create_new<Cuboid>() as its argument. See Dynamic Allocation of Shapes, for more information.

void ~Cuboid (void) Destructor
Deallocates the Rectangles pointed to by the pointers on rectangles (a Solid data member), and calls rectangles.clear(). Cuboids consist entirely of Rectangles, so nothing must be done to the other vectors.