Next: , Previous: Picture Constructors, Up: Picture Reference


21.4 Operators

— Assignment operator: void operator= (const Picture& p)

Makes *this a copy of p, destroying the old contents of *this.

— Operator: void operator+= (const Picture& p)

Adds the contents of p to *this. p remains unchanged.

— Operator: void operator+= (Shape* s)

Puts s onto shapes. Note that the pointer s itself is put onto shapes, so any allocation and copying must be performed first. This is a low-level function that users normally won't need to use directly.

— Operator: void operator+= (Label* label)

Puts label onto labels. Note that the pointer label itself is put onto labels, so any allocation and copying must be performed first. This is a low-level function that users normally won't need to invoke directly.

— Operator: Transform operator*= (const Transform& t)

Multiplies transform by t. This has the effect of transforming all of the Shapes on shapes and all of the Points of the Labels on labels by t upon output.

          Transform t;
          t.rotate(0, 0, 180);
          t.shift(3);
          Reg_Polygon pl(origin, 5, 3, 90);
          pl.draw();
          pl.label();
          current_picture.output(Projections::PARALLEL_X_Y);
          current_picture *= t;
          current_picture.output(Projections::PARALLEL_X_Y);


[Figure 78. Not displayed.]

Fig. 78.