Changeset 3340


Ignore:
Timestamp:
May 10, 2011 2:51:31 AM (5 years ago)
Author:
strk
Message:

Revert "Use long double to compute edge distance." (r3334). Simple double in HCoordinate made #350 pass anyway.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/geos/algorithm/LineIntersector.h

    r3334 r3340  
    7575        /// but not safe to use for <b>truncated</b> points.
    7676        ///
    77         static long double computeEdgeDistance(const geom::Coordinate& p, const geom::Coordinate& p0, const geom::Coordinate& p1);
     77        static double computeEdgeDistance(const geom::Coordinate& p, const geom::Coordinate& p0, const geom::Coordinate& p1);
    7878
    7979        static double nonRobustComputeEdgeDistance(const geom::Coordinate& p,const geom::Coordinate& p1,const geom::Coordinate& p2);
     
    242242         * @return the edge distance of the intersection point
    243243         */
    244         long double getEdgeDistance(int geomIndex,int intIndex) const;
     244        double getEdgeDistance(int geomIndex,int intIndex) const;
    245245
    246246private:
  • trunk/include/geos/geomgraph/EdgeIntersection.h

    r3334 r3340  
    5050
    5151        // the edge distance of this point along the containing line segment
    52         long double dist;
     52        double dist;
    5353
    5454        // the index of the containing line segment in the parent edge
     
    5656
    5757        EdgeIntersection(const geom::Coordinate& newCoord,
    58                          int newSegmentIndex, long double newDist)
     58                         int newSegmentIndex, double newDist)
    5959          :
    6060          coord(newCoord),
     
    7575        int getSegmentIndex() const { return segmentIndex; }
    7676
    77         long double getDistance() const { return dist; }
     77        double getDistance() const { return dist; }
    7878
    7979};
  • trunk/include/geos/geomgraph/EdgeIntersectionList.h

    r3334 r3340  
    7878         */
    7979        EdgeIntersection* add(const geom::Coordinate& coord,
    80                 int segmentIndex, long double dist);
     80                int segmentIndex, double dist);
    8181
    8282        iterator begin() { return nodeMap.begin(); }
  • trunk/src/algorithm/LineIntersector.cpp

    r3334 r3340  
    5656
    5757/*public static*/
    58 long double
     58double
    5959LineIntersector::computeEdgeDistance(const Coordinate& p,const Coordinate& p0,const Coordinate& p1)
    6060{
    6161        double dx=fabs(p1.x-p0.x);
    6262        double dy=fabs(p1.y-p0.y);
    63         long double dist=-1.0;  // sentinel value
     63        double dist=-1.0;       // sentinel value
    6464        if (p==p0) {
    6565                dist=0.0;
     
    7070                        dist=dy;
    7171        } else {
    72                 long double pdx=fabsl((long double)p.x - p0.x);
    73                 long double pdy=fabsl((long double)p.y - p0.y);
     72                double pdx=fabs(p.x - p0.x);
     73                double pdy=fabs(p.y - p0.y);
    7474                if (dx > dy)
    7575                        dist = pdx;
     
    180180
    181181/*public*/
    182 long double
     182double
    183183LineIntersector::getEdgeDistance(int segmentIndex,int intIndex) const
    184184{
    185         long double dist=computeEdgeDistance(intPt[intIndex],
     185        double dist=computeEdgeDistance(intPt[intIndex],
    186186                *inputLines[segmentIndex][0],
    187187                *inputLines[segmentIndex][1]);
  • trunk/src/geomgraph/Edge.cpp

    r3334 r3340  
    163163        const Coordinate& intPt=li->getIntersection(intIndex);
    164164        unsigned int normalizedSegmentIndex=segmentIndex;
    165         long double dist = li->getEdgeDistance(geomIndex, intIndex);
     165        double dist=li->getEdgeDistance(geomIndex,intIndex);
    166166
    167167        // normalize the intersection point location
  • trunk/src/geomgraph/EdgeIntersectionList.cpp

    r3334 r3340  
    6464EdgeIntersection*
    6565EdgeIntersectionList::add(const Coordinate& coord,
    66         int segmentIndex, long double dist)
     66        int segmentIndex, double dist)
    6767{
    6868        EdgeIntersection *eiNew=new EdgeIntersection(coord, segmentIndex, dist);
Note: See TracChangeset for help on using the changeset viewer.