Exemplo n.º 1
0
        //
        public void GetVisuArc2D(BeanArc_internal p_arc, string p_label, Color p_couleurCourante)
        {
            //SpatialTrace.Enable();
            string v_message;

            //SpatialTrace.SetFillColor(p_couleurCourante);
            //SpatialTrace.SetLineColor(p_couleurCourante);

            v_message = "arc " + p_arc.p00_idArc + " (" + p_arc.p01_hcodeArc + ")";
            if (p_label != "")
            {
                v_message += " " + p_label;
            }
            bool     v_generePointSiConfondus_vf = true;
            Geometry v_lineGeom;

            v_lineGeom = FLabServices.createUtilitaires().GetGeometryArc(p_arc, v_generePointSiConfondus_vf);
            if (v_lineGeom.OgcGeometryType != OgcGeometryType.LineString)
            {
                v_message += " PB GEOM (Arc est: " + v_lineGeom.OgcGeometryType + ")";
            }
            //SpatialTrace.TraceGeometry(v_lineGeom, v_message, v_message);
            //
            //GetVisuPoint2D(p_arc.p11_pointDbt, " =>Dbt>", p_couleurCourante, 10);
            //GetVisuPoint2D(p_arc.p12_pointFin, " =>Fin>", p_couleurCourante, 10);
            //SpatialTrace.Disable();
        }
