Exemple #1
0
        public override void StartAlgorithm()
        {
            form.nextButton.Enabled = true;

            form.maxDist2PolyButton.Enabled    = false;
            form.mergeConvexHullButton.Enabled = false;
            form.intersectionButton.Enabled    = false;
            form.continueButton.Enabled        = false;

            //Get the initial lines of support
            InitialLines();

            tempDistance             = Utility.EuclideanDistance(CaliperA.CenterPoint, CaliperB.CenterPoint);
            twoPolygonDistanceStruct = new TwoPolygonDistanceStruct(CaliperA.CenterPoint, CaliperB.CenterPoint, tempDistance,
                                                                    CaliperA.CenterPoint, CaliperB.CenterPoint, tempDistance);

            form.currentDiameterTextbox.Text = tempDistance.ToString();
            form.maxDiameterTextBox.Text     = twoPolygonDistanceStruct.MaxDistance.ToString();
            form.minDistanceTextBox.Text     = twoPolygonDistanceStruct.MinDistance.ToString();

            Console.WriteLine("Max Distance: {0}", twoPolygonDistanceStruct.MaxDistance);
            Console.WriteLine("Min Distance: {0}", twoPolygonDistanceStruct.MinDistance);
            form.g.DrawLine(Utility.blackPen, twoPolygonDistanceStruct.MaxP1, twoPolygonDistanceStruct.MaxP2);
        }
        public override void StartAlgorithm()
        {
            form.nextButton.Enabled = true;

            form.maxDist2PolyButton.Enabled = false;
            form.mergeConvexHullButton.Enabled = false;
            form.intersectionButton.Enabled = false;
            form.continueButton.Enabled = false;

            //Get the initial lines of support
            InitialLines();

            tempDistance = Utility.EuclideanDistance(CaliperA.CenterPoint, CaliperB.CenterPoint);
            twoPolygonDistanceStruct = new TwoPolygonDistanceStruct(CaliperA.CenterPoint, CaliperB.CenterPoint, tempDistance,
                CaliperA.CenterPoint, CaliperB.CenterPoint, tempDistance);

            form.currentDiameterTextbox.Text = tempDistance.ToString();
            form.maxDiameterTextBox.Text = twoPolygonDistanceStruct.MaxDistance.ToString();
            form.minDistanceTextBox.Text = twoPolygonDistanceStruct.MinDistance.ToString();

            Console.WriteLine("Max Distance: {0}", twoPolygonDistanceStruct.MaxDistance);
            Console.WriteLine("Min Distance: {0}", twoPolygonDistanceStruct.MinDistance);
            form.g.DrawLine(Utility.blackPen, twoPolygonDistanceStruct.MaxP1, twoPolygonDistanceStruct.MaxP2);
        }