1 #ifndef BASICTOOL_GEOTRAJECTORY_CXX 2 #define BASICTOOL_GEOTRAJECTORY_CXX 14 this->reserve(obj.size());
20 this->reserve(obj.size());
21 for(
auto const& p : obj) this->
push_back(p);
26 if(end_step == 0) end_step = size() - 1;
29 if(start_step >= end_step)
throw GeoAlgoException(
"Cannot have start step >= end step!");
31 if(end_step >= size())
throw GeoAlgoException(
"Requested step index bigger than size!");
34 if(size()<2)
return 0;
37 for(
size_t i=start_step; i<end_step; ++i)
39 length += (*
this)[i]._Dist_((*
this)[i+1]);
46 if(size()<2)
return false;
49 for(
size_t i=0; i<size()-1; ++i) {
51 length += (*this)[i]._Dist_((*
this)[i+1]);
53 if(length > ref)
return true;
61 if (!(size() && obj == (*rbegin())))
62 std::vector<geoalgo::Point_t>::push_back(obj);
68 if( (*(this->
begin())).size() != obj.size() ) {
70 std::ostringstream msg;
71 msg <<
"<<" << __FUNCTION__ <<
">>" 73 << (*(this->
begin())).size() <<
" != " << obj.size() << std::endl;
80 if(!size() || !(obj.size()))
return;
82 if( (*(this->
begin())).size() != (*obj.begin()).size() ) {
84 std::ostringstream msg;
85 msg <<
"<<" << __FUNCTION__ <<
">>" 87 << (*(this->
begin())).size() <<
" != " << (*obj.begin()).size() << std::endl;
96 std::ostringstream msg;
97 msg <<
"<<" << __FUNCTION__ <<
">>" 98 <<
" length=" << size() <<
" is too short to find a direction @ index=" << i << std::endl;
106 return ((*
this)[i+1] - (*
this)[i]);
void compat(const Point_t &obj) const
Dimensionality check function w/ Trajectory.
Trajectory(size_t npoints=0, size_t ndimension=0)
Default ctor to specify # points and dimension of each point.
void push_back(const Point_t &obj)
push_back overrie w/ dimensionality check
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
double Length(size_t start_step=0, size_t end_step=0) const
The summed-length along all trajectory points.
Vector Dir(size_t i=0) const
The direction at a specified trajectory point.
bool IsLonger(double) const
Check if the trajectory is longer than specified value.
Class def header for a class Trajectory.
Vector _Dir_(size_t i) const
Returns a direction vector at a specified trajectory point w/o size check.