Skip to content

Commit 3d4a1bb

Browse files
committed
PR feedback - minor changes
Signed-off-by: Nick Avramoussis <[email protected]>
1 parent 3ff9ba3 commit 3d4a1bb

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

openvdb/openvdb/points/PointReplicate.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace points {
3535
/// index. This can be subsequently used to modify
3636
/// the replicated points as a post process.
3737
template <typename PointDataGridT>
38-
inline typename PointDataGridT::Ptr
38+
typename PointDataGridT::Ptr
3939
replicate(const PointDataGridT& source,
4040
const Index multiplier,
4141
const std::vector<std::string>& attributes,
@@ -56,7 +56,7 @@ replicate(const PointDataGridT& source,
5656
/// index. This can be subsequently used to modify
5757
/// the replicated points as a post process.
5858
template <typename PointDataGridT>
59-
inline typename PointDataGridT::Ptr
59+
typename PointDataGridT::Ptr
6060
replicate(const PointDataGridT& source,
6161
const Index multiplier,
6262
const std::string& scaleAttribute = "",
@@ -67,7 +67,7 @@ replicate(const PointDataGridT& source,
6767

6868

6969
template <typename PointDataGridT>
70-
inline typename PointDataGridT::Ptr
70+
typename PointDataGridT::Ptr
7171
replicate(const PointDataGridT& source,
7272
const Index multiplier,
7373
const std::vector<std::string>& attributes,
@@ -279,19 +279,21 @@ replicate(const PointDataGridT& source,
279279
idxHandle.expand(/*fill*/false);
280280
assert(idxHandle.size() == total);
281281

282+
283+
Index offset = 0;
284+
282285
if (useScale) {
283-
Index offset = 0;
284286
for (Index i = 0; i < sourceCount; ++i) {
285287
const Index pointRepCount = getPointsToGenerate(i);
286-
for (Index j = 0; j < pointRepCount; ++j, ++offset) {
287-
idxHandle.set(offset, j);
288+
for (Index j = 0; j < pointRepCount; ++j) {
289+
idxHandle.set(offset++, j);
288290
}
289291
}
290292
}
291293
else {
292-
for (Index i = 0; i < total;) {
293-
for (Index j = 0; j < uniformMultiplier; ++j, ++i) {
294-
idxHandle.set(i, j);
294+
while (offset < total) {
295+
for (Index j = 0; j < uniformMultiplier; ++j) {
296+
idxHandle.set(offset++, j);
295297
}
296298
}
297299
}
@@ -308,7 +310,7 @@ replicate(const PointDataGridT& source,
308310
}
309311

310312
template <typename PointDataGridT>
311-
inline typename PointDataGridT::Ptr
313+
typename PointDataGridT::Ptr
312314
replicate(const PointDataGridT& source,
313315
const Index multiplier,
314316
const std::string& scaleAttribute,

0 commit comments

Comments
 (0)