00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, are permitted 00008 provided that the following conditions are met: 00009 00010 *Redistributions of source code must retain the above copyright notice, this list of 00011 conditions and the following disclaimer. 00012 *Redistributions in binary form must reproduce the above copyright notice, this list of 00013 conditions and the following disclaimer in the documentation and/or other materials provided 00014 with the distribution. 00015 *Neither the name of the University of Aveiro nor the names of its contributors may be used to 00016 endorse or promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00021 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00024 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00025 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 ***************************************************************************************************/ 00032 #ifndef _MEASUREMENT_H_ 00033 #define _MEASUREMENT_H_ 00034 00035 #include <boost/shared_ptr.hpp> 00036 #include <fstream> 00037 #include <iostream> 00038 #include <vector> 00039 00040 #include <Eigen/Dense> 00041 00042 #include <mtt/point.h> 00043 #include <mtt/cluster.h> 00044 00045 using namespace std; 00046 00047 using Eigen::Vector2d; 00048 using Eigen::Vector3d; 00049 00050 class Cluster; 00051 00053 typedef boost::shared_ptr<Cluster> ClusterPtr; 00054 00060 class Measurement 00061 { 00062 public: 00063 00065 vector<PointPtr> points; 00067 Point centroid; 00069 long id; 00070 00071 Vector3d state; 00072 00074 vector<ClusterPtr> assigned_clusters; 00075 00076 Measurement(); 00077 00078 ~Measurement(); 00079 00080 Measurement & operator=(const Measurement &rhs); 00081 00089 bool breakPointDetector(PointPtr&pt,PointPtr&pt_m1); 00090 00094 void calculateCentroid(void); 00095 00096 bool operator<(Measurement&); 00097 bool operator>(Measurement&); 00098 00099 // friend ostream& operator<<(ostream& o, Measurement& m); 00100 00101 private: 00102 }; 00103 00105 typedef boost::shared_ptr<Measurement> MeasurementPtr; 00106 00107 ostream& operator<<(ostream& o, Measurement& m); 00108 ostream& operator<<(ostream& o,vector<MeasurementPtr>& m); 00109 00118 bool compareMeasurements(MeasurementPtr m1,MeasurementPtr m2); 00119 00120 #endif