Exemplo n.º 2
0
        //
        public void GetVisuVecteur2D(double[] p_vecteur, double[] p_origine, int p_srid, string p_label, Color p_couleurCourante, double p_coeff = 1)
        {
            try
            {
                string   v_message     = p_label;
                double[] v_coordPoint2 = new double[2] {
                    p_origine[0], p_origine[1]
                };
                v_coordPoint2[0] += (p_vecteur[0] * p_coeff);
                v_coordPoint2[1] += (p_vecteur[1] * p_coeff);
                bool     ifPt1AndPt2IqualReturnPointElseNull = true;
                Geometry v_lineGeom = FLabServices.createUtilitaires().GetGeometryLine(p_origine, v_coordPoint2, p_srid, ifPt1AndPt2IqualReturnPointElseNull);
                if (v_lineGeom.OgcGeometryType != OgcGeometryType.LineString)
                {
                    v_message += " PB GEOM (Arc est: " + v_lineGeom.OgcGeometryType + ")";
                }
                //
                //SpatialTrace.Enable();
                ////SpatialTrace.SetFillColor(p_couleurCourante);
                //SpatialTrace.SetLineColor(p_couleurCourante);

                //SpatialTrace.TraceGeometry(v_lineGeom, p_label, p_label);
                //SpatialTrace.Disable();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 3
0
        public void GetVisuPoint2D(BeanPoint_internal p_point, string p_label, Color p_couleurCourante, int p_taillePoint)
        {
            Color param_couleurContour = Color.FromArgb(125, 125, 125);

            if (p_taillePoint <= 0)
            {
                p_taillePoint = 1;
            }
            //
            //SpatialTrace.Enable();
            string   v_message = "";
            Geometry v_pointGeom;

            //SpatialTrace.SetFillColor(p_couleurCourante);
            //SpatialTrace.SetLineColor(param_couleurContour);

            v_message = "Pt " + p_point.p00_id + " (" + p_point.p10_coord[2] + " m)";
            if (p_label != "")
            {
                v_message += " " + p_label;
            }
            v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(p_point.p10_coord[0], p_point.p10_coord[1], p_point.p11_srid).Buffer(p_taillePoint);
            //SpatialTrace.TraceGeometry(v_pointGeom, v_message, v_message);

            //SpatialTrace.Disable();
        }
Exemplo n.º 4
0
        public void GetVisuFacette(BeanFacette_internal p_facette, string p_label, Color p_couleurCourante, bool p_visualiserPointsInclus_vf, bool p_afficherMemeSiInvalide_vf)
        {
            Color param_couleurContour = Color.FromArgb(125, 125, 125);
            Color param_couleurPoint   = Color.FromArgb(200, 200, 200);

            //SpatialTrace.Enable();

            //SpatialTrace.SetFillColor(p_couleurCourante);
            //SpatialTrace.SetLineColor(param_couleurContour);
            //
            List <double[]> v_coord = p_facette.p01_pointsDeFacette.Select(c => c.p10_coord).ToList();
            Geometry        v_polygone;

            v_polygone = FLabServices.createUtilitaires().GetGeometryPolygon(v_coord, p_facette.p01_pointsDeFacette.First().p11_srid);
            if (!p_afficherMemeSiInvalide_vf && !v_polygone.IsValid)
            {
                return;
            }
            string v_label = p_label + " fac: " + p_facette.p00_idFacette;

            //SpatialTrace.TraceGeometry(v_polygone, v_label, v_label);
            //

            if (p_visualiserPointsInclus_vf)
            {
                foreach (BeanPoint_internal v_point in p_facette.p10_pointsInclus)
                {
                    GetVisuPoint2D(v_point, "=>Fac " + p_facette.p00_idFacette, param_couleurPoint, 5);
                }
            }

            //SpatialTrace.Disable();
        }
Exemplo n.º 5
0
 public void GetVisuPointsAlti(Dictionary <string, List <BeanPoint_internal> > p_pointsParClasse, Dictionary <string, Color> p_tableCouleurs, int p_taillePoint)
 {
     try
     {
         //SpatialTrace.Enable();
         Color    v_couleurCourante;
         string   v_message;
         Geometry v_pointGeom;
         foreach (KeyValuePair <string, List <BeanPoint_internal> > v_classe in p_pointsParClasse)
         {
             v_couleurCourante = p_tableCouleurs[v_classe.Key];
             //SpatialTrace.SetFillColor(v_couleurCourante);
             //SpatialTrace.SetLineColor(v_couleurCourante);
             foreach (BeanPoint_internal v_point in v_classe.Value)
             {
                 v_message   = "Pt " + v_point.p00_id + " (" + v_point.p10_coord[2] + " m)";
                 v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_point.p10_coord[0], v_point.p10_coord[1], v_point.p11_srid).Buffer(p_taillePoint);
                 //SpatialTrace.TraceGeometry(v_pointGeom, v_message, v_message);
             }
         }
         //SpatialTrace.Disable();
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 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();
            //
        }
Exemplo n.º 7
0
        private void VisuPointSuppl(double[] p_point, string p_message, int p_tailleDuPoint)
        {
            //SpatialTrace.Enable();

            Color param_couleurContour = Color.FromArgb(125, 125, 125);
            //SpatialTrace.SetLineColor(param_couleurContour);
            Color    p_couleurCourante;
            Geometry v_pointGeom;

            p_couleurCourante = Color.FromArgb(50, 50, 50);
            //SpatialTrace.SetFillColor(p_couleurCourante);
            v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(p_point[0], p_point[1], 2154).Buffer(p_tailleDuPoint);
            //SpatialTrace.TraceGeometry(v_pointGeom, p_message, p_message);
            //SpatialTrace.Disable();
        }
Exemplo n.º 8
0
        internal List <BeanPoint_internal> GetPointsTestsXY_RepartitionUniforme(BeanParamGenerationAutoDePointsTests p_paramGenerationPointsTest)
        {
            List <BeanPoint_internal> v_pointsToTest = new List <BeanPoint_internal>();

            try
            {
                Random   v_random = new Random(p_paramGenerationPointsTest.p32_seed);
                double[] v_coord;
                //[Attention: nécessité de passer en int)
                int v_minX = Convert.ToInt32(Math.Round(p_paramGenerationPointsTest.p11_pointBasGaucheX, 0));
                int v_maxX = Convert.ToInt32(Math.Round(p_paramGenerationPointsTest.p13_pointHautDroitX, 0));
                int v_minY = Convert.ToInt32(Math.Round(p_paramGenerationPointsTest.p12_pointBasGaucheY, 0));
                int v_maxY = Convert.ToInt32(Math.Round(p_paramGenerationPointsTest.p14_pointHautDroitY, 0));
                //
                HashSet <string> p_codes = new HashSet <string>();
                string           p_code;
                int v_no = 0;
                for (v_no = 1; v_no <= p_paramGenerationPointsTest.p31_nbrePoints;)
                {
                    v_coord    = new double[3];
                    v_coord[0] = v_random.Next(v_minX, v_maxX);
                    v_coord[1] = v_random.Next(v_minY, v_maxY);
                    v_coord[2] = 0;
                    //
                    BeanPoint_internal v_point = new BeanPoint_internal(v_coord, p_paramGenerationPointsTest.p10_srid);
                    // p_code = FLabServices.createUtilitaires().GethCodeGeogPoint(v_coord);
                    p_code = FLabServices.createUtilitaires().GetHCodeGeogPoint(v_coord);
                    //(On évite les doublons)
                    if (!p_codes.Contains(p_code))
                    {
                        p_codes.Add(p_code);
                        v_pointsToTest.Add(v_point);
                        v_no++;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(v_pointsToTest);
        }
Exemplo n.º 9
0
        public void GetVisuPoints(List <BeanPoint_internal> p_points, Color p_couleur, int p_taillePoint, string p_prefixeLabel)
        {
            if (p_points == null && p_points.Count == 0)
            {
                return;
            }
            Geometry v_pointGeom;
            string   v_label;
            int      v_srid = p_points.First().p11_srid;

            //SpatialTrace.Enable();
            //SpatialTrace.SetLineColor(p_couleur);
            foreach (BeanPoint_internal v_point in p_points)
            {
                v_label     = p_prefixeLabel + " " + v_point.p00_id + "\\" + v_point.p00_id;
                v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_point.p10_coord[0], v_point.p10_coord[1], v_srid);
                //SpatialTrace.TraceGeometry(v_pointGeom, v_label, v_label);
            }
            //SpatialTrace.Disable();
        }
Exemplo n.º 10
0
        public void GetVisuArcsTopologie(BeanTopologieFacettes p_topologie, Color p_couleur, string p_prefixeLabel)
        {
            if (p_topologie.p12_arcsByCode == null || p_topologie.p12_arcsByCode.Count == 0)
            {
                return;
            }
            Geometry v_arcGeom;
            string   v_label;
            int      v_srid = p_topologie.p11_pointsFacettesByIdPoint.First().Value.p11_srid;

            //SpatialTrace.Enable();
            //SpatialTrace.SetLineColor(p_couleur);
            foreach (KeyValuePair <string, BeanArc_internal> v_arc in p_topologie.p12_arcsByCode)
            {
                v_label   = p_prefixeLabel + " " + v_arc.Value.p00_idArc + "\\" + v_arc.Value.p01_hcodeArc;
                v_arcGeom = FLabServices.createUtilitaires().GetGeometryLine(v_arc.Value.p11_pointDbt.p10_coord, v_arc.Value.p12_pointFin.p10_coord, v_srid, false);
                //SpatialTrace.TraceGeometry(v_arcGeom, v_label, v_label);
            }
            //SpatialTrace.Disable();
        }
Exemplo n.º 11
0
        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é.");
        }
Exemplo n.º 12
0
        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");
        }
Exemplo n.º 13
0
        public void GetVisuIlots(BeanTopologieFacettes p_topologie, Color p_couleur, string p_prefixeLabel)
        {
            //SpatialTrace.Enable();
            //SpatialTrace.SetFillColor(p_couleur);
            //SpatialTrace.SetLineColor(Color.Blue);
            //SpatialTrace.SetLineWidth(1);

            string v_label;

            foreach (KeyValuePair <int, BeanFacette_internal> v_facette in p_topologie.p13_facettesById)
            {
                if (v_facette.Value.p04_geomFacette != null)
                {
                    v_label = p_prefixeLabel + " Fac " + v_facette.Key;
                    //SpatialTrace.TraceGeometry(v_facette.Value.p04_geomFacette, v_label, v_label);
                }
                else
                {
                    if (v_facette.Value.p02_arcs != null && v_facette.Value.p02_arcs.Count > 0)
                    {
                        //SpatialTrace.SetLineColor(Color.Red);
                        //SpatialTrace.SetLineWidth(3);
                        Geometry v_arcGeom;
                        foreach (BeanArc_internal v_arcPolyg in v_facette.Value.p02_arcs)
                        {
                            v_label = "PB FAC " + v_facette.Key + "_" + p_prefixeLabel + "=> Arc: " + v_arcPolyg.p00_idArc + "\\" + v_arcPolyg.p01_hcodeArc;
                            int v_srid = v_arcPolyg.p11_pointDbt.p11_srid;
                            v_arcGeom = FLabServices.createUtilitaires().GetGeometryLine(v_arcPolyg.p11_pointDbt.p10_coord, v_arcPolyg.p12_pointFin.p10_coord, v_srid, false);
                            //SpatialTrace.TraceGeometry(v_arcGeom, v_label, v_label);
                        }
                        //SpatialTrace.SetLineWidth(1);
                        //SpatialTrace.SetLineColor(Color.Blue);
                    }
                }
            }
            //SpatialTrace.Disable();
        }
Exemplo n.º 14
0
        //
        public void GetVisuPoints2D(List <BeanPoint_internal> p_points, string p_label, Color p_couleurCourante, int p_taillePointAutoSi0OuMoins)
        {
            try
            {
                int param_ratioTaillePoint = 100;
                int v_taillePoints         = p_taillePointAutoSi0OuMoins;
                if (p_taillePointAutoSi0OuMoins <= 0)
                {
                    v_taillePoints = GetTailleAffichageDuPoint(p_points, param_ratioTaillePoint);
                }

                //SpatialTrace.Enable();
                string   v_message;
                Geometry v_pointGeom;

                ////SpatialTrace.SetFillColor(param_couleurCourante);
                //SpatialTrace.SetLineColor(p_couleurCourante);
                foreach (BeanPoint_internal v_point in p_points)
                {
                    v_message = "Pt " + v_point.p00_id + " (" + v_point.p10_coord[2] + " m)";
                    if (p_label != "")
                    {
                        v_message = p_label + "/" + v_message;
                    }

                    v_pointGeom = FLabServices.createUtilitaires().ConstructPoint(v_point.p10_coord[0], v_point.p10_coord[1], v_point.p11_srid).Buffer(v_taillePoints);
                    //SpatialTrace.TraceGeometry(v_pointGeom, v_message, v_message);
                }

                //SpatialTrace.Disable();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 15
0
        //public BeanTopologie GetBeanTopologieByVoronoiGraph(VoronoiGraph p_voronoiGraph, BeanAlimentationVoronoi p_beanAlimentationVoronoi)
        //{
        //    BeanTopologie v_topologieVoronoi = new BeanTopologie();
        //    try
        //    {
        //        Dictionary<int, BeanArc_internal> v_arcs = new Dictionary<int, BeanArc_internal>();
        //        Dictionary<int, int> v_DicoPointSourceGaucheParArc = new Dictionary<int, int>();
        //        Dictionary<int, int> v_DicoPointSourceDroitParArc = new Dictionary<int, int>();

        //        //Création du réseau
        //        BeanTopologie v_topologieLignes = new BeanTopologie();

        //        double v_vorX_Left;
        //        double v_vorY_Left;
        //        double v_vorX_Right;
        //        double v_vorY_Right;
        //        double v_OrigX_Left;
        //        double v_OrigY_Left;
        //        double v_OrigX_Right;
        //        double v_OrigY_Right;
        //        double v_CorrectionX = 0;
        //        double v_CorrectionY = 0;

        //        ITopologieService v_topologieService = new TopologieService();
        //        IGeometry v_line;
        //        String v_CodeXYPointGauche;
        //        String v_CodeXYPointDroit;
        //        int v_KeyPointGauche;
        //        int v_KeyPointDroit;
        //        int v_KeyArc = 0;
        //        HashSet<string> v_testDoublesLignes = new HashSet<string>();
        //        string v_codeLigne;

        //        if (p_beanAlimentationVoronoi.parametrage.reductionCoordonneesVf)
        //        {
        //            v_CorrectionX = (double)p_beanAlimentationVoronoi.origineXCorrigee;
        //            v_CorrectionY = (double)p_beanAlimentationVoronoi.origineYCorrigee;
        //        }


        //        foreach (VoronoiEdge v_Edges in p_voronoiGraph.Edges)
        //        {
        //            if (!v_Edges.IsInfinite && !v_Edges.IsPartlyInfinite)
        //            {
        //                v_KeyArc++;
        //                //Je créé des variables intermédiaires car modifierLaGeometrie directement le vecteur pose graves pb
        //                v_vorX_Left = v_Edges.VVertexA[0] + v_CorrectionX;
        //                v_vorY_Left = v_Edges.VVertexA[1] + v_CorrectionY;
        //                v_vorX_Right = v_Edges.VVertexB[0] + v_CorrectionX;
        //                v_vorY_Right = v_Edges.VVertexB[1] + v_CorrectionY;
        //                v_OrigX_Left = v_Edges.LeftData[0] + v_CorrectionX;
        //                v_OrigY_Left = v_Edges.LeftData[1] + v_CorrectionY;
        //                v_OrigX_Right = v_Edges.RightData[0] + v_CorrectionX;
        //                v_OrigY_Right = v_Edges.RightData[1] + v_CorrectionY;
        //                //

        //                v_line = v_topologieService.GetLineStringByCoord(v_vorX_Left, v_vorY_Left, v_vorX_Right, v_vorY_Right);

        //                if (v_line.Length > 0)
        //                {
        //                    v_CodeXYPointGauche = GetCodeXY(v_OrigX_Left, v_OrigY_Left);
        //                    v_CodeXYPointDroit = GetCodeXY(v_OrigX_Right, v_OrigY_Right);
        //                    //J'ai rencontré des duplications de lignes (dans un sens et dans l'autre)
        //                    //Ces cas provoquent des boucles sans fin dans la fermeture d'îlots
        //                    // Je mets un patch : A réintégrer DANS TOPOLOGIE SERVICE
        //                    if (v_OrigX_Left < v_OrigX_Right)
        //                    {
        //                        v_codeLigne = v_CodeXYPointGauche + "_" + v_CodeXYPointDroit;
        //                    }
        //                    else
        //                    {
        //                        if (v_OrigX_Left == v_OrigX_Right)
        //                        {
        //                            if (v_OrigY_Left < v_OrigY_Right)
        //                            {
        //                                v_codeLigne = v_CodeXYPointGauche + "_" + v_CodeXYPointDroit;
        //                            }
        //                            else
        //                            { v_codeLigne = v_CodeXYPointDroit + "_" + v_CodeXYPointGauche; }
        //                        }
        //                        else
        //                        { v_codeLigne = v_CodeXYPointDroit + "_" + v_CodeXYPointGauche; }
        //                    }
        //                    //Si la ligne est déjà contenue, je ne l'introduis pas
        //                    if (v_testDoublesLignes.Contains(v_codeLigne)) { break; }

        //                    //
        //                    v_arcs.Add(v_KeyArc, v_line);

        //                    v_KeyPointGauche = -1;
        //                    if (p_beanAlimentationVoronoi.dicoLienCodeXyKeySource.ContainsKey(v_CodeXYPointGauche))
        //                    {
        //                        p_beanAlimentationVoronoi.dicoLienCodeXyKeySource.TryGetValue(v_CodeXYPointGauche, out v_KeyPointGauche);
        //                    }
        //                    v_DicoPointSourceGaucheParArc.Add(v_KeyArc, v_KeyPointGauche);
        //                    v_KeyPointDroit = -1;
        //                    if (p_beanAlimentationVoronoi.dicoLienCodeXyKeySource.ContainsKey(v_CodeXYPointGauche))
        //                    {
        //                        p_beanAlimentationVoronoi.dicoLienCodeXyKeySource.TryGetValue(v_CodeXYPointDroit, out v_KeyPointDroit);
        //                    }
        //                    v_DicoPointSourceDroitParArc.Add(v_KeyArc, v_KeyPointDroit);
        //                }
        //            }//Fin if (!v_Edges.IsInfinite && !v_Edges.IsPartlyInfinite)
        //        }//Fin foreach
        //         //Création de la topologie

        //        v_topologieLignes = v_topologieService.GetTopologie(v_arcs);

        //        ////STRUCTURATION en ILOTS:
        //        //v_topologieVoronoi = v_topologieService.GetTopologieSansImpassesEnrichiesDesIlots(v_topologieLignes);
        //        //v_topologieService.MiseAJourDesIndicateursDeControleTopologieIlot(v_topologieVoronoi);
        //        ////Renumérotation des îlots
        //        //v_topologieService.UpdateIdIlotsByCotesArcs(v_topologieVoronoi, v_DicoPointSourceDroitParArc, v_DicoPointSourceGaucheParArc);
        //        ////FIN STRUCTURATION en ILOTS:
        //    }
        //    catch (Exception v_ex)
        //    {
        //        throw v_ex;
        //    }
        //    return v_topologieVoronoi;
        //}

        public BeanTriangulationDelaunay GetTriangulationDelaunayByVoronoiGraph(VoronoiGraph p_voronoiGraph, BeanAlimentationVoronoi p_beanAlimentationVoronoi)
        {
            BeanTriangulationDelaunay v_triangulationDelaunay = new BeanTriangulationDelaunay();

            try
            {
                //[Je filtre les id négatifs: correspondent au Mbo de construction
                foreach (KeyValuePair <int, Point> v_pointsOriginels in p_beanAlimentationVoronoi.p10_dicoDesPointsSources)
                {
                    if (v_pointsOriginels.Key >= 0)
                    {
                        v_triangulationDelaunay.p00_PointIGeometrySources.Add(v_pointsOriginels.Key, v_pointsOriginels.Value);
                    }
                }
                //
                double v_OrigX_Left;
                double v_OrigY_Left;
                double v_OrigX_Right;
                double v_OrigY_Right;
                double v_CorrectionX = 0;
                double v_CorrectionY = 0;
                //
                if (p_beanAlimentationVoronoi.p12_parametrage.reductionCoordonneesVf)
                {
                    v_CorrectionX = (double)p_beanAlimentationVoronoi.p55_origineXCorrigee;
                    v_CorrectionY = (double)p_beanAlimentationVoronoi.p56_origineYCorrigee;
                }

                BeanArcDelaunay   v_arcDelaunay;
                string            v_CodeXYPointGauche;
                string            v_CodeXYPointDroit;
                ITopologieService v_topologieService = new TopologieService();
                int v_cleDroite;
                int v_cleGauche;
                int v_KeyArc = 0;
                foreach (VoronoiEdge v_Edges in p_voronoiGraph.Edges)
                {
                    if (!v_Edges.IsInfinite && !v_Edges.IsPartlyInfinite)
                    {
                        v_KeyArc++;
                        v_OrigX_Left  = v_Edges.LeftData[0] + v_CorrectionX;
                        v_OrigY_Left  = v_Edges.LeftData[1] + v_CorrectionY;
                        v_OrigX_Right = v_Edges.RightData[0] + v_CorrectionX;
                        v_OrigY_Right = v_Edges.RightData[1] + v_CorrectionY;
                        //
                        //v_CodeXYPointGauche = GetCodeXY(v_OrigX_Left, v_OrigY_Left);
                        v_CodeXYPointGauche = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            v_OrigX_Left, v_OrigY_Left
                        });
                        //v_CodeXYPointDroit = GetCodeXY(v_OrigX_Right, v_OrigY_Right);
                        v_CodeXYPointDroit = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            v_OrigX_Right, v_OrigY_Right
                        });
                        //
                        if (p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.ContainsKey(v_CodeXYPointGauche) && p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.ContainsKey(v_CodeXYPointDroit))
                        {
                            v_cleGauche = p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint[v_CodeXYPointGauche];
                            v_cleDroite = p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint[v_CodeXYPointDroit];
                            if (v_cleDroite >= 0 && v_cleGauche >= 0)
                            {
                                v_arcDelaunay = new BeanArcDelaunay();
                                v_arcDelaunay.p11_idPoint1       = v_cleGauche;
                                v_arcDelaunay.p21_coordPoint1[0] = v_OrigX_Left;
                                v_arcDelaunay.p21_coordPoint1[1] = v_OrigY_Left;
                                //
                                v_arcDelaunay.p12_idPoint2       = v_cleDroite;
                                v_arcDelaunay.p22_coordPoint2[0] = v_OrigX_Right;
                                v_arcDelaunay.p22_coordPoint2[1] = v_OrigY_Right;
                                //
                                v_arcDelaunay.p00_codeArcDelaunay = GetHCodeArcDelaunay(v_cleGauche, v_cleDroite, true);
                                //
                                v_arcDelaunay.p30_arcDelaunay = v_topologieService.GetLineStringByCoord(v_OrigX_Left, v_OrigY_Left, v_OrigX_Right, v_OrigY_Right);
                                v_triangulationDelaunay.p01_arcsDelaunay.Add(v_arcDelaunay);
                            }
                        }
                    }
                }
            }
            catch (Exception v_ex)
            {
                throw v_ex;
            }
            return(v_triangulationDelaunay);
        }
