Blender  V2.93
NodeShape.cpp
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 
22 #include "NodeShape.h"
23 
24 namespace Freestyle {
25 
27 {
28  vector<Rep *>::iterator rep;
29 
30  if (!_Shapes.empty()) {
31  for (rep = _Shapes.begin(); rep != _Shapes.end(); ++rep) {
32  int refCount = (*rep)->destroy();
33  if (0 == refCount) {
34  delete (*rep);
35  }
36  }
37 
38  _Shapes.clear();
39  }
40 }
41 
43 {
44  v.visitNodeShape(*this);
45 
46  v.visitFrsMaterial(_FrsMaterial);
47 
48  v.visitNodeShapeBefore(*this);
49  vector<Rep *>::iterator rep;
50  for (rep = _Shapes.begin(); rep != _Shapes.end(); ++rep) {
51  (*rep)->accept(v);
52  }
53  v.visitNodeShapeAfter(*this);
54 }
55 
56 } /* namespace Freestyle */
Class to build a shape node. It contains a Rep, which is the shape geometry.
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual ~NodeShape()
Definition: NodeShape.cpp:26
virtual void accept(SceneVisitor &v)
Definition: NodeShape.cpp:42
inherits from class Rep
Definition: AppCanvas.cpp:32