GEOS 3.2.2
MonotoneChainBuilder.h
00001 /**********************************************************************
00002  * $Id: MonotoneChainBuilder.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) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: index/chain/MonotoneChainBuilder.java rev 1.12 (JTS-1.10)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
00021 #define GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
00022 
00023 #include <geos/export.h>
00024 #include <vector>
00025 #include <cstddef>
00026 
00027 // Forward declarations
00028 namespace geos {
00029         namespace geom {
00030                 class CoordinateSequence;
00031         }
00032         namespace index { 
00033                 namespace chain { 
00034                         class MonotoneChain;
00035                 }
00036         }
00037 }
00038 
00039 namespace geos {
00040 namespace index { // geos::index
00041 namespace chain { // geos::index::chain
00042 
00043 using namespace std;
00044 
00051 class GEOS_DLL MonotoneChainBuilder {
00052 
00053 public:
00054 
00055         MonotoneChainBuilder(){}
00056 
00062         static std::vector<MonotoneChain*>* getChains(
00063                         const geom::CoordinateSequence *pts,
00064                         void* context);
00065 
00071         static void getChains(const geom::CoordinateSequence *pts,
00072                         void* context,
00073                         std::vector<MonotoneChain*>& mcList);
00074 
00075         static std::vector<MonotoneChain*>* getChains(const geom::CoordinateSequence *pts)
00076         {
00077                 return getChains(pts, NULL);
00078         }
00079 
00087         static void getChainStartIndices(const geom::CoordinateSequence& pts,
00088                         std::vector<std::size_t>& startIndexList);
00089 
00090 private:
00091 
00103         static size_t findChainEnd(const geom::CoordinateSequence& pts,
00104                                                            size_t start);
00105 };
00106 
00107 } // namespace geos::index::chain
00108 } // namespace geos::index
00109 } // namespace geos
00110 
00111 #endif // GEOS_IDX_CHAIN_MONOTONECHAINBUILDER_H
00112 
00113 /**********************************************************************
00114  * $Log$
00115  * Revision 1.1  2006/03/22 18:12:31  strk
00116  * indexChain.h header split.
00117  *
00118  **********************************************************************/
00119