Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NodeShape.cpp « scene_graph « intern « freestyle « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d9cb48bdcb44183bfd2467f0ff74a728c0a4405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: GPL-2.0-or-later */

/** \file
 * \ingroup freestyle
 * \brief Class to build a shape node. It contains a Rep, which is the shape geometry
 */

#include "NodeShape.h"

namespace Freestyle {

NodeShape::~NodeShape()
{
  vector<Rep *>::iterator rep;

  if (!_Shapes.empty()) {
    for (rep = _Shapes.begin(); rep != _Shapes.end(); ++rep) {
      int refCount = (*rep)->destroy();
      if (0 == refCount) {
        delete (*rep);
      }
    }

    _Shapes.clear();
  }
}

void NodeShape::accept(SceneVisitor &v)
{
  v.visitNodeShape(*this);

  v.visitFrsMaterial(_FrsMaterial);

  v.visitNodeShapeBefore(*this);
  vector<Rep *>::iterator rep;
  for (rep = _Shapes.begin(); rep != _Shapes.end(); ++rep) {
    (*rep)->accept(v);
  }
  v.visitNodeShapeAfter(*this);
}

} /* namespace Freestyle */