Example #1
0
        public bool GetCamOri(Ex_OriPara exOriCamL, IFeatureClass pFeatureClass, int nID)
        {
            try
            {
                ExOriPara pExOriPara = new ExOriPara();
                InOriPara pInOriPara = new InOriPara();

                pExOriPara.ori.omg = exOriCamL.ori.omg;
                pExOriPara.ori.phi = exOriCamL.ori.phi;
                pExOriPara.ori.kap = exOriCamL.ori.kap;
                pExOriPara.pos.X   = exOriCamL.pos.X;
                pExOriPara.pos.Y   = exOriCamL.pos.Y;
                pExOriPara.pos.Z   = exOriCamL.pos.Z;

                pInOriPara.df  = 1226.23;
                pInOriPara.dfx = 512;
                pInOriPara.dfy = 512;
                pInOriPara.nW  = 1024;
                pInOriPara.nH  = 1024;
                //pInOriPara.dfx = 50;
                //pInOriPara.dfy = 50;
                //pInOriPara.nW = 100;
                //pInOriPara.nH = 100;

                //pInOriPara.df = CView.PointInformationList[i].f;
                //pInOriPara.dfx = CView.PointInformationList[i].fx;
                //pInOriPara.dfy = CView.PointInformationList[i].fy;
                //pInOriPara.nW = CView.PointInformationList[i].width;
                //pInOriPara.nH = CView.PointInformationList[i].height;

                ///////////////////////////////////////////////////////////
                //非逐点计算
                //DrawPolygon(pRasterDem, pExOriPara, pInOriPara, pFeatureClass, nID);

                ////////////////////////////////////////////////////////////////
                //逐点计算
                drawRaster(pRasterDem, pExOriPara, pInOriPara);
            }
            catch (SystemException e)
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        public void matlabCalc(Ex_OriPara ori)
        {
            string       fileDirPath = System.IO.Path.GetDirectoryName(textBoxPicFile.Text);
            string       fileName    = System.IO.Path.GetFileNameWithoutExtension(textBoxPicFile.Text);
            StreamWriter sw          = new StreamWriter(fileDirPath + "\\" + fileName + "_para.txt", false, Encoding.ASCII);

            textBoxParaFile.Text = fileDirPath + "\\" + fileName + "_para.txt";
            double angle;

            angle = doubleInputSunAngle.Value;
            sw.Write(angle.ToString());
            sw.Write("  %太阳方位角,北向为0,-180°(逆时针) 至180°(顺时针)");
            //sw.Write("\n");
            sw.WriteLine();
            //sw.Write("1.22623");
            //sw.Write("0.05");
            sw.Write(doubleInputForcusDis.Value.ToString());
            sw.Write("  %f焦距,像素");
            // sw.Write("\n");
            sw.WriteLine();
            //sw.Write("511.5");
            //sw.Write("587.5");
            sw.Write(doubleInputX0.Value.ToString());
            sw.Write("  %x0");
            //sw.Write("\n");
            sw.WriteLine();
            //sw.Write("511.5");
            //sw.Write("431.5");
            sw.Write(doubleInputY0.Value.ToString());
            sw.Write("  %y0");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.pos.X);
            sw.Write("  %Xs,m%摄影中心位置");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.pos.Y);
            sw.Write("  %Ys");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.pos.Z);
            sw.Write("  %Zs");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.ori.omg * 180 / Math.PI);
            sw.Write("  %omg像点从像空间坐标系转换到站点坐标系的旋转角");
            //sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.ori.phi * 180 / Math.PI);
            sw.Write("  %phi");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.ori.kap * 180 / Math.PI);
            sw.Write("  %Kap");
            //sw.Write("\n");
            sw.WriteLine();
            sw.Flush();
            sw.Close();

            string exepath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Skyline\funTianJiXian.exe";
            //string exepath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\rob.exe";
            string ParafilePath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Skyline\DetectionPara.txt";

            //ProcessStartInfo startInfo = new ProcessStartInfo(exepath, textBoxPicFile.Text + " " + textBoxParaFile.Text + " "
            //    + ParafilePath);

            //Process p = new Process();
            //p.StartInfo.FileName = excutefile;
            //p.StartInfo.Arguments = excutecmd;
            //p.StartInfo.UseShellExecute = false;
            //p.StartInfo.RedirectStandardInput = true;
            //p.StartInfo.RedirectStandardOutput = true;
            //p.StartInfo.RedirectStandardError = true;
            //p.StartInfo.CreateNoWindow = true;

            //p.Start();
            //p.StandardInput.WriteLine("exit");
            //strOutput = p.StandardOutput.ReadToEnd();

            //p.WaitForExit();
            //p.Close();



            // myprocess.StartInfo = startInfo;


            myprocess.StartInfo.CreateNoWindow  = false;
            myprocess.StartInfo.UseShellExecute = false;

            myprocess.StartInfo.RedirectStandardInput  = true;
            myprocess.StartInfo.RedirectStandardOutput = true;
            myprocess.StartInfo.RedirectStandardError  = true;
            myprocess.StartInfo.Arguments = textBoxPicFile.Text + " " + textBoxParaFile.Text + " "
                                            + ParafilePath;
            myprocess.StartInfo.FileName = exepath;
            myprocess.Start();
            string outPut = myprocess.StandardOutput.ReadToEnd();

            myprocess.StandardInput.WriteLine("exit");
            myprocess.WaitForExit();
        }