Inheritance: Figure, IAreaMeasurable, IVolumeMeasurable
 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);
 }
Exemplo n.º 2
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)
        {
            switch (splitFigString[0])
            {
            case "circle":
            {
                Vector3D center = Vector3D.Parse(splitFigString[1]);
                currentFigure = new Circle(center, 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;
            }
            }

            base.ExecuteFigureCreationCommand(splitFigString);
        }
Exemplo n.º 4
0
        public override void ExecuteFigureCreationCommand(string[] splitFigString)
        {
            switch (splitFigString[0])
            {
            case "circle":
            {
                Vector3D location = Vector3D.Parse(splitFigString[1]);
                double   radius   = double.Parse(splitFigString[2]);
                currentFigure = new Circle(location, 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);
        }
Exemplo n.º 5
0
        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;
            }
            }
        }
Exemplo n.º 6
0
        public override void ExecuteFigureCreationCommand(string[] splitFigString)
        {
            switch (splitFigString[0])
            {
            case "circle":
            {
                currentFigure = new Circle(Vector3D.Parse(splitFigString[1]), double.Parse(splitFigString[2]));
                break;
            }

            case "cylinder":
            {
                currentFigure = new Cylinder(Vector3D.Parse(splitFigString[1]), Vector3D.Parse(splitFigString[2]), double.Parse(splitFigString[3]));
                break;
            }

            default:
            {
                base.ExecuteFigureCreationCommand(splitFigString);
                break;
            }
            }
            this.EndCommandExecuted = false;
        }
 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;
 }
Exemplo n.º 8
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);
 }
Exemplo n.º 9
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;
 }
Exemplo n.º 10
0
 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;
             }
     }
 }