コード例 #1
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_testUnitaire_Click(object sender, EventArgs e)
        {
            bool v_afficherMessageSiko_vf = true;

            //
            FServicesApplicatifs.createTestsUnitairesLab().TestUnitairesLab(v_afficherMessageSiko_vf);
        }
コード例 #2
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_pentesTin_visuST_Click(object sender, EventArgs e)
        {
            int p_nbreClasses = 7;

            FVisualisationServices.createVisualisationSpatialTraceServices().GetVisuPentesFacettes(_topolFacettes, p_nbreClasses);
            FServicesApplicatifs.createVisuSpatialTrace().AfficheVisu();
            MessageBox.Show("Traitement terminé.");
        }
コード例 #3
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
 private void btn_visualisationSpatialTrace_Click(object sender, EventArgs e)
 {
     if (_dataPointsTests == null || _dataPointsTests.Count == 0)
     {
         MessageBox.Show("Générez d'abord les points.");
         return;
     }
     FServicesApplicatifs.createVisuSpatialTrace().GetVisuPointsAlti(_dataPointsTests);
     FServicesApplicatifs.createVisuSpatialTrace().AfficheVisu();
 }
コード例 #4
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_creteEtTalwegTin_visu_Click(object sender, EventArgs e)
        {
            HashSet <enum_qualificationMorpho_arc> v_exclureDeLaVisu = new HashSet <enum_qualificationMorpho_arc>();

            v_exclureDeLaVisu.Add(enum_qualificationMorpho_arc.autre);
            //v_exclureDeLaVisu.Add(enum_qualificationMorpho_arc.talweg);
            //v_exclureDeLaVisu.Add(enum_qualificationMorpho_arc.crete);

            FServicesApplicatifs.createVisuSpatialTrace().GetVisuCreteEtTalweg(_topolFacettes, v_exclureDeLaVisu);
            FServicesApplicatifs.createVisuSpatialTrace().AfficheVisu();
            MessageBox.Show("Traitement terminé.");
        }
コード例 #5
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_testsDivers_Click(object sender, EventArgs e)
        {
            ////TEST MATRICES 2D et changement référentiel
            //double[] v_decalage = new double[2];
            //v_decalage[0] += 10000;
            //v_decalage[1] += -10000;
            //FServicesApplicatifs.createTestsDivers().TestChangementReferentiel2D(_dataPointsTests, v_decalage);

            //
            //FServicesApplicatifs.createTestsDivers().TestCercleCirconscritAuTriangle();
            //FServicesApplicatifs.createTestsDivers().TestIsInCercleCirconscrit();
            FServicesApplicatifs.createTestsDivers().TestOrdonnancement();
        }
コード例 #6
0
        private void VisuCercleCirconscritAuTriangle(double[] v_pointA, double[] v_pointB, double[] v_pointC, string p_message)
        {
            List <double[]> v_pointsTriangle;

            v_pointsTriangle = new List <double[]>();
            v_pointsTriangle.Add(v_pointA);
            v_pointsTriangle.Add(v_pointB);
            v_pointsTriangle.Add(v_pointC);
            //
            SpatialTrace.Enable();
            SpatialTrace.TraceText(p_message);
            Color param_couleurContour = Color.FromArgb(125, 125, 125);

            SpatialTrace.SetLineColor(param_couleurContour);

            Color     p_couleurCourante;
            int       p_taillePoint;
            IGeometry v_pointGeom;

            double[] v_pointCentre;
            double   v_rayon;

            v_pointCentre = FServicesApplicatifs.createCalculServicesLow_testDivers().GetCoordonneesCercleCirconscritAuTriangle(v_pointsTriangle);
            v_rayon       = Math.Sqrt(Math.Pow((v_pointA[0] - v_pointCentre[0]), 2) + Math.Pow((v_pointA[1] - v_pointCentre[1]), 2));
            //Cercle
            p_couleurCourante = Color.FromArgb(50, 50, 50);
            v_pointGeom       = FLabServices.createUtilitaires().ConstructPoint(v_pointCentre[0], v_pointCentre[1], 2154).Buffer(v_rayon);
            SpatialTrace.TraceGeometry(v_pointGeom, "Cercle", "Cercle");

            //Points du triangle
            p_taillePoint     = 5;
            p_couleurCourante = Color.FromArgb(255, 0, 0);
            SpatialTrace.SetFillColor(p_couleurCourante);
            v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_pointA[0], v_pointA[1], 2154).Buffer(p_taillePoint);
            SpatialTrace.TraceGeometry(v_pointGeom, "Pt A", "Pt A");
            v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_pointB[0], v_pointB[1], 2154).Buffer(p_taillePoint);
            SpatialTrace.TraceGeometry(v_pointGeom, "Pt B", "Pt B");
            v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_pointC[0], v_pointC[1], 2154).Buffer(p_taillePoint);
            SpatialTrace.TraceGeometry(v_pointGeom, "Pt C", "Pt C");

            //Cercle
            p_taillePoint     = 8;
            p_couleurCourante = Color.FromArgb(0, 255, 0);
            SpatialTrace.SetFillColor(p_couleurCourante);
            v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_pointCentre[0], v_pointCentre[1], 2154).Buffer(p_taillePoint);
            SpatialTrace.TraceGeometry(v_pointGeom, "Centre", "Centre");

            SpatialTrace.Disable();
            //
        }
