Files
test2/source/blender/freestyle/intern/scene_graph/NodeShape.h
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

81 lines
1.4 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup freestyle
* \brief Class to build a shape node. It contains a Rep, which is the shape geometry
*/
#include <vector>
#include "../geometry/BBox.h"
#include "../geometry/Geom.h"
#include "../system/FreestyleConfig.h"
#include "FrsMaterial.h"
#include "Node.h"
#include "Rep.h"
using namespace std;
namespace Freestyle {
using namespace Geometry;
class NodeShape : public Node {
public:
inline NodeShape() : Node()
{
}
virtual ~NodeShape();
/** Adds a Rep to the _Shapes list
* The delete of the rep is done when it is not used any more by the Scene Manager.
* So, it must not be deleted by the caller
*/
virtual void AddRep(Rep *iRep)
{
if (NULL == iRep) {
return;
}
_Shapes.push_back(iRep);
iRep->addRef();
// updates bbox:
AddBBox(iRep->bbox());
}
/** Accept the corresponding visitor */
virtual void accept(SceneVisitor &v);
/** Sets the shape material */
inline void setFrsMaterial(const FrsMaterial &iMaterial)
{
_FrsMaterial = iMaterial;
}
/** accessors */
/** returns the shape's material */
inline FrsMaterial &frs_material()
{
return _FrsMaterial;
}
inline const vector<Rep *> &shapes()
{
return _Shapes;
}
private:
/** list of shapes */
vector<Rep *> _Shapes;
/** Shape Material */
FrsMaterial _FrsMaterial;
};
} /* namespace Freestyle */