Inheritance: Figure, IFlat, IAreaMeasurable
 public override void ExecuteFigureCreationCommand(string[] str)
 {
     switch (str[0])
     {
         case "circle":
             {
                 currentFigure = new Circle(Vector3D.Parse(str[1]), double.Parse(str[2]));
                 break;
             }
         case "cylinder":
             {
                 currentFigure = new Cylinder(Vector3D.Parse(str[1]), Vector3D.Parse(str[2]), double.Parse(str[3]));
                 break;
             }
     }
     base.ExecuteFigureCreationCommand(str);
 }
 public override void ExecuteFigureCreationCommand(string[] splitFigString)
 {
     switch (splitFigString[0])
     {
         case "circle":
             {
                 Vector3D centre = Vector3D.Parse(splitFigString[1]);
                 currentFigure = new Circle(centre, double.Parse(splitFigString[2]));
                 break;
             }
         case "cylinder":
             {
                 Vector3D bottom = Vector3D.Parse(splitFigString[1]);
                 Vector3D top = Vector3D.Parse(splitFigString[2]);
                 currentFigure = new Cylinder(bottom, top,
                     double.Parse(splitFigString[3]));
                 break;
             }
         default:
             base.ExecuteFigureCreationCommand(splitFigString);
             break;
     }
     this.EndCommandExecuted = false;
 }
Beispiel #3
0
 // Methods
 public override void ExecuteFigureCreationCommand(string[] splitFigString)
 {
     switch (splitFigString[0])
     {
         case "circle":
             {
                 Vector3D center = Vector3D.Parse(splitFigString[1]);
                 double radius = double.Parse(splitFigString[2]);
                 currentFigure = new Circle(center, radius);
                 break;
             }
         case "cylinder":
             {
                 Vector3D top = Vector3D.Parse(splitFigString[1]);
                 Vector3D bottom = Vector3D.Parse(splitFigString[2]);
                 double radius = double.Parse(splitFigString[3]);
                 currentFigure = new Cylinder(top, bottom, radius);
                 break;
             }
     }
     base.ExecuteFigureCreationCommand(splitFigString);
 }
Beispiel #4
0
 public override void ExecuteFigureCreationCommand(string[] splitFigString)
 {
     if (splitFigString[0] == "circle")
     {
         Vector3D location = Vector3D.Parse(splitFigString[1]);
         double radius = double.Parse(splitFigString[2]);
         currentFigure = new Circle(location, radius);
     }
     else if (splitFigString[0] == "cylinder")
     {
         Vector3D bottom = Vector3D.Parse(splitFigString[1]);
         Vector3D top = Vector3D.Parse(splitFigString[2]);
         double radius = double.Parse(splitFigString[3]);
         currentFigure = new Cylinder(bottom, top, radius);
     }
     else
     {
         base.ExecuteFigureCreationCommand(splitFigString);
     }
     this.EndCommandExecuted = false;
 }
 public override void ExecuteFigureCreationCommand(string[] splitFigString)
 {
     base.ExecuteFigureCreationCommand(splitFigString);
     switch (splitFigString[0])
     {
         case "circle":
             {
                 Vector3D a = Vector3D.Parse(splitFigString[1]);
                 double radius = double.Parse(splitFigString[2]);
                 currentFigure = new Circle(a, radius);
                 break;
             }
         case "cylinder":
             {
                 Vector3D a = Vector3D.Parse(splitFigString[1]);
                 Vector3D b = Vector3D.Parse(splitFigString[2]);
                 double radius = double.Parse(splitFigString[3]);
                 currentFigure = new Cylinder(a, b, radius);
                 break;
             }
     }
 }