GEOS: SineStarFactory.h Source File

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

- File List

# SineStarFactory.h

    00001 /**********************************************************************
    00002  *
    00003  * GEOS - Geometry Engine Open Source
    00004  * http://geos.refractions.net
    00005  *
    00006  * Copyright (C) 2011 Sandro Santilli <strk@keybit.net
    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: geom/util/SineStarFactory.java r378 (JTS-1.12)
    00016  *
    00017  **********************************************************************/
    00018
    00019 #ifndef GEOS_UTIL_SINESTARFACTORY_H
    00020 #define GEOS_UTIL_SINESTARFACTORY_H
    00021
    00022 #include <geos/export.h>
    00023
    00024 #include <geos/util/GeometricShapeFactory.h> // for inheritance
    00025
    00026 #include <memory>
    00027
    00028 #ifdef _MSC_VER
    00029 #pragma warning(push)
    00030 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
    00031 #endif
    00032
    00033 // Forward declarations
    00034 namespace geos {
    00035         namespace geom {
    00036                 class Coordinate;
    00037                 class Envelope;
    00038                 class Polygon;
    00039                 class GeometryFactory;
    00040                 class PrecisionModel;
    00041                 class LineString;
    00042         }
    00043 }
    00044
    00045 namespace geos {
    00046 namespace geom { // geos::geom
    00047 namespace util { // geos::geom::util
    00048
    00058 class GEOS_DLL SineStarFactory : public geos::util::GeometricShapeFactory  {
    00059
    00060 protected:
    00061
    00062   int numArms;
    00063   double armLengthRatio;
    00064
    00065 public:
    00066
    00075         SineStarFactory(const geom::GeometryFactory* fact)
    00076     :
    00077     geos::util::GeometricShapeFactory(fact),
    00078     numArms(8),
    00079     armLengthRatio(0.5)
    00080   {}
    00081
    00087   void setNumArms(int nArms)
    00088   {
    00089     numArms = nArms;
    00090   }
    00091
    00099   void setArmLengthRatio(double armLenRatio)
    00100   {
    00101         armLengthRatio = armLenRatio;
    00102   }
    00103
    00109   std::auto_ptr<Polygon> createSineStar() const;
    00110
    00111
    00112 };
    00113
    00114 } // namespace geos::geom::util
    00115 } // namespace geos::geom
    00116 } // namespace geos
    00117
    00118 #ifdef _MSC_VER
    00119 #pragma warning(pop)
    00120 #endif
    00121
    00122 #endif // GEOS_UTIL_SINESTARFACTORY_H