MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / apply

Method apply

source/MRMesh/MRFreeFormDeformer.cpp:203–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void FreeFormDeformer::apply() const
204{
205 auto maxRes = std::max( { resolution_.x, resolution_.y, resolution_.z } );
206
207 struct CacheLines
208 {
209 std::vector<Vector3f> xPlane;
210 std::vector<Vector3f> yLine;
211 std::vector<Vector3f> buffer;
212 };
213 tbb::enumerable_thread_specific<CacheLines> caches;
214
215 BitSetParallelFor( validPoints_, [&] ( VertId vid )
216 {
217 auto& cache = caches.local();
218 if ( cache.xPlane.empty() )
219 cache.xPlane.resize( resolution_.y * resolution_.z );
220 if ( cache.yLine.empty() )
221 cache.yLine.resize( resolution_.z );
222 if ( cache.buffer.empty() )
223 cache.buffer.resize( maxRes * ( maxRes - 1 ) / 2 - 1 );
224 coords_[vid] = applyToNormedPoint_( normedCoords_[vid], cache.xPlane, cache.yLine, cache.buffer );
225 } );
226}
227
228Vector3f FreeFormDeformer::applySinglePoint( const Vector3f& point ) const
229{

Callers 13

deformers.test.mjsFile · 0.45
TESTFunction · 0.45
TestLaplacianMethod · 0.45
changeSurface_Method · 0.45
laplacianMoveVert_Method · 0.45
positionVertsSmoothlyFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 4

maxFunction · 0.85
BitSetParallelForFunction · 0.85
emptyMethod · 0.45
resizeMethod · 0.45

Tested by 2

TESTFunction · 0.36
TestLaplacianMethod · 0.36