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



Constructors and Setting Functions

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

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]]]) Constructor
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.

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]]]) Setting function
Corresponds to the constructor described above.

void Rectangle (const Point& p0, const Point& p1, const Point& p2, const Point& p3) Constructor
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.

void set (const Point& pt0, const Point& pt1, const Point& pt2, const Point& pt3) Setting function
Corresponds to the constructor above.

Rectangle* create_new<Rectangle> (const Rectangle* r) Template specializations
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.