HighMap library (C++)
Loading...
Searching...
No Matches
interpolate_curve.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
14#pragma once
16#include <functional>
17
18namespace hmap
19{
40
49{
50public:
61 std::vector<Point> points,
63
73 std::vector<Point> operator()(std::vector<float> t) const;
74
75private:
76 // clang-format off
77std::vector<Point> points_data;
78// interpolate.
80// used.
81std::vector<float> arc_length;
82// between points.
83std::function<Point(float)> interp;
84// interpolation based on `method`.
85 // clang-format on
86
99 void get_segment_interpolation_parameters(float t, size_t &ileft, float &u);
100};
101
102} // namespace hmap
Class for performing curve interpolation on a set of points.
Definition interpolate_curve.hpp:49
std::vector< Point > operator()(std::vector< float > t) const
Performs interpolation over the provided parameter values.
Definition interpolate_curve.cpp:182
A class to represent and manipulate 2D points that can carry a value.
Definition point.hpp:38
Definition algebra.hpp:28
InterpolationMethodCurve
Enumeration for specifying the interpolation method for curves.
Definition interpolate_curve.hpp:33
@ DECASTELJAU
De Casteljau algorithm for Bézier curve computation.
Definition interpolate_curve.hpp:37
@ BSPLINE
B-spline interpolation.
Definition interpolate_curve.hpp:35
@ POINTS_LERP
Linear interpolation between points.
Definition interpolate_curve.hpp:38
@ BEZIER
Bezier curve interpolation.
Definition interpolate_curve.hpp:34
@ CATMULLROM
Catmull-Rom spline interpolation.
Definition interpolate_curve.hpp:36
Defines a class for representing and manipulating 3D points.