Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jason Chemin
curves
Commits
5b1a835e
Commit
5b1a835e
authored
Aug 22, 2019
by
JasonChmn
Committed by
Pierre Fernbach
Sep 03, 2019
Browse files
[Serialization] Add serialization of Dim getter for all curves
parent
c61f7bc5
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
include/curves/bezier_curve.h
View file @
5b1a835e
...
...
@@ -440,6 +440,7 @@ namespace curves
if
(
version
)
{
// Do something depending on version ?
}
ar
&
boost
::
serialization
::
make_nvp
(
"dim"
,
dim_
);
ar
&
boost
::
serialization
::
make_nvp
(
"T_min"
,
T_min_
);
ar
&
boost
::
serialization
::
make_nvp
(
"T_max"
,
T_max_
);
ar
&
boost
::
serialization
::
make_nvp
(
"mult_T"
,
mult_T_
);
...
...
include/curves/cubic_hermite_spline.h
View file @
5b1a835e
...
...
@@ -43,7 +43,7 @@ namespace curves
/// \brief Empty constructor. Curve obtained this way can not perform other class functions.
///
cubic_hermite_spline
()
:
T_min_
(
0
),
T_max_
(
0
)
:
dim_
(
0
),
T_min_
(
0
),
T_max_
(
0
)
{}
/// \brief Constructor.
...
...
@@ -66,12 +66,18 @@ namespace curves
{
control_points_
.
push_back
(
*
it
);
}
// Set dimension according to size of points
if
(
control_points_
.
size
()
!=
0
)
{
dim_
=
control_points_
[
0
].
first
.
size
();
}
// Set time
setTime
(
time_control_points
);
}
cubic_hermite_spline
(
const
cubic_hermite_spline
&
other
)
:
control_points_
(
other
.
control_points_
),
time_control_points_
(
other
.
time_control_points_
),
:
dim_
(
other
.
dim_
),
control_points_
(
other
.
control_points_
),
time_control_points_
(
other
.
time_control_points_
),
duration_splines_
(
other
.
duration_splines_
),
T_min_
(
other
.
T_min_
),
T_max_
(
other
.
T_max_
),
size_
(
other
.
size_
),
degree_
(
other
.
degree_
)
{}
...
...
@@ -88,7 +94,7 @@ namespace curves
///
virtual
Point
operator
()(
const
Time
t
)
const
{
check_
if_not_empty
();
check_
conditions
();
if
(
Safe
&!
(
T_min_
<=
t
&&
t
<=
T_max_
))
{
throw
std
::
invalid_argument
(
"can't evaluate cubic hermite spline, out of range"
);
...
...
@@ -110,7 +116,7 @@ namespace curves
///
virtual
Point
derivate
(
const
Time
t
,
const
std
::
size_t
order
)
const
{
check_
if_not_empty
();
check_
conditions
();
return
evalCubicHermiteSpline
(
t
,
order
);
}
...
...
@@ -314,12 +320,16 @@ namespace curves
return
left_id
-
1
;
}
void
check_
if_not_empty
()
const
void
check_
conditions
()
const
{
if
(
control_points_
.
size
()
==
0
)
{
throw
std
::
runtime_error
(
"Error in cubic hermite : there is no control points set / did you use empty constructor ?"
);
}
else
if
(
dim_
==
0
)
{
throw
std
::
runtime_error
(
"Error in cubic hermite : Dimension of points is zero / did you use empty constructor ?"
);
}
}
/// \brief compute duration of each spline.
...
...
@@ -399,6 +409,7 @@ namespace curves
if
(
version
)
{
// Do something depending on version ?
}
ar
&
boost
::
serialization
::
make_nvp
(
"dim"
,
dim_
);
ar
&
boost
::
serialization
::
make_nvp
(
"control_points"
,
control_points_
);
ar
&
boost
::
serialization
::
make_nvp
(
"time_control_points"
,
time_control_points_
);
ar
&
boost
::
serialization
::
make_nvp
(
"duration_splines"
,
duration_splines_
);
...
...
include/curves/piecewise_curve.h
View file @
5b1a835e
...
...
@@ -334,6 +334,7 @@ namespace curves
if
(
version
)
{
// Do something depending on version ?
}
ar
&
boost
::
serialization
::
make_nvp
(
"dim"
,
dim_
);
ar
&
boost
::
serialization
::
make_nvp
(
"curves"
,
curves_
);
ar
&
boost
::
serialization
::
make_nvp
(
"time_curves"
,
time_curves_
);
ar
&
boost
::
serialization
::
make_nvp
(
"size"
,
size_
);
...
...
include/curves/polynomial.h
View file @
5b1a835e
...
...
@@ -257,6 +257,7 @@ namespace curves
if
(
version
)
{
// Do something depending on version ?
}
ar
&
boost
::
serialization
::
make_nvp
(
"dim"
,
dim_
);
ar
&
boost
::
serialization
::
make_nvp
(
"coefficients"
,
coefficients_
);
ar
&
boost
::
serialization
::
make_nvp
(
"dim"
,
dim_
);
ar
&
boost
::
serialization
::
make_nvp
(
"degree"
,
degree_
);
...
...
tests/Main.cpp
View file @
5b1a835e
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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