comparison include/Motion.hpp @ 654:045d05cef9d0

updating to c++11 capabilities
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 07 May 2015 16:09:47 +0200
parents b6ad86ee7033
children 17e54690af8a 8ac7f61c6e4f
comparison
equal deleted inserted replaced
653:107f1ad02b69 654:045d05cef9d0
1 #ifndef MOTION_HPP 1 #ifndef MOTION_HPP
2 #define MOTION_HPP 2 #define MOTION_HPP
3 3
4 #include "src/Trajectory.h" 4 #include "src/Trajectory.h"
5 #include <boost/shared_ptr.hpp>
6 #include <boost/graph/adjacency_list.hpp> 5 #include <boost/graph/adjacency_list.hpp>
7 6
8 7
9 template<typename T> class TrajectoryDBAccess; 8 template<typename T> class TrajectoryDBAccess;
10 template<typename T> class TrajectoryDBAccessList;
11 9
12 typedef boost::shared_ptr<TrajectoryPoint2f> TrajectoryPoint2fPtr; 10 typedef std::shared_ptr<TrajectoryPoint2f> TrajectoryPoint2fPtr;
13 11
14 /** Class for feature data 12 /** Class for feature data
15 positions, velocities and other statistics to evaluate their quality 13 positions, velocities and other statistics to evaluate their quality
16 before saving. */ 14 before saving. */
17 class FeatureTrajectory 15 class FeatureTrajectory
21 19
22 FeatureTrajectory(TrajectoryPoint2fPtr& _positions, TrajectoryPoint2fPtr& _velocities); 20 FeatureTrajectory(TrajectoryPoint2fPtr& _positions, TrajectoryPoint2fPtr& _velocities);
23 21
24 /** loads from database 22 /** loads from database
25 can be made generic for different list and blob */ 23 can be made generic for different list and blob */
26 FeatureTrajectory(const int& id, TrajectoryDBAccessList<cv::Point2f>& trajectoryDB, const std::string& positionsTableName, const std::string& velocitiesTableName); 24 FeatureTrajectory(const int& id, TrajectoryDBAccess<cv::Point2f>& trajectoryDB, const std::string& positionsTableName, const std::string& velocitiesTableName);
27 25
28 unsigned int length(void) const { return positions->size();} // cautious if not continuous: max-min+1 26 unsigned int length(void) const { return positions->size();} // cautious if not continuous: max-min+1
29 27
30 unsigned int getId(void) const { return positions->getId();} 28 unsigned int getId(void) const { return positions->getId();}
31 void setId(const unsigned int& id) { positions->setId(id);velocities->setId(id);} 29 void setId(const unsigned int& id) { positions->setId(id);velocities->setId(id);}
74 std::vector<float> displacementDistances; 72 std::vector<float> displacementDistances;
75 73
76 void computeMotionData(const int& frameNum); 74 void computeMotionData(const int& frameNum);
77 }; 75 };
78 76
79 typedef boost::shared_ptr<FeatureTrajectory> FeatureTrajectoryPtr; 77 typedef std::shared_ptr<FeatureTrajectory> FeatureTrajectoryPtr;
80 78
81 // inlined 79 // inlined
82 inline std::ostream& operator<<(std::ostream& out, const FeatureTrajectory& ft) 80 inline std::ostream& operator<<(std::ostream& out, const FeatureTrajectory& ft)
83 { 81 {
84 out << *(ft.positions); 82 out << *(ft.positions);