protected override void Algorithm(ref Cl3DModel p_Model)
        {
            Cl3DModel ConformalModel = new Cl3DModel();
            ConformalModel.LoadModel(p_Model.ModelFileFolder+ConformalMapFolder+"\\"+p_Model.ModelFileName+".m_Out.pos.m");

            Cl3DModel.Cl3DModelPointIterator iter = p_Model.GetIterator();
            List<ClTools.ClTriangle> Triangles = null;

            float ModelArea = CalculateWholeModelArea(p_Model);

            float ConformalMapArea = CalculateWholeModelArea(ConformalModel);

            if(iter.IsValid())
                do
                {
                    float area3D = 0;
                    ClTools.GetListOfTriangles(out Triangles, iter);

                //    if (Triangles.Count != 6)
                 //       continue;

                    foreach (ClTools.ClTriangle triangle in Triangles)
                        area3D += ClTools.CalculateTriangleArea(triangle);

                    area3D /= Triangles.Count;

                    iter.AddSpecificValue("ConnectedTrianglesArea", area3D);

                    Cl3DModel.Cl3DModelPointIterator ConformalIter = ConformalModel.GetIterator();
                    if (!ConformalIter.MoveToPoint(iter.PointID))
                        continue;//throw new Exception("Cannot find on conformal model point with no: " + iter.PointID.ToString());

                    float area2D = 0;
                    ClTools.GetListOfTriangles(out Triangles, ConformalIter);
                    foreach (ClTools.ClTriangle triangle in Triangles)
                        area2D += ClTools.CalculateTriangleArea(triangle);

                    area2D /= Triangles.Count;

                    float ConformalFactor = (area3D / ModelArea) / (area2D / ConformalMapArea);

                    ConformalIter.AddSpecificValue("ConformalFactor", ConformalFactor);

                } while (iter.MoveToNext());

            p_Model = ConformalModel;
        }
        private static void RunAlgorithmsForFolder()
        {
            if (m_bIsRunning)
                return;

            m_bIsRunning = true;

            ClFileLogger FileLogger = new ClFileLogger(m_sTestDirectory + "log.txt", false);
            if (m_bLogging)
            {
                ClInformationSender.RegisterReceiver(FileLogger, ClInformationSender.eInformationType.eDebugText);
                ClInformationSender.RegisterReceiver(FileLogger, ClInformationSender.eInformationType.eTextExternal);
                ClInformationSender.RegisterReceiver(FileLogger, ClInformationSender.eInformationType.eTextInternal);
                ClInformationSender.RegisterReceiver(FileLogger, ClInformationSender.eInformationType.eError);
            }
            try
            {
                ClInformationSender.SendInformation(null, ClInformationSender.eInformationType.eStartProcessing);

                int current = 1;
                int howMany = m_lFilesList.Count;

                ClInformationSender.SendInformation(null, ClInformationSender.eInformationType.eStartProcessing);

                string fullAlgorithmAdditionalData = "";
                foreach (IFaceAlgorithm alg in m_lAlgorithmsList)
                {

                    fullAlgorithmAdditionalData += "\n- " + alg.GetAlgorithmFullPath();
                    fullAlgorithmAdditionalData += "\n";
                    foreach (KeyValuePair<string, string> prop in alg.GetProperitis())
                        fullAlgorithmAdditionalData += "\t" + prop.Key + " -> " + prop.Value + "\n";
                }
                fullAlgorithmAdditionalData += "\n------------------------------";
                ClInformationSender.SendInformation(fullAlgorithmAdditionalData, ClInformationSender.eInformationType.eDebugText);

                TimeSpan mean = TimeSpan.Zero;
                foreach (String file in m_lFilesList)
                {
                    DateTime start = DateTime.Now;
                    ClInformationSender.SendInformation(((current * 100) / howMany).ToString(), ClInformationSender.eInformationType.eProgress);
                    try
                    {
                        Cl3DModel newModel = new Cl3DModel();

                        newModel.LoadModel(file);

                        foreach (IFaceAlgorithm alg in m_lAlgorithmsList)
                        {
                            alg.MakeAlgorithm(ref newModel);
                        }
                    }
                    catch (ThreadAbortException)
                    {
                        ClInformationSender.SendInformation("Processing Interrupted", ClInformationSender.eInformationType.eTextInternal);
                        break;
                    }
                    catch (Exception ex)
                    {
                        ClInformationSender.SendInformation("ERROR:\n(" + file + ")\n" + ex.ToString(), ClInformationSender.eInformationType.eDebugText);
                    }
                    DateTime stop = DateTime.Now;
                    mean += (stop - start);
                    double MeanTotalHours = mean.TotalHours;
                    double MeanTotalMin = mean.TotalMinutes;

                    int TotalTimeHours = (int)((MeanTotalHours / current) * (howMany - current));
                    int TotalTimeMin = (int)((MeanTotalMin / current) * (howMany - current));

                    TotalTimeMin = TotalTimeMin - (TotalTimeHours * 60);

                    ClInformationSender.SendInformation("Time Remaining: " + TotalTimeHours.ToString() + "h" + TotalTimeMin.ToString("00")+"min [" + current.ToString() + "/" + howMany.ToString()+"]", ClInformationSender.eInformationType.eTextExternal);
                    current++;
                }
            }
            catch (Exception e)
            {
                ClInformationSender.SendInformation("ERROR:\n" + e.ToString(), ClInformationSender.eInformationType.eError);
            }

            m_bIsRunning = false;
            ClInformationSender.SendInformation(null, ClInformationSender.eInformationType.eStopProcessing);

            ClInformationSender.UnRegisterReceiver(FileLogger, ClInformationSender.eInformationType.eDebugText);
            ClInformationSender.UnRegisterReceiver(FileLogger, ClInformationSender.eInformationType.eTextExternal);
            ClInformationSender.UnRegisterReceiver(FileLogger, ClInformationSender.eInformationType.eTextInternal);
            ClInformationSender.UnRegisterReceiver(FileLogger, ClInformationSender.eInformationType.eError);
        }
        private void toolStripButtonOpen_Click(object sender, EventArgs e)
        {
            try
            {
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    folderBrowserDialog.SelectedPath = "";
                    this.Text = APPLICATION_NAME+ " <" + openFileDialog.FileName + ">";

                    m_Model3D = new Cl3DModel();
                    m_Model3D.LoadModel(openFileDialog.FileName);
                    #if RENDER_1
                    ClRender.getInstance().AddRenderObj(new Cl3DRenderModel(m_Model3D));
                    #endif
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n Call Stack:\n\n" + ex.StackTrace, "Exception !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ClInformationSender.SendInformation("EXCEPTION\n" + ex.Message + "\n\n Call Stack:\n\n" + ex.StackTrace, ClInformationSender.eInformationType.eDebugText);
            }
        }