00001 #ifndef WEIGHTED_POINTS_H
00002 #define WEIGHTED_POINTS_H
00003
00030 #include <Geometry.H>
00031
00032
00033 template <class T, class V, int Size> class FixedNdWeightedPoint;
00034 template <class T, class V, int Size> class FixedNdWeightedVector;
00035
00036 template <class T, class V, int Size> class FixedNdWeightedPoint : public FixedNdPoint <T,Size>{
00037
00038 public:
00039 FixedNdWeightedPoint() : FixedNdPoint<T,Size>(){};
00040 FixedNdWeightedPoint(const T & value) : FixedNdPoint<T,Size>(){ weightValue=value; };
00041
00042 bool &operator==(const FixedNdPoint <T,Size> &point) const {
00043 if(weightValue==point.weightValue){
00044 return this->FixedNdPoint<T,Size>::operator==(point);
00045 }
00046 return false;
00047 }
00048
00049 const V & value() const { return weightValue; };
00050 void value(const V & value){weightValue=value;};
00051
00052 protected:
00053 V weightValue;
00054
00055 };
00056
00057
00058 template <class T, class V, int Size> class FixedNdWeightedVector : public FixedNdVector <T,Size>{
00059
00060 public:
00061 FixedNdWeightedVector() : FixedNdVector<T,Size>(){};
00062 FixedNdWeightedVector(const T & value) : FixedNdVector<T,Size>(){ weightValue=value; };
00063
00064 bool &operator==(const FixedNdVector <T,Size> &point) const {
00065 if(weightValue==point.weightValue){
00066 return this->FixedNdVector<T,Size>::operator==(point);
00067 }
00068 return false;
00069 }
00070
00071 const V & value() const { return weightValue; };
00072 void value(const V & value) {weightValue=value;};
00073
00074 protected:
00075 V weightValue;
00076
00077 };
00078
00079
00080
00081 #endif