GEOS: FastNodingValidator.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# FastNodingValidator.h

    00001 /**********************************************************************
    00002  * $Id: FastNodingValidator.h 2778 2009-12-03 19:44:00Z mloskot $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 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  * Last port: noding/FastNodingValidator.java rev. ??? (JTS-1.8)
    00017  *
    00018  **********************************************************************/
    00019
    00020 #ifndef GEOS_NODING_FASTNODINGVALIDATOR_H
    00021 #define GEOS_NODING_FASTNODINGVALIDATOR_H
    00022
    00023 #include <geos/noding/SingleInteriorIntersectionFinder.h> // for composition
    00024 #include <geos/algorithm/LineIntersector.h> // for composition
    00025
    00026 #include <memory>
    00027 #include <string>
    00028 #include <cassert>
    00029
    00030 // Forward declarations
    00031 namespace geos {
    00032         namespace noding {
    00033                 class SegmentString;
    00034         }
    00035 }
    00036
    00037 namespace geos {
    00038 namespace noding { // geos.noding
    00039
    00054 class FastNodingValidator
    00055 {
    00056
    00057 public:
    00058
    00059         FastNodingValidator(std::vector<noding::SegmentString*>& newSegStrings)
    00060                 :
    00061                 li(), // robust...
    00062                 segStrings(newSegStrings),
    00063                 segInt(),
    00064                 isValidVar(true)
    00065         {
    00066         }
    00067
    00074         bool isValid()
    00075         {
    00076                 execute();
    00077                 return isValidVar;
    00078         }
    00079
    00086         std::string getErrorMessage() const;
    00087
    00094         void checkValid();
    00095
    00096 private:
    00097
    00098         geos::algorithm::LineIntersector li;
    00099
    00100         std::vector<noding::SegmentString*>& segStrings;
    00101
    00102         std::auto_ptr<SingleInteriorIntersectionFinder> segInt;
    00103
    00104         bool isValidVar;
    00105
    00106         void execute()
    00107         {
    00108                 if (segInt.get() != NULL) return;
    00109                 checkInteriorIntersections();
    00110         }
    00111
    00112         void checkInteriorIntersections();
    00113
    00114     // Declare type as noncopyable
    00115     FastNodingValidator(const FastNodingValidator& other);
    00116     FastNodingValidator& operator=(const FastNodingValidator& rhs);
    00117 };
    00118
    00119 } // namespace geos.noding
    00120 } // namespace geos
    00121
    00122 #endif // GEOS_NODING_FASTNODINGVALIDATOR_H
    00123
    00124 /**********************************************************************
    00125  * $Log$
    00126  **********************************************************************/