Merge pull request #6533 from afabri/Barycentric_coordinates-fix_output-GF

Barycentric coordinates: bug fix: Increment output iterator
This commit is contained in:
Laurent Rineau 2022-05-06 14:21:50 +02:00
commit f9a5bc5d71
6 changed files with 12 additions and 0 deletions

View File

@ -217,6 +217,7 @@ private:
CGAL_precondition( A[n-2] != FT(0) && A[n-1] != FT(0) ); CGAL_precondition( A[n-2] != FT(0) && A[n-1] != FT(0) );
*output = (r[0]*A[n-2] - r[n-1]*B[n-1] + r[n-2]*A[n-1]) / (A[n-2] * A[n-1]); *output = (r[0]*A[n-2] - r[n-1]*B[n-1] + r[n-2]*A[n-1]) / (A[n-2] * A[n-1]);
++output;
// Return weights. // Return weights.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);
@ -277,6 +278,7 @@ private:
++output; ++output;
} }
*output = weight[n-1] * inverted_dh_denominator; *output = weight[n-1] * inverted_dh_denominator;
++output;
// Return coordinates. // Return coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);
@ -333,6 +335,7 @@ private:
++output; ++output;
} }
*output = weight[n-1] * inverted_dh_denominator; *output = weight[n-1] * inverted_dh_denominator;
++output;
// Return coordinates. // Return coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);

View File

@ -489,6 +489,7 @@ private:
++output; ++output;
} }
*output = coordinate[0]; *output = coordinate[0];
++output;
// Return computed coordinates. // Return computed coordinates.
if(success) return boost::optional<OutputIterator>(output); if(success) return boost::optional<OutputIterator>(output);

View File

@ -290,6 +290,7 @@ private:
CGAL_precondition( r[n-1] != FT(0) ); CGAL_precondition( r[n-1] != FT(0) );
*output = (t[n-2] + t[n-1]) / r[n-1]; *output = (t[n-2] + t[n-1]) / r[n-1];
++output;
// Return weights. // Return weights.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);
@ -364,6 +365,7 @@ private:
++output; ++output;
} }
*output = weight[n-1] * inverted_mv_denominator; *output = weight[n-1] * inverted_mv_denominator;
++output;
// Return coordinates. // Return coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);
@ -432,6 +434,7 @@ private:
++output; ++output;
} }
*output = weight[n-1] * inverted_mv_denominator; *output = weight[n-1] * inverted_mv_denominator;
++output;
// Return coordinates. // Return coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);

View File

@ -211,6 +211,7 @@ private:
CGAL_precondition( A[n-2] != FT(0) && A[n-1] != FT(0) ); CGAL_precondition( A[n-2] != FT(0) && A[n-1] != FT(0) );
*output = C[n-1] / (A[n-2] * A[n-1]); *output = C[n-1] / (A[n-2] * A[n-1]);
++output;
// Return weights. // Return weights.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);
@ -261,6 +262,7 @@ private:
++output; ++output;
} }
*output = weight[n-1] * inverted_wp_denominator; *output = weight[n-1] * inverted_wp_denominator;
++output;
// Return coordinates. // Return coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);
@ -314,6 +316,7 @@ private:
++output; ++output;
} }
*output = weight[n-1] * inverted_wp_denominator; *output = weight[n-1] * inverted_wp_denominator;
++output;
// Return coordinates. // Return coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);

View File

@ -337,6 +337,7 @@ namespace Barycentric_coordinates {
*output = b_first; *output = b_first;
++output; ++output;
*output = FT(1) - b_first; *output = FT(1) - b_first;
++output;
// Output both coordinates. // Output both coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);

View File

@ -368,6 +368,7 @@ namespace Barycentric_coordinates {
// Compute the last = third coordinate, using the partition of unity property. // Compute the last = third coordinate, using the partition of unity property.
*output = FT(1) - b_first - b_second; *output = FT(1) - b_first - b_second;
++output;
// Output all coordinates. // Output all coordinates.
return boost::optional<OutputIterator>(output); return boost::optional<OutputIterator>(output);