Blender V5.0
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
11
12#include "Geom.h"
13
15
16#include "MEM_guardedalloc.h"
17
18namespace Freestyle {
19
20using namespace Geometry;
21
23 public:
24 inline GeomCleaner() {}
25 inline ~GeomCleaner() {}
26
48 static void SortIndexedVertexArray(const float *iVertices,
49 uint iVSize,
50 const uint *iIndices,
51 uint iISize,
52 float **oVertices,
53 uint **oIndices);
54
76 static void CompressIndexedVertexArray(const float *iVertices,
77 uint iVSize,
78 const uint *iIndices,
79 uint iISize,
80 float **oVertices,
81 uint *oVSize,
82 uint **oIndices);
83
104 static void SortAndCompressIndexedVertexArray(const float *iVertices,
105 uint iVSize,
106 const uint *iIndices,
107 uint iISize,
108 float **oVertices,
109 uint *oVSize,
110 uint **oIndices);
111
133 static void CleanIndexedVertexArray(const float *iVertices,
134 uint iVSize,
135 const uint *iIndices,
136 uint iISize,
137 float **oVertices,
138 uint *oVSize,
139 uint **oIndices);
140
141 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:GeomCleaner")
142};
143
145// inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
146
150 private:
151 Vec3f _Vector;
152 uint _index;
153
154 public:
155 inline IndexedVertex() {}
156
157 inline IndexedVertex(Vec3f iVector, uint iIndex)
158 {
159 _Vector = iVector;
160 _index = iIndex;
161 }
162
164 inline const Vec3f &vector() const
165 {
166 return _Vector;
167 }
168
169 inline uint index()
170 {
171 return _index;
172 }
173
174 inline float x()
175 {
176 return _Vector[0];
177 }
178
179 inline float y()
180 {
181 return _Vector[1];
182 }
183
184 inline float z()
185 {
186 return _Vector[2];
187 }
188
190 inline void setVector(const Vec3f &iVector)
191 {
192 _Vector = iVector;
193 }
194
195 inline void setIndex(uint iIndex)
196 {
197 _index = iIndex;
198 }
199
202 {
203 _Vector = iv._Vector;
204 _index = iv._index;
205 return *this;
206 }
207
208 inline float operator[](const uint i)
209 {
210 return _Vector[i];
211 }
212
213 // friend inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
214 inline bool operator<(const IndexedVertex &v) const
215 {
216 return (_Vector < v._Vector);
217 }
218
219 inline bool operator==(const IndexedVertex &v)
220 {
221 return (_Vector == v._Vector);
222 }
223
224 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:IndexedVertex")
225};
226
227#if 0
228bool operator<(const IndexedVertex &iv1, const IndexedVertex &iv2)
229{
230 return iv1.operator<(iv2);
231}
232#endif
233
234} /* namespace Freestyle */
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)
ccl_device_inline int3 operator<(const float3 a, const float3 b)
VecMat::Vec3< float > Vec3f
Definition Geom.h:28
inherits from class Rep
Definition AppCanvas.cpp:20
i
Definition text_draw.cc:230