PhysicalShape shape;
ShapesController controller=new ShapesController();
for(int i=0;i<count;i++){
shapeDefiner=shapeSketches[i];
if(shapeDefiner instanceof ShapesLineDefiner.CircleDefiner){
shape=new Circle(controller,shapeDefiner.getPosition(),((ShapesLineDefiner.CircleDefiner)shapeDefiner).getRadius(),shapeDefiner.getColor());
}else if(shapeDefiner instanceof ShapesLineDefiner.RectangleDefiner){
shape=new Rectangle(controller,shapeDefiner.getPosition(),shapeDefiner.getAngle(),((ShapesLineDefiner.RectangleDefiner)shapeDefiner).getWidth(),((ShapesLineDefiner.RectangleDefiner)shapeDefiner).getHeight(),shapeDefiner.getColor());
}else{
shape=new Polygon(controller,shapeDefiner.getPosition(),shapeDefiner.getAngle(),((ShapesLineDefiner.PolygonDefiner)shapeDefiner).getVertices(),shapeDefiner.getColor());
}