Blender V4.3
GeomCleaner.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 "Geom.h"
13
15
16#ifdef WITH_CXX_GUARDEDALLOC
17# include "MEM_guardedalloc.h"
18#endif
19
20namespace Freestyle {
21
22using namespace Geometry;
23
25 public:
26 inline GeomCleaner() {}
27 inline ~GeomCleaner() {}
28
50 static void SortIndexedVertexArray(const float *iVertices,
51 uint iVSize,
52 const uint *iIndices,
53 uint iISize,
54 float **oVertices,
55 uint **oIndices);
56
78 static void CompressIndexedVertexArray(const float *iVertices,
79 uint iVSize,
80 const uint *iIndices,
81 uint iISize,
82 float **oVertices,
83 uint *oVSize,
84 uint **oIndices);
85
106 static void SortAndCompressIndexedVertexArray(const float *iVertices,
107 uint iVSize,
108 const uint *iIndices,
109 uint iISize,
110 float **oVertices,
111 uint *oVSize,
112 uint **oIndices);
113
135 static void CleanIndexedVertexArray(const float *iVertices,
136 uint iVSize,
137 const uint *iIndices,
138 uint iISize,
139 float **oVertices,
140 uint *oVSize,
141 uint **oIndices);
142
143#ifdef WITH_CXX_GUARDEDALLOC
144 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:GeomCleaner")
145#endif
146};
147
149// inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
150
154 private:
155 Vec3f _Vector;
156 uint _index;
157
158 public:
159 inline IndexedVertex() {}
160
161 inline IndexedVertex(Vec3f iVector, uint iIndex)
162 {
163 _Vector = iVector;
164 _index = iIndex;
165 }
166
168 inline const Vec3f &vector() const
169 {
170 return _Vector;
171 }
172
173 inline uint index()
174 {
175 return _index;
176 }
177
178 inline float x()
179 {
180 return _Vector[0];
181 }
182
183 inline float y()
184 {
185 return _Vector[1];
186 }
187
188 inline float z()
189 {
190 return _Vector[2];
191 }
192
194 inline void setVector(const Vec3f &iVector)
195 {
196 _Vector = iVector;
197 }
198
199 inline void setIndex(uint iIndex)
200 {
201 _index = iIndex;
202 }
203
206 {
207 _Vector = iv._Vector;
208 _index = iv._index;
209 return *this;
210 }
211
212 inline float operator[](const uint i)
213 {
214 return _Vector[i];
215 }
216
217 // friend inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
218 inline bool operator<(const IndexedVertex &v) const
219 {
220 return (_Vector < v._Vector);
221 }
222
223 inline bool operator==(const IndexedVertex &v)
224 {
225 return (_Vector == v._Vector);
226 }
227
228#ifdef WITH_CXX_GUARDEDALLOC
229 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:IndexedVertex")
230#endif
231};
232
233#if 0
234bool operator<(const IndexedVertex &iv1, const IndexedVertex &iv2)
235{
236 return iv1.operator<(iv2);
237}
238#endif
239
240} /* namespace Freestyle */
bool operator<(const BCAnimationCurve &lhs, const BCAnimationCurve &rhs)
unsigned int uint
Configuration definitions.
Vectors and Matrices (useful type definitions)
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
static void SortIndexedVertexArray(const float *iVertices, uint iVSize, const uint *iIndices, uint iISize, float **oVertices, uint **oIndices)
static void CompressIndexedVertexArray(const float *iVertices, uint iVSize, const uint *iIndices, uint iISize, float **oVertices, uint *oVSize, uint **oIndices)
static void SortAndCompressIndexedVertexArray(const float *iVertices, uint iVSize, const uint *iIndices, uint iISize, float **oVertices, uint *oVSize, uint **oIndices)
static void CleanIndexedVertexArray(const float *iVertices, uint iVSize, const uint *iIndices, uint iISize, float **oVertices, uint *oVSize, uint **oIndices)
IndexedVertex(Vec3f iVector, uint iIndex)
const Vec3f & vector() const
void setIndex(uint iIndex)
IndexedVertex & operator=(const IndexedVertex &iv)
float operator[](const uint i)
void setVector(const Vec3f &iVector)
bool operator<(const IndexedVertex &v) const
bool operator==(const IndexedVertex &v)
inherits from class Rep
Definition AppCanvas.cpp:20