SegmentSetMutualIntersector.h 2.17 KB
Newer Older
xuebingbing's avatar
xuebingbing committed
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
/**********************************************************************
 *
 * GEOS - Geometry Engine Open Source
 * http://geos.osgeo.org
 *
 * Copyright (C) 2006 Refractions Research 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_NODING_SEGMENTSETMUTUALINTERSECTOR_H
#define GEOS_NODING_SEGMENTSETMUTUALINTERSECTOR_H

#include <geos/noding/SegmentString.h>
#include <geos/noding/SegmentIntersector.h>

namespace geos {
namespace noding { // geos::noding

/** \brief
 * An intersector for the red-blue intersection problem.
 *
 * In this class of line arrangement problem,
 * two disjoint sets of linestrings are provided.
 * It is assumed that within
 * each set, no two linestrings intersect except possibly at their endpoints.
 * Implementations can take advantage of this fact to optimize processing.
 *
 * @author Martin Davis
 * @version 1.10
 */
class SegmentSetMutualIntersector {
public:

    SegmentSetMutualIntersector()
        : segInt(nullptr)
    {}

    virtual
    ~SegmentSetMutualIntersector() {}

    /**
     * Sets the SegmentIntersector to use with this intersector.
     * The SegmentIntersector will either rocord or add intersection nodes
     * for the input segment strings.
     *
     * @param si the segment intersector to use
     */
    void
    setSegmentIntersector(SegmentIntersector* si)
    {
        segInt = si;
    }

    /**
     *
     * @param segStrings a collection of [SegmentStrings](@ref SegmentString) to node
     */
    virtual void setBaseSegments(SegmentString::ConstVect* segStrings) = 0;

    /**
     * Computes the intersections for two collections of [SegmentStrings](@ref SegmentString).
     *
     * @param segStrings a collection of [SegmentStrings](@ref SegmentString) to node
     */
    virtual void process(SegmentString::ConstVect* segStrings) = 0;

protected:

    SegmentIntersector* segInt;

};

} // geos::noding
} // geos

#endif // GEOS_NODING_SEGMENTSETMUTUALINTERSECTOR_H