/usr/include/geos/algorithm/MinimumDiameter.h is in libgeos-dev 3.2.2-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | /**********************************************************************
* $Id: MinimumDiameter.h 2556 2009-06-06 22:22:28Z strk $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#ifndef GEOS_ALGORITHM_MINIMUMDIAMETER_H
#define GEOS_ALGORITHM_MINIMUMDIAMETER_H
#include <geos/export.h>
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
class LineSegment;
class LineString;
class Coordinate;
class CoordinateSequence;
}
}
namespace geos {
namespace algorithm { // geos::algorithm
/** \brief
* Computes the minimum diameter of a geom::Geometry
*
* The minimum diameter is defined to be the
* width of the smallest band that
* contains the geometry,
* where a band is a strip of the plane defined
* by two parallel lines.
* This can be thought of as the smallest hole that the geometry can be
* moved through, with a single rotation.
* <p>
* The first step in the algorithm is computing the convex hull of the Geometry.
* If the input Geometry is known to be convex, a hint can be supplied to
* avoid this computation.
*
* @see ConvexHull
*
*/
class GEOS_DLL MinimumDiameter {
private:
const geom::Geometry* inputGeom;
bool isConvex;
geom::LineSegment* minBaseSeg;
geom::Coordinate* minWidthPt;
int minPtIndex;
double minWidth;
void computeMinimumDiameter();
void computeWidthConvex(const geom::Geometry* geom);
/**
* Compute the width information for a ring of {@link geom::Coordinate}s.
* Leaves the width information in the instance variables.
*
* @param pts
* @return
*/
void computeConvexRingMinDiameter(const geom::CoordinateSequence *pts);
unsigned int findMaxPerpDistance(const geom::CoordinateSequence* pts,
geom::LineSegment* seg, unsigned int startIndex);
static unsigned int getNextIndex(const geom::CoordinateSequence* pts,
unsigned int index);
public:
~MinimumDiameter();
/** \brief
* Compute a minimum diameter for a giver {@link Geometry}.
*
* @param geom a Geometry
*/
MinimumDiameter(const geom::Geometry* newInputGeom);
/** \brief
* Compute a minimum diameter for a given Geometry,
* with a hint if the Geometry is convex
* (e.g. a convex Polygon or LinearRing,
* or a two-point LineString, or a Point).
*
* @param geom a Geometry which is convex
* @param isConvex <code>true</code> if the input geometry is convex
*/
MinimumDiameter(const geom::Geometry* newInputGeom,
const bool newIsConvex);
/** \brief
* Gets the length of the minimum diameter of the input Geometry
*
* @return the length of the minimum diameter
*/
double getLength();
/** \brief
* Gets the {@link geom::Coordinate} forming one end of the minimum diameter
*
* @return a coordinate forming one end of the minimum diameter
*/
geom::Coordinate* getWidthCoordinate();
/** \brief
* Gets the segment forming the base of the minimum diameter
*
* @return the segment forming the base of the minimum diameter
*/
geom::LineString* getSupportingSegment();
/** \brief
* Gets a LineString which is a minimum diameter
*
* @return a LineString which is a minimum diameter
*/
geom::LineString* getDiameter();
};
} // namespace geos::algorithm
} // namespace geos
#endif // GEOS_ALGORITHM_MINIMUMDIAMETER_H
/**********************************************************************
* $Log$
* Revision 1.1 2006/03/09 16:46:48 strk
* geos::geom namespace definition, first pass at headers split
*
**********************************************************************/
|