コード例 #7
0
        public void TestChangementReferentiel2D(IEnumerable <BeanPoint_internal> p_points, double[] p_vecteurDeDecalage)
        {
            Color  v_couleurObjet;
            string v_label;

            //POINTS REF
            double[]           v_coordCentroide = FServicesApplicatifs.createCalculServicesMedium_testDivers().GetCentroide(p_points);
            BeanPoint_internal v_centroide      = new BeanPoint_internal(v_coordCentroide, 2154);

            //
            double[] p_coordPointX = new double[3];
            p_coordPointX[0] = v_coordCentroide[0] + p_vecteurDeDecalage[0];
            p_coordPointX[1] = v_coordCentroide[1] + p_vecteurDeDecalage[1];
            p_coordPointX[2] = 0;
            BeanPoint_internal p_pointX = new BeanPoint_internal(p_coordPointX, 2154);

            //VISU POINTS REF
            v_couleurObjet = Color.FromArgb(255, 0, 0, 255);
            FVisualisationServices.createVisualisationSpatialTraceServices().GetVisuPoint2D(v_centroide, "Pt0", v_couleurObjet, 20);
            v_couleurObjet = Color.FromArgb(255, 0, 255, 0);
            FVisualisationServices.createVisualisationSpatialTraceServices().GetVisuPoint2D(p_pointX, "Pt1", v_couleurObjet, 20);
            //FIN VISU POINTS REF



            Dictionary <int, double[]> v_coordDansRef;

            v_coordDansRef = FServicesApplicatifs.createCalculServicesMedium_testDivers().GetCoordonneesDansNewReferentiel2D(p_points, v_coordCentroide, p_coordPointX, null);



            Dictionary <int, BeanPoint_internal> v_dicoPoints = p_points.ToDictionary(c => c.p00_id, c => c);

            //VISU COORD
            int param_arrondi = 2;

            v_couleurObjet = Color.FromArgb(255, 0, 0, 255);
            List <int> v_idPointsOrdonnes = v_coordDansRef.OrderBy(c => c.Value[1]).Select(c => c.Key).ToList();

            foreach (int v_id in v_idPointsOrdonnes)
            {
                v_label = "Pt: " + v_id + " => " + Math.Round(v_coordDansRef[v_id][0], param_arrondi) + " / " + Math.Round(v_coordDansRef[v_id][1], param_arrondi);
                FVisualisationServices.createVisualisationSpatialTraceServices().GetVisuPoint2D(v_dicoPoints[v_id], v_label, v_couleurObjet, 10);
            }
            FVisualisationServices.createVisualisationSpatialTraceServices().AfficheVisu();
            //FIN VISU COORD
        }
コード例 #8
0
        //
        private void TestIsInCercleCirconscrit(List <double[]> p_pointsTriangle, double[] p_pointToTest, string p_messageResultatAttendu)
        {
            bool v_estInclusDansCercleExplicite;
            bool v_estInclusDansCercleMatrice;

            v_estInclusDansCercleExplicite = FServicesApplicatifs.createCalculServicesLow_testDivers().IsPointDDansCercleCirconscritAuTriangleExplicite(p_pointsTriangle, p_pointToTest);
            v_estInclusDansCercleMatrice   = FServicesApplicatifs.createCalculServicesLow_testDivers().IsPointDDansCercleCirconscritAuTriangleByMatrice(p_pointsTriangle, p_pointToTest);
            //
            string v_label;

            v_label  = p_messageResultatAttendu + "\n";
            v_label += "  Résultats calcul";
            v_label += " =>'Explicite': " + v_estInclusDansCercleExplicite.ToString();
            v_label += " =>'Matrice':" + v_estInclusDansCercleMatrice.ToString();
            VisuCercleCirconscritAuTriangle(p_pointsTriangle[0], p_pointsTriangle[1], p_pointsTriangle[2], v_label);
            VisuPointSuppl(p_pointToTest, "Pt à tester", 3);
        }
