Blender V4.3
WingedEdgeBuilder.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
13#include "WEdge.h"
14
18
21
22namespace Freestyle {
23
25 public:
27 {
28 _current_wshape = nullptr;
29 _current_frs_material = nullptr;
30 _current_matrix = nullptr;
31 _winged_edge = new WingedEdge; // Not deleted by the destructor
32 _pRenderMonitor = nullptr;
33 }
34
36 {
37 for (vector<Matrix44r *>::iterator it = _matrices_stack.begin(); it != _matrices_stack.end();
38 ++it)
39 {
40 delete *it;
41 }
42 _matrices_stack.clear();
43 }
44
48
50
51 //
52 // Accessors
53 //
55
57 {
58 return _winged_edge;
59 }
60
62 {
63 return _current_wshape;
64 }
65
67 {
68 return _current_frs_material;
69 }
70
72 {
73 return _current_matrix;
74 }
75
76 //
77 // Modifiers
78 //
80
81 inline void setCurrentWShape(WShape *wshape)
82 {
83 _current_wshape = wshape;
84 }
85
87 {
88 _current_frs_material = mat;
89 }
90
91#if 0
92 inline void setCurrentMatrix(Matrix44r *matrix)
93 {
94 _current_matrix = matrix;
95 }
96#endif
97
98 inline void setRenderMonitor(RenderMonitor *iRenderMonitor)
99 {
100 _pRenderMonitor = iRenderMonitor;
101 }
102
103 protected:
104 virtual bool buildWShape(WShape &shape, IndexedFaceSet &ifs);
105 virtual void buildWVertices(WShape &shape, const float *vertices, uint vsize);
106
108
109 private:
110 void buildTriangleStrip(const float *vertices,
111 const float *normals,
112 vector<FrsMaterial> &iMaterials,
113 const float *texCoords,
114 const IndexedFaceSet::FaceEdgeMark *iFaceEdgeMarks,
115 const uint *vindices,
116 const uint *nindices,
117 const uint *mindices,
118 const uint *tindices,
119 const uint nvertices);
120
121 void buildTriangleFan(const float *vertices,
122 const float *normals,
123 vector<FrsMaterial> &iMaterials,
124 const float *texCoords,
125 const IndexedFaceSet::FaceEdgeMark *iFaceEdgeMarks,
126 const uint *vindices,
127 const uint *nindices,
128 const uint *mindices,
129 const uint *tindices,
130 const uint nvertices);
131
132 void buildTriangles(const float *vertices,
133 const float *normals,
134 vector<FrsMaterial> &iMaterials,
135 const float *texCoords,
136 const IndexedFaceSet::FaceEdgeMark *iFaceEdgeMarks,
137 const uint *vindices,
138 const uint *nindices,
139 const uint *mindices,
140 const uint *tindices,
141 const uint nvertices);
142
143 void transformVertices(const float *vertices,
144 uint vsize,
145 const Matrix44r &transform,
146 float *res);
147
148 void transformNormals(const float *normals, uint nsize, const Matrix44r &transform, float *res);
149
150 WShape *_current_wshape;
151 FrsMaterial *_current_frs_material;
152 WingedEdge *_winged_edge;
153 Matrix44r *_current_matrix;
154 vector<Matrix44r *> _matrices_stack;
155
156#ifdef WITH_CXX_GUARDEDALLOC
157 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WingedEdgeBuilder")
158#endif
159};
160
161} /* namespace Freestyle */
unsigned int uint
Configuration definitions.
A Set of indexed faces to represent a surface object.
Class to represent a transform node. A Transform node contains one or several children,...
Classes defining the basic "Iterator" design pattern.
Class to visit (without doing anything) a scene graph structure.
Classes to define a Winged Edge data structure.
void setCurrentFrsMaterial(FrsMaterial *mat)
void setCurrentWShape(WShape *wshape)
virtual void visitNodeTransformAfter(NodeTransform &)
void setRenderMonitor(RenderMonitor *iRenderMonitor)
virtual bool buildWShape(WShape &shape, IndexedFaceSet &ifs)
virtual void buildWVertices(WShape &shape, const float *vertices, uint vsize)
inherits from class Rep
Definition AppCanvas.cpp:20