89 Create(pGrid, Grow, Generalisation, Grow_Type);
99 Create(pGrid, Grow, Start, nMaxLevels, Generalisation, Grow_Type);
118 if( pGrid && pGrid->
is_Valid() && Grow > 1.0 && (pGrid->
Get_NX() > Grow || pGrid->
Get_NY() > Grow) )
122 m_Grow_Type = Grow_Type;
126 m_Generalisation = Generalisation;
128 _Get_Next_Level(pGrid);
139 if( pGrid && pGrid->
is_Valid() && Grow > 0.0 && (pGrid->
Get_NX() > Grow || pGrid->
Get_NY() > Grow) )
143 m_Grow_Type = Grow_Type;
144 m_nMaxLevels = nMaxLevels;
147 m_Generalisation = Generalisation;
151 _Get_Next_Level(pGrid, Start);
155 _Get_Next_Level(pGrid);
169 for(
int i=0; i<m_nLevels; i++)
171 delete(m_pLevels[i]);
192 bool CSG_Grid_Pyramid::_Get_Next_Level(
CSG_Grid *pGrid)
194 if( (m_nMaxLevels <= 0 || m_nLevels < m_nMaxLevels) )
199 switch( m_Grow_Type )
203 default: Cellsize = pGrid->
Get_Cellsize() * m_Grow;
break;
206 nx = (int)(1.5 + m_pGrid->
Get_XRange() / Cellsize);
if( nx < 1 ) nx = 1;
207 ny = (int)(1.5 + m_pGrid->
Get_YRange() / Cellsize);
if( ny < 1 ) ny = 1;
209 if( nx > 1 || ny > 1 )
217 m_pLevels[m_nLevels++] = pNext;
219 _Get_Next_Level(pNext);
229 bool CSG_Grid_Pyramid::_Get_Next_Level(
CSG_Grid *pGrid,
double Cellsize)
231 if( (m_nMaxLevels <= 0 || m_nLevels < m_nMaxLevels) )
235 nx = (int)(1.5 + m_pGrid->
Get_XRange() / Cellsize);
if( nx < 1 ) nx = 1;
236 ny = (int)(1.5 + m_pGrid->
Get_YRange() / Cellsize);
if( ny < 1 ) ny = 1;
238 if( nx > 1 || ny > 1 )
246 m_pLevels[m_nLevels++] = pNext;
248 _Get_Next_Level(pNext);