Next: , Previous: Rectangle Data Members, Up: Rectangle Reference


29.2 Constructors and Setting Functions

— Default constructor: void Rectangle (void)

Creates an empty Rectangle.

— Constructor: void Rectangle (const Point& ccenter, const real aaxis_h, const real aaxis_v, [const real angle_x = 0, [const real angle_y = 0, [const real angle_z = 0]]])

Creates a Rectangle in the x-z plane, centered at the origin, with width == aaxis_h (in the + or - x direction), and height == aaxis_v (in the + or - z direction). If one or more of the arguments angle_x, angle_y, or angle_z are used, it is rotated by those amounts around the appropriate axes. Finally, the Rectangle is shifted such that its center lies at ccenter.

          Point C(-1, -1, 1);
          Rectangle r(C, 3, 4, 30, 30, 30);


[Figure 151. Not displayed.]

Fig. 151.

— Setting function: void set (const Point& ccenter, const real aaxis_h, const real aaxis_v, [const real angle_x = 0, [const real angle_y = 0, [const real angle_z = 0]]])

Corresponds to the constructor described above.

— Constructor: void Rectangle (const Point& p0, const Point& p1, const Point& p2, const Point& p3)

Creates Rectangle using four Point arguments. The order of the arguments must correspond with a path around the Rectangle.

This function does not currently check that the arguments yield a valid Rectangle, therefore all code using it must ensure that they do.

— Setting function: void set (const Point& pt0, const Point& pt1, const Point& pt2, const Point& pt3)

Corresponds to the constructor above.

— Template specializations: Rectangle* create_new<Rectangle> (const Rectangle* r)
— : Rectangle* create_new<Rectangle> (const Rectangle& r)

Pseudo-constructors for dynamic allocation of Rectangles. They create a Rectangle on the free store and allocate memory for it using new(Rectangle). They return a pointer to the new Rectangle.

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