Node: Regular Polygon Constructors and Setting Functions, Next: Regular Polygon Operators, Previous: Regular Polygon Data Members, Up: Regular Polygon Reference
void Reg_Polygon (void) | Default constructor |
Creates an empty Reg_Polygon .
|
void Reg_Polygon (const Point& ccenter, const unsigned short ssides, const real ddiameter, [const real angle_x = 0, [const real angle_y = 0, [const real angle_z = 0]]]) | Constructor |
Creates a Reg_Polygon in the x-z plane, centered at the origin,
with the number of sides specified by ssides and with
radius = ddiameter / 2.
The Reg_Polygon r(origin, 3, 2.75, 10, 15, 12.5); r.draw();
|
void set (const Point& ccenter, const unsigned short ssides, const real ddiameter, [const real angle_x = 0, [const real angle_y = 0, [const real angle_z = 0]]]) | Setting function |
Corresponds to the constructor above.
A Reg_Polygon r; real j = .5; for (int i = 3; i <= 16; ++i) { r.set(origin, i, j); r.draw(); j += .5; }
|
Reg_Polygon* create_new<Reg_Polygon> (const Reg_Polygon* r) | Template specializations |
Reg_Polygon* create_new<Reg_Polygon> (const Reg_Polygon& r) |
Pseudo-constructors for dynamic allocation of Reg_Polygons .
They create a Reg_Polygon on the free store and allocate memory for it using
new(Reg_Polygon) . They return a pointer to the new Reg_Polygon .
If r is a non-zero pointer or a reference,
the new Reg_Polygon 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<Reg_Polygon>() as its argument.
See Dynamic Allocation of Shapes, for more information.
|