Blender V4.3
NodeShape.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include <vector>
13
14#include "../geometry/BBox.h"
15#include "../geometry/Geom.h"
16
18
19#include "FrsMaterial.h"
20#include "Node.h"
21#include "Rep.h"
22
23using namespace std;
24
25namespace Freestyle {
26
27using namespace Geometry;
28
29class NodeShape : public Node {
30 public:
31 inline NodeShape() : Node() {}
32
33 virtual ~NodeShape();
34
39 virtual void AddRep(Rep *iRep)
40 {
41 if (nullptr == iRep) {
42 return;
43 }
44 _Shapes.push_back(iRep);
45 iRep->addRef();
46
47 // updates bbox:
48 AddBBox(iRep->bbox());
49 }
50
52 virtual void accept(SceneVisitor &v);
53
55 inline void setFrsMaterial(const FrsMaterial &iMaterial)
56 {
57 _FrsMaterial = iMaterial;
58 }
59
63 {
64 return _FrsMaterial;
65 }
66
67 inline const vector<Rep *> &shapes()
68 {
69 return _Shapes;
70 }
71
72 private:
74 vector<Rep *> _Shapes;
75
77 FrsMaterial _FrsMaterial;
78};
79
80} /* namespace Freestyle */
A class to hold a bounding box.
Configuration definitions.
Class used to handle materials.
Vectors and Matrices (useful type definitions)
Abstract class for scene graph nodes. Inherits from BaseObject which defines the addRef release mecha...
Base class for all shapes. Inherits from BasicObjects for references counter management (addRef,...
ATTR_WARN_UNUSED_RESULT const BMVert * v
const vector< Rep * > & shapes()
Definition NodeShape.h:67
virtual void AddRep(Rep *iRep)
Definition NodeShape.h:39
void setFrsMaterial(const FrsMaterial &iMaterial)
Definition NodeShape.h:55
FrsMaterial & frs_material()
Definition NodeShape.h:62
virtual void accept(SceneVisitor &v)
Definition NodeShape.cpp:30
virtual void AddBBox(const BBox< Vec3r > &iBox)
Definition Node.h:63
virtual const BBox< Vec3f > & bbox() const
Definition Rep.h:111
inherits from class Rep
Definition AppCanvas.cpp:20