public Cl3DModelPointIterator RemovePointFromModel(Cl3DModelPointIterator p_pPointToRemoveFromModel)
        {
            if (m_pFirstPointInModel == null || p_pPointToRemoveFromModel == null || p_pPointToRemoveFromModel.m_pActualPoint == null)
                return null;

            foreach (KeyValuePair<string, Cl3DModelPoint> point in m_dSpecificPoints)
            {
                if (point.Value.m_PointID == p_pPointToRemoveFromModel.PointID)
                {
                    m_dSpecificPoints.Remove(point.Key);
                    break;
                }
            }

            if (m_pFirstPointInModel.m_PointID == p_pPointToRemoveFromModel.m_pActualPoint.m_PointID)
                m_pFirstPointInModel = m_pFirstPointInModel.m_NextPoint;

            List<Cl3DModelPointIterator> listOfNeighbors = p_pPointToRemoveFromModel.GetListOfNeighbors();
            foreach (Cl3DModelPointIterator neighbor in listOfNeighbors)
                neighbor.RemoveNeighbor(p_pPointToRemoveFromModel);

            if (p_pPointToRemoveFromModel.m_pActualPoint.m_NextPoint != null)
                p_pPointToRemoveFromModel.m_pActualPoint.m_NextPoint.m_PrevPoint = p_pPointToRemoveFromModel.m_pActualPoint.m_PrevPoint;
            if (p_pPointToRemoveFromModel.m_pActualPoint.m_PrevPoint != null)
                p_pPointToRemoveFromModel.m_pActualPoint.m_PrevPoint.m_NextPoint = p_pPointToRemoveFromModel.m_pActualPoint.m_NextPoint;

            m_dPointsInTheModel.Remove(p_pPointToRemoveFromModel.PointID);

            Cl3DModel Model = p_pPointToRemoveFromModel.m_mManagedModel;
            p_pPointToRemoveFromModel.m_mManagedModel = null;

            Cl3DModelPoint ActualPoint = p_pPointToRemoveFromModel.m_pActualPoint;
            p_pPointToRemoveFromModel.m_pActualPoint = null;

            m_uPointsCount--;

            return new Cl3DModelPointIterator(Model, ActualPoint.m_NextPoint);
        }
 public bool GetSpecificPoint(string p_sSpecificPoint, ref Cl3DModelPointIterator p_point)
 {
     Cl3DModelPoint point = null;
     bool retVal = m_dSpecificPoints.TryGetValue(p_sSpecificPoint, out point);
     if (retVal == true)
     {
         p_point = point.GetIterator();
     }
     return retVal;
 }
        public bool IsThisPointInSpecificPoints(Cl3DModelPointIterator point, ref string p_eSpecificPoint)
        {
            foreach (KeyValuePair<string, Cl3DModelPoint> points in m_dSpecificPoints)
            {
                if (point.PointID == points.Value.m_PointID)
                {
                    p_eSpecificPoint = points.Key;
                    return true;
                }
            }

            return false;
        }
 public bool GetSpecificPoint(eSpecificPoints p_sSpecificPoint, ref Cl3DModelPointIterator p_point)
 {
     return GetSpecificPoint(p_sSpecificPoint.ToString(), ref p_point);
 }
 public void AddSpecificPoint(String p_eSpecificPoint, Cl3DModelPointIterator p_point)
 {
     if (p_point == null)
         throw new Exception("Cannot add null point to the model");
     if (m_dSpecificPoints.ContainsKey(p_eSpecificPoint))
         m_dSpecificPoints.Remove(p_eSpecificPoint);
     m_dSpecificPoints.Add(p_eSpecificPoint, p_point.m_pActualPoint);
     ClInformationSender.SendInformation("New " + p_eSpecificPoint + "\n X: " + p_point.X.ToString() + "\n Y: " + p_point.Y.ToString() + "\n Z: " + p_point.Z.ToString(), ClInformationSender.eInformationType.eDebugText);
 }
 //-------- MENAGE POINTS -----------
 public void AddSpecificPoint(eSpecificPoints p_eSpecificPoint, Cl3DModelPointIterator p_point)
 {
     AddSpecificPoint(p_eSpecificPoint.ToString(), p_point);
 }
            public void RemoveNeighbor(Cl3DModelPointIterator p_PointInModelToRemoveFromNeighbors)
            {
                if (m_pActualPoint == null)
                    throw new Exception("Point is not valid, probable the 3D model has no points");

                if (p_PointInModelToRemoveFromNeighbors == null)
                    throw new Exception("Cannot remove NULL point from neighbors");

                m_pActualPoint.m_NeighborhoodsList.Remove(p_PointInModelToRemoveFromNeighbors.m_pActualPoint);
                p_PointInModelToRemoveFromNeighbors.m_pActualPoint.m_NeighborhoodsList.Remove(m_pActualPoint);
            }
            public void AddNeighbor(Cl3DModelPointIterator p_NewPointInModel)
            {
                if (m_pActualPoint == null)
                    throw new Exception("Point is not valid, probably the 3D model has no points");

                if (p_NewPointInModel == null)
                    throw new Exception("Cannot add NULL neighbor to the point");

                if (p_NewPointInModel.PointID == m_pActualPoint.m_PointID)
                    return;

                foreach (Cl3DModelPoint point in m_pActualPoint.m_NeighborhoodsList)
                    if (point.m_PointID == p_NewPointInModel.PointID)
                        return;

                m_pActualPoint.m_NeighborhoodsList.Add(p_NewPointInModel.m_pActualPoint);
                try
                {
                    p_NewPointInModel.m_pActualPoint.m_NeighborhoodsList.Add(m_pActualPoint);
                }
                catch (Exception)
                {
                    m_pActualPoint.m_NeighborhoodsList.Remove(p_NewPointInModel.m_pActualPoint);
                }
            }