Blender V4.3
WFillGrid.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2012-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#include "WFillGrid.h"
11#include "WEdge.h"
12
13namespace Freestyle {
14
16{
17 if (!_winged_edge || !_grid) {
18 return;
19 }
20
21 vector<WShape *> wshapes = _winged_edge->getWShapes();
22 vector<WVertex *> fvertices;
23 vector<Vec3r> vectors;
24 vector<WFace *> faces;
25
26 for (vector<WShape *>::const_iterator it = wshapes.begin(); it != wshapes.end(); ++it) {
27 faces = (*it)->GetFaceList();
28
29 for (vector<WFace *>::const_iterator f = faces.begin(); f != faces.end(); ++f) {
30 (*f)->RetrieveVertexList(fvertices);
31
32 for (vector<WVertex *>::const_iterator wv = fvertices.begin(); wv != fvertices.end(); ++wv) {
33 vectors.emplace_back((*wv)->GetVertex());
34 }
35
36 // occluder will be deleted by the grid
37 Polygon3r *occluder = new Polygon3r(vectors, (*f)->GetNormal());
38 occluder->setId(_polygon_id++);
39 occluder->userdata = (void *)(*f);
40 _grid->insertOccluder(occluder);
41 vectors.clear();
42 fvertices.clear();
43 }
44 faces.clear();
45 }
46}
47
48} /* namespace Freestyle */
Classes to define a Winged Edge data structure.
Class to fill in a grid from a SceneGraph (uses only the WingedEdge structures)
void insertOccluder(Polygon3r *occluder)
Definition Grid.cpp:144
vector< WShape * > & getWShapes()
Definition WEdge.h:1327
static char faces[256]
inherits from class Rep
Definition AppCanvas.cpp:20