GEOS
3.3.9
|
00001 /********************************************************************** 00002 * $Id: CommonBitsOp.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research 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 #ifndef GEOS_PRECISION_COMMONBITSOP_H 00017 #define GEOS_PRECISION_COMMONBITSOP_H 00018 00019 #include <geos/export.h> 00020 #include <geos/precision/CommonBitsRemover.h> // for auto_ptr composition 00021 00022 #include <vector> 00023 #include <memory> 00024 00025 #ifdef _MSC_VER 00026 #pragma warning(push) 00027 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00028 #endif 00029 00030 namespace geos { 00031 namespace geom { 00032 class Geometry; 00033 } 00034 namespace precision { 00035 //class CommonBitsRemover; 00036 } 00037 } 00038 00039 namespace geos { 00040 namespace precision { // geos.precision 00041 00051 class GEOS_DLL CommonBitsOp { 00052 00053 private: 00054 00055 bool returnToOriginalPrecision; 00056 00057 std::auto_ptr<CommonBitsRemover> cbr; 00058 00067 geom::Geometry* removeCommonBits(const geom::Geometry *geom0); 00068 00072 void removeCommonBits( 00073 const geom::Geometry* geom0, 00074 const geom::Geometry* geom1, 00075 std::auto_ptr<geom::Geometry>& rgeom0, 00076 std::auto_ptr<geom::Geometry>& rgeom1); 00077 00078 00079 public: 00080 00084 CommonBitsOp(); 00085 00092 CommonBitsOp(bool nReturnToOriginalPrecision); 00093 00102 geom::Geometry* intersection( 00103 const geom::Geometry *geom0, 00104 const geom::Geometry *geom1); 00105 00114 geom::Geometry* Union( 00115 const geom::Geometry *geom0, 00116 const geom::Geometry *geom1); 00117 00126 geom::Geometry* difference( 00127 const geom::Geometry *geom0, 00128 const geom::Geometry *geom1); 00129 00138 geom::Geometry* symDifference( 00139 const geom::Geometry *geom0, 00140 const geom::Geometry *geom1); 00141 00149 geom::Geometry* buffer( 00150 const geom::Geometry *geom0, 00151 double distance); 00152 00164 geom::Geometry* computeResultPrecision( 00165 geom::Geometry *result); 00166 }; 00167 00168 } // namespace geos.precision 00169 } // namespace geos 00170 00171 #ifdef _MSC_VER 00172 #pragma warning(pop) 00173 #endif 00174 00175 #endif // GEOS_PRECISION_COMMONBITSOP_H 00176 00177 /********************************************************************** 00178 * $Log$ 00179 * Revision 1.3 2006/04/13 23:23:52 strk 00180 * fixed bug in binary ops failing to consistently reduce operands. 00181 * 00182 * Revision 1.2 2006/04/06 14:36:52 strk 00183 * Cleanup in geos::precision namespace (leaks plugged, auto_ptr use, ...) 00184 * 00185 * Revision 1.1 2006/03/23 09:17:19 strk 00186 * precision.h header split, minor optimizations 00187 * 00188 **********************************************************************/