00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_ALGORITHM_CENTROIDLINE_H
00018 #define GEOS_ALGORITHM_CENTROIDLINE_H
00019
00020
00021 #include <geos/geom/Coordinate.h>
00022
00023
00024 namespace geos {
00025 namespace geom {
00026 class Geometry;
00027 class CoordinateSequence;
00028 }
00029 }
00030
00031 namespace geos {
00032 namespace algorithm {
00033
00034 class CentroidLine {
00035 private:
00036
00037 geom::Coordinate centSum;
00038
00039 double totalLength;
00040
00041 public:
00042
00043 CentroidLine()
00044 :
00045 centSum(0.0, 0.0),
00046 totalLength(0.0)
00047 {}
00048
00049 ~CentroidLine() {}
00050
00057 void add(const geom::Geometry *geom);
00058
00064 void add(const geom::CoordinateSequence *pts);
00065
00066 geom::Coordinate* getCentroid() const;
00067
00069 bool getCentroid(geom::Coordinate& ret) const;
00070 };
00071
00072 }
00073 }
00074
00075
00076 #endif // GEOS_ALGORITHM_CENTROIDLINE_H
00077
00078
00079
00080
00081
00082
00083
00084