コード例 #9
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_genererPointsReels_Click(object sender, EventArgs e)
        {
            string v_bbox           = "";
            string v_sainteVictoire = "POLYGON((5.523314005345696 43.576096090257955, 5.722441202611321 43.576096090257955, 5.722441202611321 43.46456490270913, 5.523314005345696 43.46456490270913, 5.523314005345696 43.576096090257955))";
            string v_eyger          = "Polygon((8.12951188622090193 46.634254667789655, 7.8854960299327308 46.63327193616965616, 7.89909222133881617 46.4319282954101098, 8.13595218741325965 46.43143509785498679, 8.12951188622090193 46.634254667789655))";
            string v_gorges         = "Polygon ((6.14901771150602894 43.8582708438193265, 6.30590241369230409 43.8575166880815317, 6.32080646040000005 43.74636314919661828, 6.14561854295865828 43.74579647280887684, 6.14901771150602894 43.8582708438193265))";

            if (rb_example_SteVictoire.Checked)
            {
                v_bbox = v_sainteVictoire;
            }
            if (rb_example_eyger.Checked)
            {
                v_bbox = v_eyger;
            }
            if (rb_example_Verdon.Checked)
            {
                v_bbox = v_gorges;
            }
            if (rb_example_WKT.Checked)
            {
                v_bbox = tb_wkt.Text;
            }


            DEMDataSet dataSet = null;

            if (rdSRTMGL3.Checked)
            {
                dataSet = DEMDataSet.SRTM_GL3;
            }
            else if (rdSRTMGL1.Checked)
            {
                dataSet = DEMDataSet.SRTM_GL1;
            }
            else
            {
                dataSet = DEMDataSet.AW3D30;
            }
            _dataPointsTests = FServicesApplicatifs.createEchantillonsTestsServices().GetPointsTestsByBBox(v_bbox, dataSet, int.Parse(txtSRID.Text));

            //Dictionary<string, int> v_doublons;
            //v_doublons=FLabServices.createCalculMedium().GetEtComptePointsDoublonnes(_dataPointsTests);
            MessageBox.Show("Remontée des points terminée (" + _dataPointsTests.Count + " points).");
        }
