GEOS  3.6.2
FacetSequenceTreeBuilder.h
00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2016 Daniel Baston
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Public Licence as published
00010  * by the Free Software Foundation.
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************
00014  *
00015  * Last port: operation/distance/FacetSequenceTreeBuilder.java (f6187ee2 JTS-1.14)
00016  *
00017  **********************************************************************/
00018 
00019 #ifndef GEOS_OPERATION_DISTANCE_FACETSEQUENCETREEBUILDER_H
00020 #define GEOS_OPERATION_DISTANCE_FACETSEQUENCETREEBUILDER_H
00021 
00022 #include <geos/index/strtree/STRtree.h>
00023 #include <geos/geom/Geometry.h>
00024 #include <geos/geom/CoordinateSequence.h>
00025 #include <geos/operation/distance/FacetSequence.h>
00026 
00027 using namespace geos::geom;
00028 using namespace geos::index::strtree;
00029 using namespace geos::operation::distance;
00030 
00031 namespace geos {
00032     namespace operation {
00033         namespace distance {
00034             class FacetSequenceTreeBuilder {
00035             private:
00036                 // 6 seems to be a good facet sequence size
00037                 static const int FACET_SEQUENCE_SIZE = 6;
00038 
00039                 // Seems to be better to use a minimum node capacity
00040                 static const int STR_TREE_NODE_CAPACITY = 4;
00041 
00042                 static void addFacetSequences(const CoordinateSequence* pts, std::vector<FacetSequence*> & sections);
00043                 static std::vector<FacetSequence*> * computeFacetSequences(const Geometry* g);
00044 
00045             public:
00046                 static STRtree* build(const Geometry* g);
00047             };
00048         }
00049     }
00050 }
00051 
00052 #endif //GEOS_FACETSEQUENCETREEBUILDER_H