#include <curveFitter.h>
Public Types | |
typedef pvector< DataPoint > | Data |
Public Member Functions | |
CurveFitter () | |
~CurveFitter () | |
void | reset () |
Removes all the data points previously added to the CurveFitter, and initializes it for a new curve. | |
void | add_xyz (float t, const LVecBase3f &xyz) |
Adds a single sample xyz. | |
void | add_hpr (float t, const LVecBase3f &hpr) |
Adds a single sample hpr. | |
void | add_xyz_hpr (float t, const LVecBase3f &xyz, const LVecBase3f &hpr) |
Adds a single sample xyz & hpr simultaneously. | |
int | get_num_samples () const |
Returns the number of sample points that have been added. | |
float | get_sample_t (int n) const |
Returns the parametric value of the nth sample added. | |
LVecBase3f | get_sample_xyz (int n) const |
Returns the point in space of the nth sample added. | |
LVecBase3f | get_sample_hpr (int n) const |
Returns the orientation of the nth sample added. | |
LVecBase3f | get_sample_tangent (int n) const |
Returns the tangent associated with the nth sample added. | |
void | remove_samples (int begin, int end) |
Eliminates all samples from index begin, up to but not including index end, from the database. | |
void | sample (ParametricCurveCollection *curves, int count) |
Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated number of times. | |
void | wrap_hpr () |
Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degrees, which should prevent incorrect HPR wrapping. | |
void | sort_points () |
Sorts all the data points in order by parametric time, in case they were added in an incorrect order. | |
void | desample (float factor) |
Removes sample points in order to reduce the complexity of a sampled curve. | |
void | compute_tangents (float scale) |
Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(), ComputeTangents() must be called to set up the tangents correctly (unless the tangents were defined as the points were added). | |
PointerTo< ParametricCurveCollection > | make_hermite () const |
Converts the current set of data points into a Hermite curve. | |
PointerTo< ParametricCurveCollection > | make_nurbs () const |
Converts the current set of data points into a NURBS curve. | |
void | output (ostream &out) const |
void | write (ostream &out) const |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Public Attributes | |
Data | _data |
bool | _got_xyz |
bool | _got_hpr |
Static Private Attributes | |
TypeHandle | _type_handle |
|
Definition at line 87 of file curveFitter.h. |
|
Definition at line 42 of file curveFitter.cxx. |
|
Definition at line 55 of file curveFitter.cxx. References _data. |
|
Adds a single sample hpr.
Definition at line 99 of file curveFitter.cxx. |
|
Adds a single sample xyz.
Definition at line 82 of file curveFitter.cxx. References _data, _got_hpr, CurveFitter::DataPoint::_hpr, CurveFitter::DataPoint::_t, and t. |
|
Adds a single sample xyz & hpr simultaneously.
Definition at line 116 of file curveFitter.cxx. |
|
Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(), ComputeTangents() must be called to set up the tangents correctly (unless the tangents were defined as the points were added).
Definition at line 368 of file curveFitter.cxx. References _data, HC_SMOOTH, HermiteCurve::insert_cv(), PCT_HPR, PCT_XYZ, PT, ParametricCurve::set_curve_type(), HermiteCurve::set_cv_in(), HermiteCurve::set_cv_out(), HermiteCurve::set_cv_point(), and HermiteCurve::set_cv_type(). |
|
Removes sample points in order to reduce the complexity of a sampled curve. Keeps one out of every factor samples. Also keeps the first and the last samples. Definition at line 331 of file curveFitter.cxx. References _data. |
|
Definition at line 94 of file curveFitter.h. |
|
Returns the number of sample points that have been added.
Definition at line 137 of file curveFitter.cxx. |
|
Returns the orientation of the nth sample added.
Definition at line 178 of file curveFitter.cxx. References ParametricCurveCollection::get_max_t(), nassertv, NULL, and t. |
|
Returns the parametric value of the nth sample added.
Definition at line 150 of file curveFitter.cxx. |
|
Returns the tangent associated with the nth sample added. This is only meaningful if compute_tangents() has already been called. Definition at line 196 of file curveFitter.cxx. References _data, CurveFitter::DataPoint::_hpr, CurveFitter::DataPoint::_t, CurveFitter::DataPoint::_xyz, ParametricCurveCollection::evaluate(), and t. |
|
Returns the point in space of the nth sample added.
Definition at line 164 of file curveFitter.cxx. |
|
Definition at line 97 of file curveFitter.h. References _type_handle. |
|
Converts the current set of data points into a Hermite curve.
Definition at line 446 of file curveFitter.cxx. References ClassicNurbsCurve::get_knot(), and ClassicNurbsCurve::set_knot(). |
|
Converts the current set of data points into a NURBS curve. This gives a smoother curve than produced by MakeHermite(). Definition at line 495 of file curveFitter.cxx. |
|
Definition at line 551 of file curveFitter.cxx. Referenced by operator<<(). |
|
Eliminates all samples from index begin, up to but not including index end, from the database.
Definition at line 212 of file curveFitter.cxx. References _data. |
|
Removes all the data points previously added to the CurveFitter, and initializes it for a new curve.
Definition at line 69 of file curveFitter.cxx. |
|
Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated number of times. The sampling is made evenly in parametric time, and then the timewarps, if any, are applied. Definition at line 236 of file curveFitter.cxx. |
|
Sorts all the data points in order by parametric time, in case they were added in an incorrect order.
Definition at line 312 of file curveFitter.cxx. References _data. |
|
Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degrees, which should prevent incorrect HPR wrapping.
Definition at line 276 of file curveFitter.cxx. |
|
Definition at line 563 of file curveFitter.cxx. |
|
Definition at line 88 of file curveFitter.h. Referenced by add_hpr(), add_xyz(), add_xyz_hpr(), compute_tangents(), desample(), get_sample_t(), get_sample_tangent(), get_sample_xyz(), remove_samples(), reset(), sort_points(), and ~CurveFitter(). |
|
Definition at line 91 of file curveFitter.h. |
|
Definition at line 90 of file curveFitter.h. |
|
Definition at line 32 of file curveFitter.cxx. Referenced by init_type(). |