コード例 #10
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_testCH_Click(object sender, EventArgs e)
        {
            List <BeanPoint_internal> v_pointConvexHull;

            v_pointConvexHull = FLabServices.createCalculMedium().GetConvexHull2D(_dataPointsTests);

            //
            string v_message = "ConvexHull calculé";

            v_message += " (" + v_pointConvexHull.Count + " pts sur " + _dataPointsTests.Count + ").";
            v_message += ". Affichez dans SpatialTrace ?";
            if (MessageBox.Show(v_message, "Calcul convexHull", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
            {
                return;
            }

            string v_label       = "";
            Color  v_couleurBase = Color.FromArgb(255, 0, 255, 255);

            FServicesApplicatifs.createVisuSpatialTrace().GetVisuPoints2D(_dataPointsTests, v_label, v_couleurBase, -1);
            v_label = "CH";
            FServicesApplicatifs.createVisuSpatialTrace().GetVisuPoints2D(v_pointConvexHull, v_label, 10);

            SpatialTrace.Enable();
            IGeometry v_ligneCh;

            for (int v_indexPt = 0; v_indexPt < v_pointConvexHull.Count - 1; v_indexPt++)
            {
                v_ligneCh = FLabServices.createUtilitaires().GetGeometryLine(v_pointConvexHull[v_indexPt].p10_coord, v_pointConvexHull[v_indexPt + 1].p10_coord, 2154, true);
                SpatialTrace.TraceGeometry(v_ligneCh, "CH arc: " + v_indexPt, "CH arc: " + v_indexPt);
            }
            v_ligneCh = FLabServices.createUtilitaires().GetGeometryLine(v_pointConvexHull[v_pointConvexHull.Count - 1].p10_coord, v_pointConvexHull[0].p10_coord, 2154, true);
            SpatialTrace.TraceGeometry(v_ligneCh, "CH arc: " + (v_pointConvexHull.Count - 1), "CH arc: " + (v_pointConvexHull.Count - 1));
            SpatialTrace.Disable();
            FVisualisationServices.createVisualisationSpatialTraceServices().AfficheVisu();
            //
            MessageBox.Show("Traitement terminé.");
        }
コード例 #11
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
        private void btn_testVoronoi_Click(object sender, EventArgs e)
        {
            //
            int param_srid = 2154;

            if (_dataPointsTests == null || _dataPointsTests.Count == 0)
            {
                MessageBox.Show("Générez d'abord les points.");
                return;
            }
            //Il est impératif que tous les points soient distincts:
            Dictionary <string, List <BeanPoint_internal> > v_pourDeduplication;

            v_pourDeduplication = FLabServices.createUtilitaires().GetPointsRegroupesParHCode(_dataPointsTests);
            List <BeanPoint_internal> v_pointsDedupliques = v_pourDeduplication.SelectMany(c => c.Value).ToList();
            //
            BeanTopologieFacettes v_topolFacettes;

            v_topolFacettes = FLabServices.createVoronoiServices().GetTopologieVoronoi(v_pointsDedupliques, param_srid);
            FServicesApplicatifs.createVisuSpatialTrace().GetVisuArcsTopologie(v_topolFacettes, Color.Red, "Vor");
            FServicesApplicatifs.createVisuSpatialTrace().GetVisuIlots(v_topolFacettes, Color.Cyan, "Ilot V");
            FServicesApplicatifs.createVisuSpatialTrace().GetVisuPoints(v_pointsDedupliques, Color.Green, 3, "Pt");
        }
コード例 #12
0
ファイル: CtrlTestLab.cs プロジェクト: olihou/DEM.Net
 private void btn_genererPoints_Click(object sender, EventArgs e)
 {
     RemonteParametres();
     _dataPointsTests = FServicesApplicatifs.createEchantillonsTestsServices().GetPointsTests(_paramGenerationPoints);
     MessageBox.Show("Génération points tests terminée.");
 }
コード例 #13
0
        public void TestOrdonnancement()
        {
            double v_xMin = 1500000;
            double v_yMin = 6000000;
            //
            //double[] v_point1;
            //double[] v_point2;
            //double[] v_point3;
            Dictionary <int, double[]> v_points = new Dictionary <int, double[]>();

            bool v_renvoyerNullSiColineaire_vf;
            bool v_horaire_vf;

            ////Triangle 1
            //v_point1 = new double[2] { v_xMin + 50, v_yMin + 100 };
            //v_point2 = new double[2] { v_xMin, v_yMin };
            //v_point3 = new double[2] { v_xMin + 100, v_yMin};

            ////Triangle 2
            //v_point1 = new double[2] { v_xMin + 50, v_yMin + 100 };
            //v_point2 = new double[2] { v_xMin, v_yMin };
            //v_point3 = new double[2] { v_xMin + 100, v_yMin-50 };

            ////Triangle 3
            //v_point1 = new double[2] { v_xMin + 50, v_yMin + 100 };
            //v_point2 = new double[2] { v_xMin, v_yMin };
            //v_point3 = new double[2] { v_xMin + 100, v_yMin+500 };

            //v_points.Add(1, v_point1);
            //v_points.Add(2, v_point2);
            //v_points.Add(3, v_point3);

            //Groupe de points:

            BeanParamGenerationAutoDePointsTests v_paramGenerationPoints = new BeanParamGenerationAutoDePointsTests();

            v_paramGenerationPoints.p51_hauteurRefEnM     = 100;
            v_paramGenerationPoints.p31_nbrePoints        = 5;
            v_paramGenerationPoints.p11_pointBasGaucheX   = v_xMin;
            v_paramGenerationPoints.p12_pointBasGaucheY   = v_yMin;
            v_paramGenerationPoints.p13_pointHautDroitX   = v_xMin + v_paramGenerationPoints.p51_hauteurRefEnM;
            v_paramGenerationPoints.p14_pointHautDroitY   = v_yMin + v_paramGenerationPoints.p51_hauteurRefEnM;
            v_paramGenerationPoints.p32_pasEntrePointsEnM = 6;
            v_paramGenerationPoints.p32_seed = 13;
            List <BeanPoint_internal> v_pointsTests;

            v_pointsTests = FServicesApplicatifs.createEchantillonsTestsServices().GetPointsTests(v_paramGenerationPoints);
            int v_indice = 0;

            v_points = v_pointsTests.ToDictionary(c => v_indice++, c => c.p10_coord);
            //
            v_renvoyerNullSiColineaire_vf = true;
            v_horaire_vf = false;


            List <int> v_pointsOrdonnances;

            v_pointsOrdonnances = FServicesApplicatifs.createCalculServicesLow_testDivers().GetOrdonnancement(v_points, v_renvoyerNullSiColineaire_vf, v_horaire_vf);
            string v_sens = "hor.";

            if (!v_horaire_vf)
            {
                v_sens = "antih.";
            }

            int v_no = 1;

            foreach (int v_id in v_pointsOrdonnances)
            {
                VisuPointSuppl(v_points[v_id], "no: " + v_no + " (pt " + v_id + " " + v_sens + ")", 2);
                v_no++;
            }
            ////SpatialTrace.ShowDialog();
        }