Exemplo n.º 1
0
 private void btnCalcTransform_Click(object sender, EventArgs e)
 {
     if ((displayTransformPoints.Count > 0) && (transformation != null))
     {
         //foreach (ClassTransformdisplayPoint transp in displayTransformPoints)
         //  transformation.setUsing(transp);
     }
     if (transformation == null)
     {
         String           cuFile = ClassNPPTools.getCurrentFile();
         ClassCADdyPunkte file1  = new ClassCADdyPunkte(ref language);
         ClassNPPTools.switchToFile(cbListSrc.Text);
         file1.getPointsFromCurrentCADdy(settings);
         ClassCADdyPunkte file2 = new ClassCADdyPunkte(ref language);
         ClassNPPTools.switchToFile(cbListDest.Text);
         file2.getPointsFromCurrentCADdy(settings);
         ClassNPPTools.switchToFile(cuFile);
         transformation = new ClassTransformation(file1, file2, ref language, 3, 4);
     }
     else
     {
         transformation.calcResiduen();
     }
     if (transformation != null)
     {
         displayTransformPoints.Clear();
         foreach (ClassTransformPointPair matchPoint in transformation.MatchPoints)
         {
             displayTransformPoints.Add(new ClassTransformdisplayPoint(matchPoint, 3, 4));
         }
         tbSigmaXY.Text = ClassConverters.ToString(transformation.SigmaXY, ",", "", 3, true);
         tbSigmaZ.Text  = ClassConverters.ToString(transformation.SigmaZ, ",", "", 3, true);
         if (transformation.SigmaXY < 0.1)
         {
             tbSigmaXY.BackColor = Color.LightGreen;
         }
         else if (Double.IsNaN(transformation.SigmaXY))
         {
             tbSigmaXY.BackColor = Color.LightGray;
         }
         else
         {
             tbSigmaXY.BackColor = Color.Orange;
         }
         if (transformation.SigmaZ < 0.1)
         {
             tbSigmaZ.BackColor = Color.LightGreen;
         }
         else if (Double.IsNaN(transformation.SigmaZ))
         {
             tbSigmaZ.BackColor = Color.LightGray;
         }
         else
         {
             tbSigmaZ.BackColor = Color.Orange;
         }
         btnMakeTransform.Enabled = true;
     }
 }
Exemplo n.º 2
0
        /// <summary>Schnelles Quelle Ziel tauschen</summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnChangeSrcDest_Click(object sender, EventArgs e)
        {
            displayTransformPoints.Clear();
            String temp = cbListSrc.Text;

            cbListSrc.Text  = cbListDest.Text;
            cbListDest.Text = temp;
            transformation  = null;
            //btnCalcTransform_Click(sender, e);
        }
Exemplo n.º 3
0
 public void resetTransform()
 {
     if (transformation != null)
     {
         transformation.clearForDestroy();
         transformation = null;
     }
     displayTransformPoints.Clear();
     tbSigmaXY.BackColor      = Color.LightGray;
     tbSigmaXY.Text           = "";
     tbSigmaZ.BackColor       = Color.LightGray;
     tbSigmaZ.Text            = "";
     btnMakeTransform.Enabled = false;
 }