예제 #1
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();
            //
        }
예제 #2
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);
        }
예제 #3
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();
        }