10 #ifndef PPATH_AC_H_UOFARIZONAVISION
11 #define PPATH_AC_H_UOFARIZONAVISION 1
30 mutable std::vector< float > arclen_cache;
33 mutable bool arclen_valid;
39 void refresh_the_cache_if_stale()
const
93 arclen_cache.swap( vpp.arclen_cache );
94 std::swap( arclen_valid, vpp.arclen_valid );
100 arclen_valid =
false;
107 arclen_valid =
false;
114 arclen_valid =
false;
126 arclen_valid =
false;
134 arclen_valid =
false;
141 arclen_valid =
false;
160 refresh_the_cache_if_stale();
161 alvec -> resize(
size() );
162 std::copy( arclen_cache.begin(), arclen_cache.end(), alvec->begin() );
163 return kjb_c::NO_ERROR;
177 refresh_the_cache_if_stale();
178 return arclen_cache.at( index );
float arclength() const
Return the polygonal path length for this path, front() to back()
Definition: ppath_ac.cpp:90
#define ETX(a)
Definition: l_exception.h:67
VecPP::const_iterator const_iterator
constant iterator through PixPath points
Definition: pixpath.h:235
#define KJB(x)
Definition: l_util.h:9
virtual PixPath & append(const_iterator begin, const_iterator end)
Append a range from a given other path to the end of this path.
Definition: pixpath.cpp:152
virtual void push_back(const PixPoint &pp)
Vector-like appending a new PixPoint on the end of the object.
Definition: pixpath.h:329
PixPathAc(const PixPath &path)
ctor copies from a PixPath. This is the only public ctor.
Definition: ppath_ac.h:69
PixPathAc & append(const_iterator begin, const_iterator end)
append range of another path to this
Definition: ppath_ac.h:112
virtual float arclength() const
compute and return polygonal path length of this path
Definition: pixpath.cpp:1637
Representation of a sequence of pixel coordinates.
Definition: pixpath.h:117
size_t size() const
Number of points in the path (not the same as its length).
Definition: pixpath.h:338
const_iterator end() const
Rtn iterator pointing to just beyond the last point in the path.
Definition: pixpath.h:364
virtual int append_no_overlap(const PixPath &suffix)
Like append(), with extra avoid-the-duplicates fuss; overwrites.
Definition: pixpath.cpp:177
int arclength(std::vector< float > *alvec) const
compute polygonal path length along path, ret. vector of results.
Definition: ppath_ac.h:156
PixPathAc()
default ctor almost the same as the PixPath default ctor
Definition: ppath_ac.h:50
PixPathAc(size_t potential_size)
ctor receives the size to reserve
Definition: ppath_ac.h:56
const_iterator begin() const
Return an iterator pointing to the first point in the path.
Definition: pixpath.h:358
size_t whereis_arclength_ratio(float) const
Return index of PixPoint in path at a given arclength ratio.
Definition: ppath_ac.cpp:48
PixPathAc & ow_reverse()
Reverse the order of this path, IN PLACE!
Definition: ppath_ac.h:139
This is like PixPath except that it has an arclength cache, for teh performance.
Definition: ppath_ac.h:24
static PixPathAc reserve(size_t potential_size=0)
named ctor creates an empty path but reserves some memory for it
Definition: ppath_ac.h:75
PixPath suffix(unsigned first) const
Variation on subrange: return a suffix of this path (by value)
Definition: pixpath.h:456
PixPathAc & append(const PixPath &suffix)
tack on a copy of a given path to the end of this path
Definition: ppath_ac.h:124
void swap(kjb::Gsl_Multimin_fdf &m1, kjb::Gsl_Multimin_fdf &m2)
Swap two wrapped multimin objects.
Definition: gsl_multimin.h:693
void clear()
throw away all points
Definition: ppath_ac.h:105
virtual void swap(PixPath &vpp)
Swap the contents of two PixPaths.
Definition: pixpath.h:344
int append_no_overlap(const PixPath &suffix)
see description of PixPath::append_no_overlap()
Definition: ppath_ac.h:132
Representation of an (x,y) pair of pixel coordinates.
Definition: pixpoint.h:57
virtual void clear()
Discard all points.
Definition: pixpath.h:351
void swap(PixPathAc &vpp)
swap representations of two PixPathAc objects
Definition: ppath_ac.h:90
PixPathAc(const std::string &fn)
ctor loads from a file, just like PixPath ctor
Definition: ppath_ac.h:62
float arclength(size_t index) const
Return the polygonal path length from front() to indexed point.
Definition: ppath_ac.h:175
PixPath & ow_reverse()
Reverse the order of the points in the path (overwriting!)
Definition: pixpath.cpp:613
virtual PixPath & assign(unsigned index, const PixPoint &newp)
Change a member of the path to a new PixPoint.
Definition: pixpath.h:299
size_t halfway() const
Return index of PixPoint closest to but not beyond mid-arclength.
Definition: ppath_ac.h:189
PixPathAc & assign(unsigned index, const PixPoint &newp)
assign a location in a PixPathAc
Definition: ppath_ac.h:82
Contains definition for class PixPath.
void push_back(const PixPoint &pp)
add a new point to the end of the path
Definition: ppath_ac.h:98