private void Create3DDRC(cDRC DRCToDraw, cDRC_Region AssociatedRegion, Color Color, double Min, double Max)
        {
            if (DRCToDraw.ResultFit == null) return;

            Position = new cPoint3D(AssociatedRegion.PosXMin + 0.5, AssociatedRegion.PosYMin + 0.2, 0);
            this.Colour = Color;
            vtkPoints points = vtkPoints.New();

            vtkUnsignedCharArray colors = vtkUnsignedCharArray.New();
            colors.SetName("Colors");
            colors.SetNumberOfComponents(3);
            colors.SetNumberOfTuples(AssociatedRegion.NumConcentrations);

            for (int i = 0; i < AssociatedRegion.NumConcentrations; i++)
            {
                if (i >= DRCToDraw.ResultFit.Y_Estimated.Count) continue;
                double PosZ = 8 - ((DRCToDraw.ResultFit.GetNormalizedY_Estimated()[i]) * 8);

                points.InsertPoint(i, i, 0, PosZ);
                colors.InsertTuple3(i / AssociatedRegion.NumConcentrations, i / AssociatedRegion.NumConcentrations, 255, i / AssociatedRegion.NumConcentrations);
            }

            Spline = vtkParametricSpline.New();
            Spline.SetPoints(points);
            Spline.ClosedOff();

            vtkParametricFunctionSource SplineSource = vtkParametricFunctionSource.New();
            SplineSource.SetParametricFunction(Spline);

            //     SplineSource.GetPolyDataInput(0).GetPointData().AddArray(colors);

            vtkLinearExtrusionFilter extrude = vtkLinearExtrusionFilter.New();
            extrude.SetInputConnection(SplineSource.GetOutputPort());

            //extrude.GetPolyDataInput(0).GetPointData().AddArray(colors);
            extrude.SetScaleFactor(AssociatedRegion.NumReplicate - 0.2);
            //extrude.SetExtrusionTypeToNormalExtrusion();

            extrude.SetExtrusionTypeToVectorExtrusion();
            extrude.SetVector(0, 1, 0);

            vtk_PolyDataMapper = vtkPolyDataMapper.New();
            vtk_PolyDataMapper.SetInputConnection(extrude.GetOutputPort()/*SplineSource.GetOutputPort()*/);
            vtk_PolyDataMapper.GetInput().GetPointData().AddArray(colors);
            vtk_PolyDataMapper.ScalarVisibilityOn();
            vtk_PolyDataMapper.SetScalarModeToUsePointFieldData();
            vtk_PolyDataMapper.SelectColorArray("Colors");

            CreateVTK3DObject(3);
        }
        private void displayRespondingDRCToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (CompleteScreening.GetCurrentDisplayPlate().ListDRCRegions == null) return;

            FormForDRCSelection WindowSelectionDRC = new FormForDRCSelection();
            if (WindowSelectionDRC.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;

            if (WindowSelectionDRC.checkBoxMOAClassification.Checked == false)
            {
                int h = 0;
                FormToDisplayDRC WindowforDRCsDisplay = new FormToDisplayDRC();

                foreach (cDRC_Region TmpRegion in CompleteScreening.GetCurrentDisplayPlate().ListDRCRegions)
                {
                    int cpt = 0;
                    List<cDRC> ListDRC = new List<cDRC>();
                    for (int i = 0; i < CompleteScreening.ListDescriptors.Count; i++)
                    {
                        if (CompleteScreening.ListDescriptors[i].IsActive())
                        {
                            cDRC CurrentDRC = new cDRC(TmpRegion, CompleteScreening.ListDescriptors[i]);
                            if (CurrentDRC.IsResponding(WindowSelectionDRC) == 1)
                            {
                                ListDRC.Add(CurrentDRC);
                                cpt++;
                            }
                        }
                    }

                    cDRCDisplay DRCDisplay = new cDRCDisplay(ListDRC, GlobalInfo);
                    if (DRCDisplay.CurrentChart.Series.Count == 0) continue;

                    DRCDisplay.CurrentChart.Location = new Point((DRCDisplay.CurrentChart.Width + 50) * 0, (DRCDisplay.CurrentChart.Height + 10 + DRCDisplay.CurrentRichTextBox.Height) * h++);
                    DRCDisplay.CurrentRichTextBox.Location = new Point(DRCDisplay.CurrentChart.Location.X, DRCDisplay.CurrentChart.Location.Y + DRCDisplay.CurrentChart.Height + 5);

                    WindowforDRCsDisplay.LChart.Add(DRCDisplay.CurrentChart);
                    WindowforDRCsDisplay.LRichTextBox.Add(DRCDisplay.CurrentRichTextBox);
                }

                WindowforDRCsDisplay.panelForDRC.Controls.AddRange(WindowforDRCsDisplay.LChart.ToArray());
                WindowforDRCsDisplay.panelForDRC.Controls.AddRange(WindowforDRCsDisplay.LRichTextBox.ToArray());
                WindowforDRCsDisplay.Show();
                return;
            }

            System.Windows.Forms.DialogResult ResWin = MessageBox.Show("By applying this process, the current screening will be entirely updated ! Proceed ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (ResWin == System.Windows.Forms.DialogResult.No) return;

            foreach (cPlate CurrentPlate in CompleteScreening.ListPlatesActive)
            {
                foreach (cDRC_Region TmpRegion in CurrentPlate.ListDRCRegions)
                {
                    int cpt = 0;
                    //List<cDRC> ListDRC = new List<cDRC>();
                    //for (int i = 0; i < CompleteScreening.ListDescriptors.Count; i++)
                    //{
                    //  if (CompleteScreening.ListDescriptors[i].IsActive())
                    //    {
                    //        cDRC CurrentDRC = new cDRC(TmpRegion, CompleteScreening.ListDescriptors[i]);
                    //        if (CurrentDRC.IsResponding(WindowSelectionDRC))
                    //        {
                    //            ListDRC.Add(CurrentDRC);
                    //            cpt++;
                    //        }
                    //    }

                    //}
                    List<int> ResDescActive = TmpRegion.GetListRespondingDescritpors(CompleteScreening, WindowSelectionDRC);

                    for (int j = 0; j < TmpRegion.NumReplicate; j++)
                        for (int i = 0; i < TmpRegion.NumConcentrations; i++)
                        {

                            cWell CurrentWell = TmpRegion.GetListWells()[j][i];
                            if (CurrentWell == null) continue;

                            for (int IdxDesc = 0; IdxDesc < ResDescActive.Count; IdxDesc++)
                            {
                                if (ResDescActive[IdxDesc] == -1) continue;

                                //CurrentWell.ListDescriptors[IdxDesc].HistoValues = new double[1];
                                CurrentWell.ListDescriptors[IdxDesc].SetHistoValues((double)ResDescActive[IdxDesc]);
                                if ((i == 0) && (j == 0))
                                    CurrentWell.SetClass(0);
                                else
                                    CurrentWell.SetAsNoneSelected();
                                //[0] = ResDescActive[IdxDesc];
                                CurrentWell.ListDescriptors[IdxDesc].UpDateDescriptorStatistics();

                            }

                        }
                }
                CurrentPlate.UpDataMinMax();
            }
        }
 public c3DDRC(cDRC DRCToDraw, cDRC_Region AssociatedRegion, double Min, double Max)
 {
     Create3DDRC(DRCToDraw, AssociatedRegion, Color.White, Min, Max);
 }
        private void displayDRCToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (CompleteScreening.GetCurrentDisplayPlate().ListDRCRegions == null) return;

            int h = 0;
            FormToDisplayDRC WindowforDRCsDisplay = new FormToDisplayDRC();

            foreach (cDRC_Region TmpRegion in CompleteScreening.GetCurrentDisplayPlate().ListDRCRegions)
            {
                int cpt = 0;
                List<cDRC> ListDRC = new List<cDRC>();
                for (int i = 0; i < CompleteScreening.ListDescriptors.Count; i++)
                {
                    if (CompleteScreening.ListDescriptors[i].IsActive())
                    {
                        cDRC CurrentDRC = new cDRC(TmpRegion, CompleteScreening.ListDescriptors[i]);

                        ListDRC.Add(CurrentDRC);
                        cpt++;
                    }

                }

                cDRCDisplay DRCDisplay = new cDRCDisplay(ListDRC, GlobalInfo);

                if (DRCDisplay.CurrentChart.Series.Count == 0) continue;

                DRCDisplay.CurrentChart.Location = new Point((DRCDisplay.CurrentChart.Width + 50) * 0, (DRCDisplay.CurrentChart.Height + 10 + DRCDisplay.CurrentRichTextBox.Height) * h++);
                DRCDisplay.CurrentRichTextBox.Location = new Point(DRCDisplay.CurrentChart.Location.X, DRCDisplay.CurrentChart.Location.Y + DRCDisplay.CurrentChart.Height + 5);

                WindowforDRCsDisplay.LChart.Add(DRCDisplay.CurrentChart);
                WindowforDRCsDisplay.LRichTextBox.Add(DRCDisplay.CurrentRichTextBox);
            }

            WindowforDRCsDisplay.panelForDRC.Controls.AddRange(WindowforDRCsDisplay.LChart.ToArray());
            WindowforDRCsDisplay.panelForDRC.Controls.AddRange(WindowforDRCsDisplay.LRichTextBox.ToArray());
            WindowforDRCsDisplay.Show();
        }