# CommonBitsOp.h

    00001 /**********************************************************************
    00002  * $Id: CommonBitsOp.h 1820 2006-09-06 16:54:23Z 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/precision/CommonBitsRemover.h> // for auto_ptr composition
    00020
    00021 #include <vector>
    00022 #include <memory>
    00023
    00024 namespace geos {
    00025         namespace geom {
    00026                 class Geometry;
    00027         }
    00028         namespace precision {
    00029                 //class CommonBitsRemover;
    00030         }
    00031 }
    00032
    00033 namespace geos {
    00034 namespace precision { // geos.precision
    00035
    00045 class CommonBitsOp {
    00046
    00047 private:
    00048
    00049         bool returnToOriginalPrecision;
    00050
    00051         std::auto_ptr<CommonBitsRemover> cbr;
    00052
    00061         geom::Geometry* removeCommonBits(const geom::Geometry *geom0);
    00062
    00066         void removeCommonBits(
    00067                         const geom::Geometry* geom0,
    00068                         const geom::Geometry* geom1,
    00069                         std::auto_ptr<geom::Geometry>& rgeom0,
    00070                         std::auto_ptr<geom::Geometry>& rgeom1);
    00071
    00072
    00073 public:
    00074
    00078         CommonBitsOp();
    00079
    00086         CommonBitsOp(bool nReturnToOriginalPrecision);
    00087
    00096         geom::Geometry* intersection(
    00097                         const geom::Geometry *geom0,
    00098                         const geom::Geometry *geom1);
    00099
    00108         geom::Geometry* Union(
    00109                         const geom::Geometry *geom0,
    00110                         const geom::Geometry *geom1);
    00111
    00120         geom::Geometry* difference(
    00121                         const geom::Geometry *geom0,
    00122                         const geom::Geometry *geom1);
    00123
    00132         geom::Geometry* symDifference(
    00133                         const geom::Geometry *geom0,
    00134                         const geom::Geometry *geom1);
    00135
    00143         geom::Geometry* buffer(
    00144                         const geom::Geometry *geom0,
    00145                         double distance);
    00146
    00158         geom::Geometry* computeResultPrecision(
    00159                         geom::Geometry *result);
    00160 };
    00161
    00162
    00163 } // namespace geos.precision
    00164 } // namespace geos
    00165
    00166 #endif // GEOS_PRECISION_COMMONBITSOP_H
    00167
    00168 /**********************************************************************
    00169  * $Log$
    00170  * Revision 1.3  2006/04/13 23:23:52  strk
    00171  * fixed bug in binary ops failing to consistently reduce operands.
    00172  *
    00173  * Revision 1.2  2006/04/06 14:36:52  strk
    00174  * Cleanup in geos::precision namespace (leaks plugged, auto_ptr use, ...)
    00175  *
    00176  * Revision 1.1  2006/03/23 09:17:19  strk
    00177  * precision.h header split, minor optimizations
    00178  *
    00179  **********************************************************************/