public Hull Copy() { Hull copy = new Hull(); if (IsValid) { copy.m_chines = null; // need to manually make a deep copy copy.m_bulkheads = new List <Bulkhead>(); foreach (Bulkhead bulk in m_bulkheads) { copy.m_bulkheads.Add(bulk.Copy()); } // need to manually make a deep copy copy.m_chines = new List <Point3DCollection>(m_chines); foreach (Point3DCollection chine in m_chines) { copy.m_chines.Add(chine.Clone()); } copy.m_IsValid = true; copy.RepositionToZero(); } return(copy); }
// Returns a list of "full" bulkheads (instead of the half bulkheads that are normally stored) public Hull CopyToFullHull() { Hull fullHull = new Hull(); if (IsValid) { fullHull.m_chines = null; fullHull.m_bulkheads = new List <Bulkhead>(); foreach (Bulkhead bulk in m_bulkheads) { fullHull.m_bulkheads.Add(bulk.CopyWithReflection()); } fullHull.m_IsValid = true; fullHull.PrepareChines(POINTS_PER_CHINE); fullHull.RepositionToZero(); } return(fullHull); }