pktools  2.6.7
Processing Kernel for geospatial data
PosValue.h
1 /**********************************************************************
2 PosValue.h: class to work with structs containing a position and a value
3 Copyright (C) 2008-2012 Pieter Kempeneers
4 
5 This file is part of pktools
6 
7 pktools is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 pktools is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with pktools. If not, see <http://www.gnu.org/licenses/>.
19 ***********************************************************************/
20 #ifndef _POSVALUE_H_
21 #define _POSVALUE_H_
22 
23 struct PosValue{
24  double posx;
25  double posy;
26  double value;
27 };
29 public:
30  int operator() (const PosValue& pv1, const PosValue& pv2) const{
31  return pv1.value>pv2.value;//for decreasing order
32  }
33 };
35 public:
36  int operator() (const PosValue& pv1, const PosValue& pv2) const{
37  return pv1.value>pv2.value;//for decreasing order
38  }
39 };
41 public:
42  int operator() (const PosValue& pv1, const PosValue& pv2) const{
43  return pv1.value<pv2.value;//for increasing order
44  }
45 };
46 #endif /* _POSVALUE_H_ */