| 201 | } |
| 202 | |
| 203 | void 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 | |
| 228 | Vector3f FreeFormDeformer::applySinglePoint( const Vector3f& point ) const |
| 229 | { |