/// <summary>
        /// TODO 解决那两个地方为啥是加2
        /// </summary>
        /// <param name="inoutSpans"></param>
        /// <param name="maxIterations"></param>
        private void expandRegions(List<OpenHeightSpan> inoutSpans ,int maxIterations)
        {
            if( inoutSpans.Count == 0 )
            {
                return; 
            }

            int iterCount = 0; 
            while(true)
            {
                int skipped = 0; 

                for(int iSpan = 0; iSpan < inoutSpans.Count; ++iSpan)
                {
                    OpenHeightSpan span = inoutSpans[iSpan]; 
                    if( null == span )
                    {
                        skipped++;
                        continue; 
                    }

                    int spanRegion = NULL_REGION;
                    int regionCenterDist = int.MaxValue; 

                    //看看邻居的RegionID情况
                    for(int dir = 0; dir < 4; ++dir)
                    {
                        OpenHeightSpan nSpan = span.getNeighbor(dir); 
                        if( null == nSpan )
                        {
                            continue; 
                        }

                        if( nSpan.regionID() > NULL_REGION  )
                        {
                            //TODO 为啥是+2
                            //初始的话,这个值都是0的。
                            if( nSpan.distanceToRegionCore() + 2 < regionCenterDist  )
                            {
                                int sameRegionCount = 0; 
                                if( mUseConservativeExpansion )
                                {
                                    for( int ndir = 0; ndir < 4; ++ndir )
                                    {
                                        OpenHeightSpan nnSpan = nSpan.getNeighbor(ndir); 
                                        if( null == nnSpan )
                                        {
                                            continue; 
                                        }

                                        if( nnSpan.regionID() == nSpan.regionID() )
                                        {
                                            sameRegionCount++; 
                                        }
                                    }     
                                }

                                //如果轴对齐邻居的邻居的Region相同,也就是多于1个体素就可以了
                                if( !mUseConservativeExpansion
                                    || sameRegionCount > 1)
                                {
                                    //TODO 为啥要加2
                                    spanRegion = nSpan.regionID();
                                    regionCenterDist = nSpan.distanceToRegionCore() + 2; 
                                }
                            }
                        }
                    } // for 

                    if( spanRegion != NULL_REGION )
                    {
                        inoutSpans[iSpan] = null;
                        span.setRegionID(spanRegion); 
                    }
                    else
                    {
                        skipped++; 
                    }
                } // for 

                if( skipped == inoutSpans.Count )
                {
                    break; 
                }

                if( maxIterations != -1)
                {
                    iterCount++; 
                    if( iterCount > maxIterations )
                    {
                        break; 
                    }
                }
            }
        }