Пример #1
0
        //Purpose: returns the string represent representation of the cube
        //Requires: nothing
        //Returns: a string
        public override string ToString()
        {
            string cuboidSpecs;
            string P1, P2, P3, P4, P5, P6, P7, P8;

            P1 = p1.toString3D();
            P2 = p2.toString3D();
            P3 = p3.toString3D();
            P4 = p4.toString3D();
            P5 = p5.toString3D();
            P6 = p6.toString3D();
            P7 = p7.toString3D();
            P8 = p8.toString3D();

            cuboidSpecs  = base.ToString() + Environment.NewLine;
            cuboidSpecs += "Length: " + length + Environment.NewLine;
            cuboidSpecs += "Width: " + width + Environment.NewLine;
            cuboidSpecs += "Height: " + height + Environment.NewLine;
            cuboidSpecs += "Points: P1" + P1 + " P2" + P2 + Environment.NewLine
                           + "P3" + P3 + " P4" + P4 + Environment.NewLine +
                           "P5" + P5 + " P6" + P6 + Environment.NewLine +
                           "P7" + P7 + " P8" + P8;

            return(cuboidSpecs);
        }
Пример #2
0
        //Purpose: returns the string represent representation of the Sphere
        //Requires: nothing
        //Returns: a string
        public override string ToString()
        {
            string sphereSpecs;
            string P1;

            P1 = c1.toString3D();

            sphereSpecs  = base.ToString() + Environment.NewLine;
            sphereSpecs += "Radius: " + radius + Environment.NewLine;
            sphereSpecs += "Center Point: P1" + P1 + Environment.NewLine;

            return(sphereSpecs);
        }
Пример #3
0
        //Purpose: returns the string represent representation of the cylinder
        //Requires: nothing
        //Returns: a string
        public override string ToString()
        {
            string cylinderSpecs;
            string P1, P2;

            P1 = c1.toString3D();
            P2 = c2.toString3D();


            cylinderSpecs  = base.ToString() + Environment.NewLine;
            cylinderSpecs += "Radius: " + radius + Environment.NewLine;
            cylinderSpecs += "Height: " + height + Environment.NewLine;
            cylinderSpecs += "Points: P1" + P1 + " P2" + P2 + Environment.NewLine;

            return(cylinderSpecs);
        }