Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Fernbach
curves
Commits
b30b8293
Commit
b30b8293
authored
May 05, 2020
by
Jason Chemin
Browse files
Edit docstring of piecewise_curve.h
parent
be9ab915
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/curves/piecewise_curve.h
View file @
b30b8293
...
...
@@ -210,10 +210,20 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
isContinuous
;
}
/// \brief Get number of curves in piecewise curve.
/// \return Number of curves in piecewise curve.
std
::
size_t
num_curves
()
const
{
return
curves_
.
size
();
}
/// \brief Get curve corresponding to time t in piecewise curve.
/// Example : A piecewise curve PC made of two curves : c1 for t in [0,1] and c2 for t in ]1,2].
/// PC.curve_at_time(0.5) will return c1.
/// \param t : time to select curve.
/// \return Curve corresponding to time t in piecewise curve.
curve_ptr_t
curve_at_time
(
const
time_t
t
)
const
{
return
curves_
[
find_interval
(
t
)];
}
/// \brief Get curve at specified index in piecewise curve.
/// \param idx : Index of curve to return, from 0 to num_curves-1.
/// \return curve corresonding to index in piecewise curve.
curve_ptr_t
curve_at_index
(
const
std
::
size_t
idx
)
const
{
if
(
Safe
&&
idx
>=
num_curves
())
{
throw
std
::
length_error
(
...
...
@@ -222,6 +232,9 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
curves_
[
idx
];
}
/// \brief Convert all curves in piecewise curve into bezier curves.
/// \return piecewise bezier curve.
///
template
<
typename
Bezier
>
piecewise_curve_t
convert_piecewise_curve_to_bezier
()
{
check_if_not_empty
();
...
...
@@ -237,6 +250,10 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
pc_res
;
}
/// \brief Convert all curves in piecewise curve into cubic hermite curves.
/// Curves need to be of degree inferior or equal to three.
/// \return piecewise cubic hermite curve.
///
template
<
typename
Hermite
>
piecewise_curve_t
convert_piecewise_curve_to_cubic_hermite
()
{
check_if_not_empty
();
...
...
@@ -252,6 +269,9 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
pc_res
;
}
/// \brief Convert all curves in piecewise curve into polynomial curves.
/// \return piecewise polynomial curve.
///
template
<
typename
Polynomial
>
piecewise_curve_t
convert_piecewise_curve_to_polynomial
()
{
check_if_not_empty
();
...
...
@@ -267,6 +287,11 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
pc_res
;
}
/// \brief Convert discrete points into piecewise polynomial curve with C0 continuity.
/// \param points : discrete points to convert.
/// \param time_points : time corresponding to each point in piecewise curve.
/// \return piecewise polynomial curve of C0 continuity.
///
template
<
typename
Polynomial
>
static
piecewise_curve_t
convert_discrete_points_to_polynomial
(
t_point_t
points
,
t_time_t
time_points
)
{
if
(
Safe
&
!
(
points
.
size
()
>
1
))
{
...
...
@@ -290,6 +315,12 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
piecewise_res
;
}
/// \brief Convert discrete points into piecewise polynomial curve with C1 continuity.
/// \param points : discrete points to convert.
/// \param points_derivative : derivative of order 1 corresponding to each point in piecewise curve.
/// \param time_points : time corresponding to each point in piecewise curve.
/// \return piecewise polynomial curve of C1 continuity.
///
template
<
typename
Polynomial
>
static
piecewise_curve_t
convert_discrete_points_to_polynomial
(
t_point_t
points
,
t_point_derivate_t
points_derivative
,
...
...
@@ -321,6 +352,13 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point, Point_deri
return
piecewise_res
;
}
/// \brief Convert discrete points into piecewise polynomial curve with C2 continuity.
/// \param points : discrete points to convert.
/// \param points_derivative : derivative of order 1 corresponding to each point in piecewise curve.
/// \param points_second_derivative : derivative of order 2 corresponding to each point in piecewise curve.
/// \param time_points : time corresponding to each point in piecewise curve.
/// \return piecewise polynomial curve of C2 continuity.
///
template
<
typename
Polynomial
>
static
piecewise_curve_t
convert_discrete_points_to_polynomial
(
t_point_t
points
,
t_point_derivate_t
points_derivative
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment