GEOS: MinimumDiameter.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# MinimumDiameter.h

    00001 /**********************************************************************
    00002  * $Id: MinimumDiameter.h 2556 2009-06-06 22:22:28Z strk $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2005-2006 Refractions Research Inc.
    00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
    00009  *
    00010  * This is free software; you can redistribute and/or modify it under
    00011  * the terms of the GNU Lesser General Public Licence as published
    00012  * by the Free Software Foundation.
    00013  * See the COPYING file for more information.
    00014  *
    00015  **********************************************************************/
    00016
    00017 #ifndef GEOS_ALGORITHM_MINIMUMDIAMETER_H
    00018 #define GEOS_ALGORITHM_MINIMUMDIAMETER_H
    00019
    00020 #include <geos/export.h>
    00021
    00022 // Forward declarations
    00023 namespace geos {
    00024         namespace geom {
    00025                 class Geometry;
    00026                 class LineSegment;
    00027                 class LineString;
    00028                 class Coordinate;
    00029                 class CoordinateSequence;
    00030         }
    00031 }
    00032
    00033
    00034 namespace geos {
    00035 namespace algorithm { // geos::algorithm
    00036
    00055 class GEOS_DLL MinimumDiameter {
    00056 private:
    00057         const geom::Geometry* inputGeom;
    00058         bool isConvex;
    00059         geom::LineSegment* minBaseSeg;
    00060         geom::Coordinate* minWidthPt;
    00061         int minPtIndex;
    00062         double minWidth;
    00063         void computeMinimumDiameter();
    00064         void computeWidthConvex(const geom::Geometry* geom);
    00065
    00073         void computeConvexRingMinDiameter(const geom::CoordinateSequence *pts);
    00074
    00075         unsigned int findMaxPerpDistance(const geom::CoordinateSequence* pts,
    00076                 geom::LineSegment* seg, unsigned int startIndex);
    00077
    00078         static unsigned int getNextIndex(const geom::CoordinateSequence* pts,
    00079                 unsigned int index);
    00080
    00081 public:
    00082         ~MinimumDiameter();
    00083
    00089         MinimumDiameter(const geom::Geometry* newInputGeom);
    00090
    00100         MinimumDiameter(const geom::Geometry* newInputGeom,
    00101                         const bool newIsConvex);
    00102
    00108         double getLength();
    00109
    00115         geom::Coordinate* getWidthCoordinate();
    00116
    00122         geom::LineString* getSupportingSegment();
    00123
    00129         geom::LineString* getDiameter();
    00130 };
    00131
    00132 } // namespace geos::algorithm
    00133 } // namespace geos
    00134
    00135 #endif // GEOS_ALGORITHM_MINIMUMDIAMETER_H
    00136
    00137 /**********************************************************************
    00138  * $Log$
    00139  * Revision 1.1  2006/03/09 16:46:48  strk
    00140  * geos::geom namespace definition, first pass at headers split
    00141  *
    00142  **********************************************************************/
    00143