improving the factory of shapes

It is a partial advance in the factory of shapes. 
in this Pull request was added the bounding box for the rectangle.