Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Surface3DRenderer"/> class. Calculates transformations coeficients.
 /// </summary>
 /// <param name="obsX">Observator's X position</param>
 /// <param name="obsY">Observator's Y position</param>
 /// <param name="obsZ">Observator's Z position</param>
 /// <param name="xs0">X coordinate of screen</param>
 /// <param name="ys0">Y coordinate of screen</param>
 /// <param name="screenWidth">Drawing area width in pixels.</param>
 /// <param name="screenHeight">Drawing area height in pixels.</param>
 /// <param name="screenDistance">The screen distance.</param>
 /// <param name="screenWidthPhys">Width of the screen in meters.</param>
 /// <param name="screenHeightPhys">Height of the screen in meters.</param>
 public Surface3DRenderer(double obsX, double obsY, double obsZ, int xs0, int ys0, int screenWidth,
                          int screenHeight, double screenWidthPhys, double screenHeightPhys, float[, ,] vals, Plot3D.Plot3DMainForm frame3D)
 {
     ReCalculateTransformationsCoeficients(obsX, obsY, obsZ, xs0, ys0, screenWidth, screenHeight, screenWidthPhys, screenHeightPhys);
     this.vals    = vals;
     this.frame3D = frame3D;
 }
        private void button11_Click(object sender, EventArgs e)
        {
            if (visual_cube == null)
            {
                MessageBox.Show("Select a valid Cube.");
                return;
            }
            Index3   start, end;
            ISubCube from;

            try
            {
                start = new Index3(0, 0, 0);
                end   = new Index3(visual_cube.NumSamplesIJK.I - 1, visual_cube.NumSamplesIJK.J - 1, visual_cube.NumSamplesIJK.K - 1);
                from  = visual_cube.GetSubCube(start, end);
            }
            catch (System.InvalidOperationException)
            {
                PetrelLogger.ErrorBox("NOT A PROPER INPUT CUBE");
                return;
            }
            float[, ,] vals = from.ToArray();
            Plot3D.Plot3DMainForm obj3D = new Plot3D.Plot3DMainForm(vals);
            obj3D.scube = visual_cube;
            obj3D.Show();
        }
        private void button11_Click(object sender, EventArgs e)
        {
            if (visual_cube == null)
            {
                MessageBox.Show("Select a valid Cube.");
                return;
            }
            Index3 start, end;
            ISubCube from;
            try
            {
                start = new Index3(0, 0, 0);
                end = new Index3(visual_cube.NumSamplesIJK.I - 1, visual_cube.NumSamplesIJK.J - 1, visual_cube.NumSamplesIJK.K - 1);
                from = visual_cube.GetSubCube(start, end);

            }
            catch (System.InvalidOperationException)
            {
                PetrelLogger.ErrorBox("NOT A PROPER INPUT CUBE");
                return;
            }
            float[, ,] vals = from.ToArray();
            Plot3D.Plot3DMainForm obj3D=new Plot3D.Plot3DMainForm(vals);
            obj3D.scube = visual_cube;
            obj3D.Show();
        }