diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-02 17:24:21 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-02 17:24:21 +0300 |
commit | a1f0f2eacb10d1429611979b1464408e48b800c8 (patch) | |
tree | 0a9f54eb23ca28b43971417a348eeaa10d52ae82 /source/blender/blenkernel/intern | |
parent | 23ffcb242dfe622954f67dab8af6ed72d5ef2917 (diff) |
Cleanup: Move public docs to BKE_spline.hh header
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/curve_eval.cc | 31 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/spline_bezier.cc | 57 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/spline_poly.cc | 3 |
3 files changed, 0 insertions, 91 deletions
diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc index 163f8b02b85..02abb097175 100644 --- a/source/blender/blenkernel/intern/curve_eval.cc +++ b/source/blender/blenkernel/intern/curve_eval.cc @@ -50,12 +50,6 @@ blender::MutableSpan<SplinePtr> CurveEval::splines() return splines_; } -/** - * \return True if the curve contains a spline with the given type. - * - * \note If you are looping over all of the splines in the same scope anyway, - * it's better to avoid calling this function, in case there are many splines. - */ bool CurveEval::has_spline_with_type(const Spline::Type type) const { for (const SplinePtr &spline : this->splines()) { @@ -72,9 +66,6 @@ void CurveEval::resize(const int size) attributes.reallocate(size); } -/** - * \warning Call #reallocate on the spline's attributes after adding all splines. - */ void CurveEval::add_spline(SplinePtr spline) { splines_.append(std::move(spline)); @@ -127,13 +118,6 @@ int CurveEval::total_control_point_size() const return count; } -/** - * Return the start indices for each of the curve spline's control points, if they were part - * of a flattened array. This can be used to facilitate parallelism by avoiding the need to - * accumulate an offset while doing more complex calculations. - * - * \note The result array is one longer than the spline count; the last element is the total size. - */ blender::Array<int> CurveEval::control_point_offsets() const { Array<int> offsets(splines_.size() + 1); @@ -146,9 +130,6 @@ blender::Array<int> CurveEval::control_point_offsets() const return offsets; } -/** - * Exactly like #control_point_offsets, but uses the number of evaluated points instead. - */ blender::Array<int> CurveEval::evaluated_point_offsets() const { Array<int> offsets(splines_.size() + 1); @@ -161,11 +142,6 @@ blender::Array<int> CurveEval::evaluated_point_offsets() const return offsets; } -/** - * Return the accumulated length at the start of every spline in the curve. - * - * \note The result is one longer than the spline count; the last element is the total length. - */ blender::Array<float> CurveEval::accumulated_spline_lengths() const { Array<float> spline_lengths(splines_.size() + 1); @@ -361,13 +337,6 @@ std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve) return curve_eval_from_dna_curve(dna_curve, *BKE_curve_nurbs_get_for_read(&dna_curve)); } -/** - * Check the invariants that curve control point attributes should always uphold, necessary - * because attributes are stored on splines rather than in a flat array on the curve: - * - The same set of attributes exists on every spline. - * - Attributes with the same name have the same type on every spline. - * - Attributes are in the same order on every spline. - */ void CurveEval::assert_valid_point_attributes() const { #ifdef DEBUG diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc index 0cadab998f5..4f854333c8a 100644 --- a/source/blender/blenkernel/intern/spline_bezier.cc +++ b/source/blender/blenkernel/intern/spline_bezier.cc @@ -70,9 +70,6 @@ void BezierSpline::set_resolution(const int value) this->mark_cache_invalid(); } -/** - * \warning Call #reallocate on the spline's attributes after adding all points. - */ void BezierSpline::add_point(const float3 position, const HandleType handle_type_left, const float3 handle_position_left, @@ -203,10 +200,6 @@ static float3 next_position(Span<float3> positions, const bool cyclic, const int return positions[i + 1]; } -/** - * Recalculate all #Auto and #Vector handles with positions automatically - * derived from the neighboring control points. - */ void BezierSpline::ensure_auto_handles() const { if (!auto_handles_dirty_) { @@ -315,10 +308,6 @@ static void set_handle_position(const float3 &position, } } -/** - * Set positions for the right handle of the control point, ensuring that - * aligned handles stay aligned. Has no effect for auto and vector type handles. - */ void BezierSpline::set_handle_position_right(const int index, const blender::float3 &value) { set_handle_position(positions_[index], @@ -329,10 +318,6 @@ void BezierSpline::set_handle_position_right(const int index, const blender::flo handle_positions_left_[index]); } -/** - * Set positions for the left handle of the control point, ensuring that - * aligned handles stay aligned. Has no effect for auto and vector type handles. - */ void BezierSpline::set_handle_position_left(const int index, const blender::float3 &value) { set_handle_position(positions_[index], @@ -349,9 +334,6 @@ bool BezierSpline::point_is_sharp(const int index) const ELEM(handle_types_right_[index], HandleType::Vector, HandleType::Free); } -/** - * \warning This functional assumes that the spline has more than one point. - */ bool BezierSpline::segment_is_vector(const int index) const { /* Two control points are necessary to form a segment, that should be checked by the caller. */ @@ -409,25 +391,6 @@ void BezierSpline::correct_end_tangents() const } } -/** - * De Casteljau Bezier subdivision. - * \param index: The index of the segment's start control point. - * \param next_index: The index of the control point at the end of the segment. Could be 0, - * if the spline is cyclic. - * \param parameter: The factor along the segment, between 0 and 1. Note that this is used - * directly by the calculation, it doesn't correspond to a portion of the evaluated length. - * - * <pre> - * handle_prev handle_next - * x----------------x - * / \ - * / x---O---x \ - * / result \ - * / \ - * O O - * point_prev point_next - * </pre> - */ BezierSpline::InsertResult BezierSpline::calculate_segment_insertion(const int index, const int next_index, const float parameter) @@ -493,15 +456,6 @@ void BezierSpline::evaluate_segment(const int index, } } -/** - * Returns access to a cache of offsets into the evaluated point array for each control point. - * While most control point edges generate the number of edges specified by the resolution, vector - * segments only generate one edge. - * - * \note The length of the result is one greater than the number of points, so that the last item - * is the total number of evaluated points. This is useful to avoid recalculating the size of the - * last segment everywhere. - */ Span<int> BezierSpline::control_point_offsets() const { if (!offset_cache_dirty_) { @@ -568,12 +522,6 @@ static void calculate_mappings_linear_resolution(Span<int> offsets, } } -/** - * Returns non-owning access to an array of values containing the information necessary to - * interpolate values from the original control points to evaluated points. The control point - * index is the integer part of each value, and the factor used for interpolating to the next - * control point is the remaining factional part. - */ Span<float> BezierSpline::evaluated_mappings() const { if (!mapping_cache_dirty_) { @@ -659,11 +607,6 @@ Span<float3> BezierSpline::evaluated_positions() const return positions; } -/** - * Convert the data encoded in #evaulated_mappings into its parts-- the information necessary - * to interpolate data from control points to evaluated points between them. The next control - * point index result will not overflow the size of the control point vectors. - */ BezierSpline::InterpolationData BezierSpline::interpolation_data_from_index_factor( const float index_factor) const { diff --git a/source/blender/blenkernel/intern/spline_poly.cc b/source/blender/blenkernel/intern/spline_poly.cc index d495c977285..b5aca0357be 100644 --- a/source/blender/blenkernel/intern/spline_poly.cc +++ b/source/blender/blenkernel/intern/spline_poly.cc @@ -45,9 +45,6 @@ int PolySpline::size() const return size; } -/** - * \warning Call #reallocate on the spline's attributes after adding all points. - */ void PolySpline::add_point(const float3 position, const float radius, const float tilt) { positions_.append(position); |