The Polyline class provides a simple polyline representation of a BSpline for fast point to spline distance approximations.
More...
#include <ATBPolyline.hh>
|
| Polyline () |
| Default constructor. More...
|
|
| Polyline (Polyline< Dim > const &polyline) |
| Copy constructor. More...
|
|
| ~Polyline () |
| Destructor. More...
|
|
double | curveIntegral (double uStart=0.0, double uEnd=1.0) const |
| Compute the curve integral along the poly line. More...
|
|
double | distance (PointT const &point, double &uOpt) const |
| Project the given point onto the polyline and get the distance to the polyline and the projected position along the curve parameterization. More...
|
|
void | fitToSpline (BSpline< PointT > const &spline, double eps=1e-4) |
| Make this polyline optimally fit the given BSpline. More...
|
|
void | load (std::string const &fileName, std::string const &groupName, bool throwExceptions=false) |
| Load the polyline with corresponding meta-data from an hdf5 file with given name, using the groupName provided. More...
|
|
void | load (BlitzH5File const &inFile, std::string const &groupName) |
| Load the polyline with corresponding meta-data from an hdf5 file with given name, using the groupName provided. More...
|
|
PointT | operator() (double u) const |
| Get the polyline position at curve length u. More...
|
|
Polyline< Dim > & | operator= (Polyline< Dim > const &polyline) |
| Copy assignment operator. More...
|
|
void | save (std::string const &fileName, std::string const &groupName, bool throwExceptions=false) const |
| Save the polyline with corresponding meta-data to an hdf5 file with given name, using the groupName provided. More...
|
|
void | save (BlitzH5File &outFile, std::string const &groupName) const |
| Save the polyline with corresponding meta-data to an hdf5 file with given name, using the groupName provided. More...
|
|
template<int Dim>
class atb::Polyline< Dim >
The Polyline class provides a simple polyline representation of a BSpline for fast point to spline distance approximations.
Definition at line 53 of file ATBPolyline.hh.
◆ PointT
◆ PointIteratorT
◆ PointConstIteratorT
◆ Polyline() [1/2]
Default constructor.
This constructor generates an empty polyline.
◆ Polyline() [2/2]
Copy constructor.
- Parameters
-
◆ ~Polyline()
◆ operator=()
Copy assignment operator.
- Parameters
-
polyline | Change the nodes of this polyline to the nodes of the polyline given. |
- Returns
- A reference to this updated polyline for operator chaining
◆ operator()()
Get the polyline position at curve length u.
- Parameters
-
u | The position along the curve parameterization to evaluate the polyline at |
- Returns
- The polyline point at the given curve parameter
◆ distance()
Project the given point onto the polyline and get the distance to the polyline and the projected position along the curve parameterization.
- Parameters
-
point | The point to project onto the polyline |
uOpt | The projected position along the curve parameterization |
- Returns
- The point-to-polyline distance
◆ curveIntegral()
template<int Dim>
double atb::Polyline< Dim >::curveIntegral |
( |
double |
uStart = 0.0 , |
|
|
double |
uEnd = 1.0 |
|
) |
| const |
Compute the curve integral along the poly line.
You can give the lower and upper bounds of the length computation, if you only want to measure the length of a part of the polyline.
- Parameters
-
uStart | The lower bound curve parameter |
uEnd | The upper bound curve parameter |
- Returns
- The length of the polyline from uStart to uEnd
◆ fitToSpline()
Make this polyline optimally fit the given BSpline.
The Polyline is initialized with the spline's knot positions and iteratively subdivided along the segment with greatest error of fit until the tolerance is reached.
- Parameters
-
spline | The spline to fit this polyline to |
eps | The tolerance below which the fit is not further refined |
◆ save() [1/2]
template<int Dim>
void atb::Polyline< Dim >::save |
( |
std::string const & |
fileName, |
|
|
std::string const & |
groupName, |
|
|
bool |
throwExceptions = false |
|
) |
| const |
Save the polyline with corresponding meta-data to an hdf5 file with given name, using the groupName provided.
- Parameters
-
fileName | The HDF5 file name. If a file of that name already exists, the polyline structures will be added, otherwise a new file will be created |
groupName | The HDF5 group to write the polyline data to |
throwExceptions | If this flag is given the method throws exceptions if something goes wrong, otherwise it will report a warning via standard out and return to the caller |
- Exceptions
-
BlitzH5Error | If the throwExceptions flag is set this error is thrown |
◆ load() [1/2]
template<int Dim>
void atb::Polyline< Dim >::load |
( |
std::string const & |
fileName, |
|
|
std::string const & |
groupName, |
|
|
bool |
throwExceptions = false |
|
) |
| |
Load the polyline with corresponding meta-data from an hdf5 file with given name, using the groupName provided.
- Parameters
-
fileName | The HDF5 file name. |
groupName | The HDF5 group to read the polyline data from |
throwExceptions | If this flag is given the method throws exceptions if something goes wrong, otherwise it will report a warning via standard out and return to the caller |
- Exceptions
-
BlitzH5Error | If the throwExceptions flag is set this error is thrown |
◆ save() [2/2]
Save the polyline with corresponding meta-data to an hdf5 file with given name, using the groupName provided.
- Parameters
-
outFile | The HDF5 file object the polyline structures will be written to. |
groupName | The HDF5 group to write the polyline data to |
- Exceptions
-
◆ load() [2/2]
Load the polyline with corresponding meta-data from an hdf5 file with given name, using the groupName provided.
- Parameters
-
inFile | The HDF5 file object. |
groupName | The HDF5 group to read the polyline data from |
- Exceptions
-
◆ operator<<
template<int Dim>
template<int Dim1>
std::ostream& operator<< |
( |
std::ostream & |
, |
|
|
Polyline< Dim1 > const & |
|
|
) |
| |
|
friend |
The documentation for this class was generated from the following file: