00001 #include "Point.h" 00002 00003 namespace damina 00004 { 00005 00009 Point::Point() { 00010 } 00011 00012 00017 Point::~Point() { 00018 vector<Feature *>::iterator dataIterator; 00019 00020 /* iterating over the features to destory them */ 00021 for (dataIterator == point.begin(); dataIterator < point.end(); dataIterator++) { 00022 delete *dataIterator; 00023 } 00024 } 00025 00031 void Point::add(Feature *f) { 00032 point.push_back(f); 00033 } 00034 00035 00041 void Point::setLabel(double l) { 00042 label = l; 00043 } 00044 00050 double Point::getLabel() { 00051 return label; 00052 } 00053 00054 00060 Feature *Point::first() { 00061 it = point.begin(); 00062 return *it; 00063 } 00064 00070 Feature *Point::last() { 00071 it = point.end(); 00072 return *it; 00073 } 00074 00080 Feature *Point::next() { 00081 it++; 00082 return *it; 00083 } 00084 00090 Feature *Point::previous() { 00091 it--; 00092 return *it; 00093 } 00094 00095 00101 unsigned long int Point::getSize() { 00102 return this->point.size(); 00103 } 00104 00112 Feature *Point::get(int index) { 00113 return this->point[index]; 00114 } 00115 }
1.5.2