Exemplo n.º 16
0
        public BeanTopologieFacettes GetBeanTopologieByVoronoiGraph(VoronoiGraph p_voronoiGraph, BeanAlimentationVoronoi p_beanAlimentationVoronoi)
        {
            BeanTopologieFacettes v_topologie = new BeanTopologieFacettes();

            try
            {
                List <BeanArc_internal> v_arcsVoronoi = new List <BeanArc_internal>();
                Dictionary <string, BeanArc_internal> v_arcsParHCode = new Dictionary <string, BeanArc_internal>();
                int v_srid = p_beanAlimentationVoronoi.p11_srid;
                //
                Dictionary <string, BeanPoint_internal> v_pointsDesArcsByCode = new Dictionary <string, BeanPoint_internal>();
                Dictionary <int, BeanArc_internal>      v_arcs      = new Dictionary <int, BeanArc_internal>();
                Dictionary <int, int> v_DicoPointSourceGaucheParArc = new Dictionary <int, int>();
                Dictionary <int, int> v_DicoPointSourceDroitParArc  = new Dictionary <int, int>();
                //

                //Création du réseau
                double v_vorX_Left;
                double v_vorY_Left;
                double v_vorX_Right;
                double v_vorY_Right;
                double v_OrigX_Left;
                double v_OrigY_Left;
                double v_OrigX_Right;
                double v_OrigY_Right;
                double v_CorrectionX = 0;
                double v_CorrectionY = 0;

                ITopologieService v_topologieService = new TopologieService();
                int v_KeyArc = 0;
                HashSet <string> v_testDoublesLignes = new HashSet <string>();

                if (p_beanAlimentationVoronoi.p12_parametrage.reductionCoordonneesVf)
                {
                    v_CorrectionX = (double)p_beanAlimentationVoronoi.p55_origineXCorrigee;
                    v_CorrectionY = (double)p_beanAlimentationVoronoi.p56_origineYCorrigee;
                }

                BeanPoint_internal v_pt1;
                BeanPoint_internal v_pt2;
                BeanArc_internal   v_arc;

                //On créé une facette/ilot pour chaque point;
                BeanFacette_internal v_facette;
                Dictionary <int, BeanFacette_internal> v_toutesFacettes;

                v_toutesFacettes = p_beanAlimentationVoronoi.p10_dicoDesPointsSources.ToDictionary(c => c.Key, c => new BeanFacette_internal());
                //[ATTENTION! On doit mettre à jour l'id
                foreach (KeyValuePair <int, BeanFacette_internal> v_fac in v_toutesFacettes)
                {
                    v_fac.Value.p00_idFacette = v_fac.Key;
                }

                //On parcourt les arcs:
                string v_hcodePt1;
                string v_hcodePt2;
                string v_hcodeGraineVoronoiAGauche;
                string v_hcodeGraineVoronoiADroite;
                int    v_idIlotAGauche;
                int    v_idIlotADroite;
                foreach (VoronoiEdge v_Edges in p_voronoiGraph.Edges)
                {
                    if (!v_Edges.IsInfinite && !v_Edges.IsPartlyInfinite)
                    {
                        v_KeyArc++;

                        //L'arc voronoi
                        v_vorX_Left  = v_Edges.VVertexA[0] + v_CorrectionX;
                        v_vorY_Left  = v_Edges.VVertexA[1] + v_CorrectionY;
                        v_vorX_Right = v_Edges.VVertexB[0] + v_CorrectionX;
                        v_vorY_Right = v_Edges.VVertexB[1] + v_CorrectionY;
                        //
                        v_hcodePt1 = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            v_vorX_Left, v_vorY_Left
                        });
                        if (v_pointsDesArcsByCode.ContainsKey(v_hcodePt1))
                        {
                            v_pt1 = v_pointsDesArcsByCode[v_hcodePt1];
                        }
                        else
                        {
                            v_pt1 = new BeanPoint_internal(v_vorX_Left, v_vorY_Left, 0, v_srid);
                            v_pointsDesArcsByCode.Add(v_hcodePt1, v_pt1);
                        }
                        //
                        v_hcodePt2 = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            v_vorX_Right, v_vorY_Right
                        });
                        if (v_pointsDesArcsByCode.ContainsKey(v_hcodePt2))
                        {
                            v_pt2 = v_pointsDesArcsByCode[v_hcodePt2];
                        }
                        else
                        {
                            v_pt2 = new BeanPoint_internal(v_vorX_Right, v_vorY_Right, 0, v_srid);
                            v_pointsDesArcsByCode.Add(v_hcodePt2, v_pt2);
                        }

                        //
                        v_arc = new BeanArc_internal(v_pt1, v_pt2);
                        //
                        if (!v_arcsParHCode.ContainsKey(v_arc.p01_hcodeArc))
                        {
                            v_arcsParHCode.Add(v_arc.p01_hcodeArc, v_arc);
                        }

                        //On référence les points 'graines' voronoi à droite et à gauche
                        v_OrigX_Left  = v_Edges.LeftData[0] + v_CorrectionX;
                        v_OrigY_Left  = v_Edges.LeftData[1] + v_CorrectionY;
                        v_OrigX_Right = v_Edges.RightData[0] + v_CorrectionX;
                        v_OrigY_Right = v_Edges.RightData[1] + v_CorrectionY;
                        //
                        v_hcodeGraineVoronoiAGauche = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            v_OrigX_Left, v_OrigY_Left
                        });
                        v_hcodeGraineVoronoiADroite = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            v_OrigX_Right, v_OrigY_Right
                        });
                        //
                        v_facette = null;
                        if (p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.ContainsKey(v_hcodeGraineVoronoiAGauche))
                        {
                            v_idIlotAGauche = p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint[v_hcodeGraineVoronoiAGauche];
                            v_facette       = v_toutesFacettes[v_idIlotAGauche];
                            v_facette.p02_arcs.Add(v_arc);
                            v_arc.p21_facetteGauche = v_facette;
                        }
                        else
                        {
                            v_arc.p20_statutArc = enumStatutArc.arcExterne;
                        }
                        v_facette = null;
                        if (p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.ContainsKey(v_hcodeGraineVoronoiADroite))
                        {
                            v_idIlotADroite = p_beanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint[v_hcodeGraineVoronoiADroite];
                            v_facette       = v_toutesFacettes[v_idIlotADroite];
                            v_facette.p02_arcs.Add(v_arc);
                            v_arc.p21_facetteGauche = v_facette;
                        }
                        else
                        {
                            v_arc.p20_statutArc = enumStatutArc.arcExterne;
                        }
                    } //Fin if (!v_Edges.IsInfinite && !v_Edges.IsPartlyInfinite)
                }     //Fin foreach
                 //Création de la topologie
                v_arcsVoronoi = v_arcsParHCode.Values.OrderBy(c => c.p01_hcodeArc).ToList();

                //On actualise les points des facettes:
                foreach (KeyValuePair <int, BeanFacette_internal> v_fac in v_toutesFacettes)
                {
                    List <BeanPoint_internal> v_points = v_fac.Value.p02_arcs.Select(c => c.p11_pointDbt).ToList();
                    v_points.AddRange(v_fac.Value.p02_arcs.Select(c => c.p12_pointFin).ToList());
                    HashSet <string> v_pointsDeja = new HashSet <string>();
                    foreach (BeanPoint_internal v_pt in v_points)
                    {
                        if (!v_pointsDeja.Contains(v_pt.p01_hCodeGeog))
                        {
                            v_fac.Value.p01_pointsDeFacette.Add(v_pt);
                            v_pointsDeja.Add(v_pt.p01_hCodeGeog);
                        }
                    }
                }

                //
                v_topologie = new BeanTopologieFacettes(v_arcsVoronoi);
                v_topologie.p13_facettesById = v_toutesFacettes;
                //On supprime les éventuelles facettes sans dimension
                List <int> v_idFacettesASupprimer;
                v_idFacettesASupprimer = v_toutesFacettes.Where(c => c.Value.p02_arcs.Count < 3).Select(c => c.Key).ToList();
                BeanFacette_internal v_facetteASupprimer;
                foreach (int v_idFacASuppr in v_idFacettesASupprimer)
                {
                    v_facetteASupprimer = v_topologie.p13_facettesById[v_idFacASuppr];
                    v_topologie.FacetteSupprimer(v_facetteASupprimer);
                }


                //Géométrie:
                List <int>           v_idFacettes = v_topologie.p13_facettesById.Keys.ToList();
                IGeometry            v_geomFacette;
                BeanFacette_internal v_facettePourGeom;
                foreach (int v_idFac in v_idFacettes)
                {
                    v_facettePourGeom = v_topologie.p13_facettesById[v_idFac];
                    v_geomFacette     = FLabServices.createCalculMedium().GetGeometryPolygoneFacetteEtOrdonnePointsFacette(ref v_facettePourGeom, ref v_topologie);
                    v_facettePourGeom.p04_geomFacette = v_geomFacette;
                }
            }
            catch (Exception v_ex)
            {
                throw v_ex;
            }
            return(v_topologie);
        }
