Blender  V2.93
FastGrid.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include "Grid.h"
25 
26 namespace Freestyle {
27 
33 class FastGrid : public Grid {
34  public:
35  FastGrid() : Grid()
36  {
37  _cells = NULL;
38  _cells_size = 0;
39  }
40 
41  virtual ~FastGrid()
42  {
43  clear();
44  }
45 
50  virtual void clear();
51 
60  virtual void configure(const Vec3r &orig, const Vec3r &size, unsigned nb);
61 
63  Cell *getCell(const Vec3u &p);
64 
66  virtual void fillCell(const Vec3u &p, Cell &cell);
67 
68  protected:
70  unsigned _cells_size;
71 
72 #ifdef WITH_CXX_GUARDEDALLOC
73  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:FastGrid")
74 #endif
75 };
76 
77 } /* namespace Freestyle */
Base class to define a cell grid surrounding the bounding box of the scene.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Cell * getCell(const Vec3u &p)
Definition: FastGrid.cpp:57
unsigned _cells_size
Definition: FastGrid.h:70
virtual void configure(const Vec3r &orig, const Vec3r &size, unsigned nb)
Definition: FastGrid.cpp:49
virtual void fillCell(const Vec3u &p, Cell &cell)
Definition: FastGrid.cpp:73
virtual void clear()
Definition: FastGrid.cpp:31
virtual ~FastGrid()
Definition: FastGrid.h:41
inherits from class Rep
Definition: AppCanvas.cpp:32