Exemple #1
0
        public override void StartAlgorithm()
        {
            //move this to base class functions later
            //this button is true
            form.nextButton.Enabled = true;

            //all the rest are false
            form.minAreaButton.Enabled      = false;
            form.addPolygonButton.Enabled   = false;
            form.minimumPermButton.Enabled  = false;
            form.maxDiameterButton.Enabled  = false;
            form.intersectionButton.Enabled = false;
            form.minWidthButton.Enabled     = false;
            form.continueButton.Enabled     = false;

            //Get the intial angles
            InitialLines();

            tempDistance   = Utility.EuclideanDistance(CaliperA.CenterPoint, CaliperB.CenterPoint);
            diameterStruct = new DiameterStruct(CaliperA.CenterPoint, CaliperB.CenterPoint, tempDistance);

            form.currentDiameterTextbox.Text = tempDistance.ToString();
            form.maxDiameterTextBox.Text     = diameterStruct.MaxDiameter.ToString();

            Console.WriteLine("MaxDistance: {0}", diameterStruct.MaxDiameter);
            form.g.DrawLine(Utility.blackPen, diameterStruct.MaxP1, diameterStruct.MaxP2);
        }
        public override void StartAlgorithm()
        {
            //move this to base class functions later
            //this button is true
            form.nextButton.Enabled = true;

            //all the rest are false
            form.minAreaButton.Enabled = false;
            form.addPolygonButton.Enabled = false;
            form.minimumPermButton.Enabled = false;
            form.maxDiameterButton.Enabled = false;
            form.intersectionButton.Enabled = false;
            form.minWidthButton.Enabled = false;
            form.continueButton.Enabled = false;

            //Get the intial angles
            InitialLines();

            tempDistance = Utility.EuclideanDistance(CaliperA.CenterPoint, CaliperB.CenterPoint);
            diameterStruct = new DiameterStruct(CaliperA.CenterPoint, CaliperB.CenterPoint, tempDistance);

            form.currentDiameterTextbox.Text = tempDistance.ToString();
            form.maxDiameterTextBox.Text = diameterStruct.MaxDiameter.ToString();

            Console.WriteLine("MaxDistance: {0}", diameterStruct.MaxDiameter);
            form.g.DrawLine(Utility.blackPen, diameterStruct.MaxP1, diameterStruct.MaxP2);
        }