Exemplo n.º 17
0
        public BeanAlimentationVoronoi GetBeanAlimentationVoronoiByDicoPointsEtMbo(Dictionary <int, Point> p_DicoPoints, double[] p_coodMinMaxXy, int p_srid)
        {
            BeanAlimentationVoronoi v_BeanAlimentationVoronoi = new BeanAlimentationVoronoi();

            try
            {
                v_BeanAlimentationVoronoi.p11_srid = p_srid;
                v_BeanAlimentationVoronoi.p22_contientObjetsInvalidesVf   = false;
                v_BeanAlimentationVoronoi.p23_contientObjetsSuperposesVf  = false;
                v_BeanAlimentationVoronoi.p21_territoireSuperieurA200kmVf = false;

                v_BeanAlimentationVoronoi.p51_xMin = p_coodMinMaxXy[0];
                v_BeanAlimentationVoronoi.p52_yMin = p_coodMinMaxXy[1];
                v_BeanAlimentationVoronoi.p53_xMax = p_coodMinMaxXy[2];
                v_BeanAlimentationVoronoi.p54_yMax = p_coodMinMaxXy[3];

                List <Double[]> v_ListeDoublePourVectors = new List <Double[]>();
                string          v_codeXYPoint;
                double[]        v_DoublePourVector;
                int             v_keyDoublon;

                foreach (KeyValuePair <int, Point> v_point in p_DicoPoints)
                {
                    v_BeanAlimentationVoronoi.p10_dicoDesPointsSources.Add(v_point.Key, v_point.Value);
                    if (v_point.Value.OgcGeometryType == OgcGeometryType.Point)
                    {
                        //On génère le code à partir des coordonnees
                        //v_codeXYPoint = GetCodeXY((double)v_point.Value.Coordinate.X, (double)v_point.Value.Coordinate.Y);
                        v_codeXYPoint = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                            (double)v_point.Value.Coordinate.X, (double)v_point.Value.Coordinate.Y
                        });

                        if (v_BeanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.ContainsKey(v_codeXYPoint))
                        {
                            //j'ajoute dans la liste des doublons l'id du point en cours
                            v_BeanAlimentationVoronoi.p25_pointsSuperposes.Add(v_point.Key);
                            v_BeanAlimentationVoronoi.p23_contientObjetsSuperposesVf = true;
                            //+ celui déjà listé s'il n'existe pas déjà
                            v_BeanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.TryGetValue(v_codeXYPoint, out v_keyDoublon);
                            if (!v_BeanAlimentationVoronoi.p25_pointsSuperposes.Contains(v_keyDoublon))
                            {
                                v_BeanAlimentationVoronoi.p25_pointsSuperposes.Add(v_keyDoublon);
                            }
                        }
                        else  //Si l'objet est OK à ce stade...
                        {
                            //J'injecte dans la liste des correspondances
                            v_BeanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.Add(v_codeXYPoint, v_point.Key);
                            //
                            v_DoublePourVector    = new double[2];
                            v_DoublePourVector[0] = (double)v_point.Value.Coordinate.X;
                            v_DoublePourVector[1] = (double)v_point.Value.Coordinate.Y;

                            //J'ajoute dans une liste temporaire et pas dans le HS car il semble nécessaire de faire un changement de repère avant d'injecter les données ds le HS<vector>
                            v_ListeDoublePourVectors.Add(v_DoublePourVector);

                            //récupération des points extrêmes
                            if (v_BeanAlimentationVoronoi.p51_xMin > (double)v_point.Value.Coordinate.X)
                            {
                                v_BeanAlimentationVoronoi.p51_xMin = (double)v_point.Value.Coordinate.X;
                            }
                            if (v_BeanAlimentationVoronoi.p52_yMin > (double)v_point.Value.Coordinate.Y)
                            {
                                v_BeanAlimentationVoronoi.p52_yMin = (double)v_point.Value.Coordinate.Y;
                            }
                            if (v_BeanAlimentationVoronoi.p53_xMax < (double)v_point.Value.Coordinate.X)
                            {
                                v_BeanAlimentationVoronoi.p53_xMax = (double)v_point.Value.Coordinate.X;
                            }
                            if (v_BeanAlimentationVoronoi.p54_yMax < (double)v_point.Value.Coordinate.Y)
                            {
                                v_BeanAlimentationVoronoi.p54_yMax = (double)v_point.Value.Coordinate.Y;
                            }
                        }
                    }//Si le IGeometry n'est pas un point (FIN if (v_point.Value.STGeometryType() == OpenGisGeographyType.Point.ToString())
                    else
                    {
                        v_BeanAlimentationVoronoi.p24_pointsInvalidesSaufSuperposes.Add(v_point.Key);
                        v_BeanAlimentationVoronoi.p22_contientObjetsInvalidesVf = true;
                    }
                }//FIN foreach

                //Création des points périphériques artificiels
                Dictionary <int, Double[]> v_dicoPointscadres = GetPointsCadresVoronoi(v_BeanAlimentationVoronoi);


                //Injection dans les listes
                Dictionary <int, IGeometry> v_newListePoint = new Dictionary <int, IGeometry>();

                ITopologieService v_topologieService = new TopologieService();
                foreach (KeyValuePair <int, Double[]> v_pointSup in v_dicoPointscadres)
                {
                    //v_codeXYPoint = GetCodeXY(v_pointSup.Value[0], v_pointSup.Value[1]);
                    v_codeXYPoint = FLabServices.createUtilitaires().GetHCodeGeogPoint(new double[2] {
                        v_pointSup.Value[0], v_pointSup.Value[1]
                    });
                    //PUSTULE FAU
                    if (v_BeanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.ContainsKey(v_codeXYPoint))
                    {
                        continue;
                    }
                    v_BeanAlimentationVoronoi.p31_correspondanceHCodePointvsIdPoint.Add(v_codeXYPoint, v_pointSup.Key);
                    v_BeanAlimentationVoronoi.p10_dicoDesPointsSources.Add(v_pointSup.Key, FLabServices.createUtilitaires().ConstructPoint(v_pointSup.Value[0], v_pointSup.Value[1], p_srid));


                    v_ListeDoublePourVectors.Add(v_pointSup.Value);
                }

                //Changement d'origine des coordonnées
                //(Indispensable pour pouvoir gérer les calculs sur les coord L93 (>10 puissance 5))
                v_BeanAlimentationVoronoi.p55_origineXCorrigee = (int)(Math.Round(v_BeanAlimentationVoronoi.p51_xMin) - 1);
                v_BeanAlimentationVoronoi.p56_origineYCorrigee = (int)(Math.Round(v_BeanAlimentationVoronoi.p52_yMin) - 1);
                if (v_BeanAlimentationVoronoi.p12_parametrage.reductionCoordonneesVf)
                {
                    v_BeanAlimentationVoronoi.p51_xMin = v_BeanAlimentationVoronoi.p51_xMin - v_BeanAlimentationVoronoi.p55_origineXCorrigee;
                    v_BeanAlimentationVoronoi.p53_xMax = v_BeanAlimentationVoronoi.p53_xMax - v_BeanAlimentationVoronoi.p55_origineXCorrigee;
                    v_BeanAlimentationVoronoi.p52_yMin = v_BeanAlimentationVoronoi.p52_yMin - v_BeanAlimentationVoronoi.p56_origineYCorrigee;
                    v_BeanAlimentationVoronoi.p54_yMax = v_BeanAlimentationVoronoi.p54_yMax - v_BeanAlimentationVoronoi.p56_origineYCorrigee;
                }

                foreach (Double[] v_DoubleVectorPourCorrection in v_ListeDoublePourVectors)
                {
                    if (v_BeanAlimentationVoronoi.p12_parametrage.reductionCoordonneesVf)
                    {
                        v_DoubleVectorPourCorrection[0] = v_DoubleVectorPourCorrection[0] - v_BeanAlimentationVoronoi.p55_origineXCorrigee;
                        v_DoubleVectorPourCorrection[1] = v_DoubleVectorPourCorrection[1] - v_BeanAlimentationVoronoi.p56_origineYCorrigee;
                    }
                    v_BeanAlimentationVoronoi.p50_pointsFormatesPourInsertion.Add(new Vector(v_DoubleVectorPourCorrection));
                }
                //
                if (((v_BeanAlimentationVoronoi.p53_xMax - v_BeanAlimentationVoronoi.p51_xMin) > 200000) || ((v_BeanAlimentationVoronoi.p54_yMax - v_BeanAlimentationVoronoi.p52_yMin) > 200000))
                {
                    v_BeanAlimentationVoronoi.p21_territoireSuperieurA200kmVf = true;
                }
                //Ajout des points périphériques
                //AjoutPointsFrontiere(ref v_BeanAlimentationVoronoi);
            }
            catch (Exception v_ex)
            {
                throw v_ex;
            }
            return(v_BeanAlimentationVoronoi);
        }