Blender  V2.93
WFillGrid.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 "WEdge.h"
25 
26 #include "../geometry/Grid.h"
27 #include "../geometry/Polygon.h"
28 
29 #ifdef WITH_CXX_GUARDEDALLOC
30 # include "MEM_guardedalloc.h"
31 #endif
32 
33 namespace Freestyle {
34 
35 class WFillGrid {
36  public:
37  inline WFillGrid(Grid *grid = NULL, WingedEdge *winged_edge = NULL)
38  {
39  _winged_edge = winged_edge;
40  _grid = grid;
41  _polygon_id = 0;
42  }
43 
44  virtual ~WFillGrid()
45  {
46  }
47 
48  void fillGrid();
49 
52  {
53  return _winged_edge;
54  }
55 
57  {
58  return _grid;
59  }
60 
62  void setWingedEdge(WingedEdge *winged_edge)
63  {
64  if (winged_edge) {
65  _winged_edge = winged_edge;
66  }
67  }
68 
69  void setGrid(Grid *grid)
70  {
71  if (grid) {
72  _grid = grid;
73  }
74  }
75 
76  private:
77  Grid *_grid;
78  WingedEdge *_winged_edge;
79  unsigned _polygon_id;
80 
81 #ifdef WITH_CXX_GUARDEDALLOC
82  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WFillGrid")
83 #endif
84 };
85 
86 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
Classes to define a Winged Edge data structure.
void setGrid(Grid *grid)
Definition: WFillGrid.h:69
WFillGrid(Grid *grid=NULL, WingedEdge *winged_edge=NULL)
Definition: WFillGrid.h:37
virtual ~WFillGrid()
Definition: WFillGrid.h:44
void setWingedEdge(WingedEdge *winged_edge)
Definition: WFillGrid.h:62
WingedEdge * getWingedEdge()
Definition: WFillGrid.h:51
inherits from class Rep
Definition: AppCanvas.cpp:32