48 #ifndef _MIRA_TRANSFORMERNODE_H_ 49 #define _MIRA_TRANSFORMERNODE_H_ 54 #include <boost/iterator/transform_iterator.hpp> 70 class TransformerBase;
71 class NearestNeighborInterpolator;
97 mID(id), mParent(NULL) {}
104 const std::string&
getID()
const {
return mID; }
107 const std::list<AbstractNodePtr>&
getChildren()
const {
return mChildren; }
113 uint32 getDescendantCount()
const;
118 bool isAncestorOf(
const AbstractNodePtr other)
const;
123 virtual bool isEmpty()
const = 0;
132 template<
typename Transform,
typename Filter>
140 static_assert(
sizeof(Transform)==0,
141 "getTransform() must be implemented in your derived Node class");
161 template <
typename T,
int D,
template <
typename T_,
int D_>
class TTransform>
178 template <
typename StorageTransform>
187 template <
typename T,
int D,
template <
typename T_,
int D_>
class TTransform_>
205 template <
typename Transform>
208 GetTime(
const Time& iT0) : t0(iT0) {}
210 typedef int64 result_type;
211 result_type operator()(
const Stamped<Transform>& p)
const {
212 return (result_type)(p.timestamp-t0).totalMilliseconds();
218 template <
typename Transform>
221 typedef const Transform& result_type;
222 result_type operator()(
const Stamped<Transform>& p)
const {
249 template<
typename Transform,
typename Filter>
254 filter.samplesBefore(),
255 filter.samplesAfter());
257 const Time t0 = its.first->timestamp;
265 typedef boost::transform_iterator<GetTime<Transform>, const_iterator> GetTimeIterator;
266 GetTimeIterator begin1 = GetTimeIterator(its.first ,GetTime<Transform>(t0));
267 GetTimeIterator end1 = GetTimeIterator(its.second,GetTime<Transform>(t0));
269 typedef boost::transform_iterator<GetTransform<Transform>, const_iterator> GetTransformIterator;
270 GetTransformIterator begin2 = GetTransformIterator(its.first ,GetTransform<Transform>());
271 GetTransformIterator end2 = GetTransformIterator(its.second,GetTransform<Transform>());
275 TimeContainer timeContainer(begin1, end1);
276 TransformContainer transformContainer(begin2, end2);
279 return filter.template apply<float, Transform>(timeContainer,
280 transformContainer, (float)(time-t0).totalMilliseconds());
285 template<
typename Transform>
1D nearest neighbor interpolator.
Definition: NearestNeighborInterpolator.h:68
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Time and Duration wrapper class.
Wrapper class for boost::posix_time::ptime for adding more functionality to it.
Definition: Time.h:416
std::pair< const_iterator, const_iterator > getInterval(const Time ×tamp, std::size_t size, std::size_t before, std::size_t after)
Returns two iterators that mark the begin and end of an interval of data.
Definition: StampedDataQueue.h:240
Container::const_iterator const_iterator
some typedefs for STL compliance
Definition: StampedDataQueue.h:95
Mix in for adding a timestamp to data types.
bool empty() const
Returns true, if no element is stored.
Definition: StampedDataQueue.h:146
bool insert(const Stamped< T > &data)
Inserts new data to the queue.
Definition: StampedDataQueue.h:154
const Stamped< T > & getData(const Time ×tamp) const
Returns the data from the queue whose time stamp is closest to the specified timestamp.
Definition: StampedDataQueue.h:199
Wraps an STL conform container around a range of values within another container. ...
Definition: IteratorRangeContainer.h:64