30 std::numeric_limits<unsigned int>::max()};
31 template <
typename DT,
typename IT>
34 const unsigned int *primitiveIds,
35 const float *barycentricCoordinates,
36 const IT *connectivityList,
39 const size_t &nTuples,
40 const size_t &nComponents = 1,
41 const DT &missingValue
42 = std::numeric_limits<DT>::has_quiet_NaN
43 ? std::numeric_limits<DT>::quiet_NaN()
44 : std::numeric_limits<DT>::max()) const;
46 template <
typename DT>
49 const unsigned int *primitiveIds,
52 const size_t &nTuples,
53 const size_t &nComponents = 1,
54 const DT &missingValue
55 = std::numeric_limits<DT>::has_quiet_NaN
56 ? std::numeric_limits<DT>::quiet_NaN()
57 : std::numeric_limits<DT>::max()) const;
61template <
typename DT,
typename IT>
64 const unsigned int *primitiveIds,
65 const float *barycentricCoordinates,
66 const IT *connectivityList,
69 const size_t &nTuples,
70 const size_t &nComponents,
71 const DT &missingValue)
const {
76#ifdef TTK_ENABLE_OPENMP
77#pragma omp parallel for num_threads(this->threadNumber_)
79 for(
size_t i = 0; i < nTuples; i++) {
80 const unsigned int &cellId = primitiveIds[i];
82 outputArray[i] = missingValue;
86 const size_t cellIndex = cellId * 3;
87 const IT &v0 = connectivityList[cellIndex + 0];
88 const IT &v1 = connectivityList[cellIndex + 1];
89 const IT &v2 = connectivityList[cellIndex + 2];
91 const size_t bcIndex = i * 2;
92 const float &u = barycentricCoordinates[bcIndex + 0];
93 const float &v = barycentricCoordinates[bcIndex + 1];
94 const float w = 1 - u - v;
97 = w * inputArray[v0] + u * inputArray[v1] + v * inputArray[v2];
103template <
typename DT>
106 const unsigned int *primitiveIds,
108 const DT *inputArray,
109 const size_t &nTuples,
110 const size_t &nComponents,
111 const DT &missingValue)
const {
113#ifdef TTK_ENABLE_OPENMP
114#pragma omp parallel for num_threads(this->threadNumber_)
116 for(
size_t i = 0; i < nTuples; i++) {
117 size_t outputOffset = i * nComponents;
118 const unsigned int &cellId = primitiveIds[i];
121 for(
size_t j = 0; j < nComponents; j++)
122 outputArray[outputOffset++] = missingValue;
125 size_t inputOffset = cellId * nComponents;
126 for(
size_t j = 0; j < nComponents; j++)
127 outputArray[outputOffset++] = inputArray[inputOffset++];
TTK modules that generates images of a dataset.
static const unsigned int INVALID_ID
int interpolateArray(DT *outputArray, const unsigned int *primitiveIds, const float *barycentricCoordinates, const IT *connectivityList, const DT *inputArray, const size_t &nTuples, const size_t &nComponents=1, const DT &missingValue=std::numeric_limits< DT >::has_quiet_NaN ? std::numeric_limits< DT >::quiet_NaN() :std::numeric_limits< DT >::max()) const
int lookupArray(DT *outputArray, const unsigned int *primitiveIds, const DT *inputArray, const size_t &nTuples, const size_t &nComponents=1, const DT &missingValue=std::numeric_limits< DT >::has_quiet_NaN ? std::numeric_limits< DT >::quiet_NaN() :std::numeric_limits< DT >::max()) const
Minimalist debugging class.