2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2012-2022 Blender Authors
|
2023-06-14 23:30:43 +10:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
|
|
|
|
* \brief Class to define a cell grid surrounding the bounding box of the scene
|
2012-12-22 18:25:01 +00:00
|
|
|
*/
|
2008-04-30 15:41:54 +00:00
|
|
|
|
|
|
|
|
#include "HashGrid.h"
|
|
|
|
|
|
2022-10-26 18:58:04 +02:00
|
|
|
#include "BLI_sys_types.h"
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
void HashGrid::clear()
|
|
|
|
|
{
|
2012-12-22 18:25:01 +00:00
|
|
|
if (!_cells.empty()) {
|
2013-03-07 23:17:23 +00:00
|
|
|
for (GridHashTable::iterator it = _cells.begin(); it != _cells.end(); it++) {
|
|
|
|
|
Cell *cell = (*it).second;
|
2012-12-22 18:25:01 +00:00
|
|
|
delete cell;
|
|
|
|
|
}
|
|
|
|
|
_cells.clear();
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-22 18:25:01 +00:00
|
|
|
Grid::clear();
|
2008-04-30 15:41:54 +00:00
|
|
|
}
|
|
|
|
|
|
2022-09-26 10:04:44 +10:00
|
|
|
void HashGrid::configure(const Vec3r &orig, const Vec3r &size, uint nb)
|
2012-12-22 18:25:01 +00:00
|
|
|
{
|
|
|
|
|
Grid::configure(orig, size, nb);
|
2008-04-30 15:41:54 +00:00
|
|
|
}
|
2013-04-09 00:46:49 +00:00
|
|
|
|
|
|
|
|
} /* namespace Freestyle */
|