public void CollectIntersect(ITestIntersect pTestIntersect, ref List <IElement> rst) { if (m_pRoot == null) { return; } if (pTestIntersect == null) { return; } rst.Clear(); if (pTestIntersect.TestIntersect(m_pRoot.m_fMinX, m_pRoot.m_fMaxX, m_pRoot.m_fMinZ, m_pRoot.m_fMaxZ)) { m_pRoot.CollectIntersect(pTestIntersect, ref rst); } foreach (IElement element in m_lstElement) { if (pTestIntersect.TestIntersect(element)) { rst.Add(element); } } }
public void CollectIntersect(ITestIntersect pTestIntersect, ref List <IElement> rst) { if (pTestIntersect == null) { return; } if (m_pTopLeft != null && pTestIntersect.TestIntersect(m_pTopLeft.m_fMinX, m_pTopLeft.m_fMaxX, m_pTopLeft.m_fMinZ, m_pTopLeft.m_fMaxZ)) { m_pTopLeft.CollectIntersect(pTestIntersect, ref rst); } if (m_pTopRight != null && pTestIntersect.TestIntersect(m_pTopRight.m_fMinX, m_pTopRight.m_fMaxX, m_pTopRight.m_fMinZ, m_pTopRight.m_fMaxZ)) { m_pTopRight.CollectIntersect(pTestIntersect, ref rst); } if (m_pBottomLeft != null && pTestIntersect.TestIntersect(m_pBottomLeft.m_fMinX, m_pBottomLeft.m_fMaxX, m_pBottomLeft.m_fMinZ, m_pBottomLeft.m_fMaxZ)) { m_pBottomLeft.CollectIntersect(pTestIntersect, ref rst); } if (m_pBottomRight != null && pTestIntersect.TestIntersect(m_pBottomRight.m_fMinX, m_pBottomRight.m_fMaxX, m_pBottomRight.m_fMinZ, m_pBottomRight.m_fMaxZ)) { m_pBottomRight.CollectIntersect(pTestIntersect, ref rst); } foreach (IElement element in m_lstElement) { if (pTestIntersect.TestIntersect(element)) { rst.Add(element); } } }