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