[geos-commits] r2695 - in trunk/source: headers/geos/linearref
linearref
svn_geos at osgeo.org
svn_geos at osgeo.org
Fri Oct 23 05:53:30 EDT 2009
Author: strk
Date: 2009-10-23 05:53:30 -0400 (Fri, 23 Oct 2009)
New Revision: 2695
Modified:
trunk/source/headers/geos/linearref/LinearGeometryBuilder.h
trunk/source/linearref/LinearGeometryBuilder.cpp
Log:
Cleanup LinearGeometrybuilder defs and impl to match common code style, add note about suspicious things (not written but noted that the class seems to lack a destructor..)
Modified: trunk/source/headers/geos/linearref/LinearGeometryBuilder.h
===================================================================
--- trunk/source/headers/geos/linearref/LinearGeometryBuilder.h 2009-10-23 09:43:52 UTC (rev 2694)
+++ trunk/source/headers/geos/linearref/LinearGeometryBuilder.h 2009-10-23 09:53:30 UTC (rev 2695)
@@ -59,7 +59,8 @@
* Allows invalid lines to be ignored rather than causing Exceptions.
* An invalid line is one which has only one unique point.
*
- * @param ignoreShortLines <code>true</code> if short lines are to be ignored
+ * @param ignoreShortLines <code>true</code> if short lines are
+ * to be ignored
*/
void setIgnoreInvalidLines(bool ignoreInvalidLines);
@@ -67,9 +68,11 @@
* Allows invalid lines to be ignored rather than causing Exceptions.
* An invalid line is one which has only one unique point.
*
- * @param ignoreShortLines <code>true</code> if short lines are to be ignored
+ * @param ignoreShortLines <code>true</code> if short lines are
+ * to be ignored
*/
void setFixInvalidLines(bool fixInvalidLines);
+
/**
* Adds a point to the current line.
*
@@ -84,15 +87,16 @@
*/
void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
+ /// NOTE strk: why return by value ?
geom::Coordinate getLastCoordinate() const;
- /**
- * Terminate the current LineString.
- */
+ /// Terminate the current LineString.
void endLine();
geom::Geometry *getGeometry();
};
-}
-}
+
+} // namespace geos.linearref
+} // namespace geos
+
#endif
Modified: trunk/source/linearref/LinearGeometryBuilder.cpp
===================================================================
--- trunk/source/linearref/LinearGeometryBuilder.cpp 2009-10-23 09:43:52 UTC (rev 2694)
+++ trunk/source/linearref/LinearGeometryBuilder.cpp 2009-10-23 09:53:30 UTC (rev 2695)
@@ -35,47 +35,41 @@
namespace geos
{
+
namespace linearref // geos.linearref
{
+/* public */
LinearGeometryBuilder::LinearGeometryBuilder(const GeometryFactory* geomFact) :
geomFact(geomFact),
ignoreInvalidLines(false),
fixInvalidLines(false),
coordList(0) {}
-void LinearGeometryBuilder::setIgnoreInvalidLines(bool ignoreInvalidLines)
+/* public */
+void
+LinearGeometryBuilder::setIgnoreInvalidLines(bool ignoreInvalidLines)
{
this->ignoreInvalidLines = ignoreInvalidLines;
}
-/**
- * Allows invalid lines to be ignored rather than causing Exceptions.
- * An invalid line is one which has only one unique point.
- *
- * @param ignoreShortLines <code>true</code> if short lines are to be ignored
- */
-void LinearGeometryBuilder::setFixInvalidLines(bool fixInvalidLines)
+/* public */
+void
+LinearGeometryBuilder::setFixInvalidLines(bool fixInvalidLines)
{
this->fixInvalidLines = fixInvalidLines;
}
-/**
- * Adds a point to the current line.
- *
- * @param pt the Coordinate to add
- */
-void LinearGeometryBuilder::add(const Coordinate& pt)
+/* public */
+void
+LinearGeometryBuilder::add(const Coordinate& pt)
{
add(pt, true);
}
-/**
- * Adds a point to the current line.
- *
- * @param pt the Coordinate to add
- */
-void LinearGeometryBuilder::add(const Coordinate& pt, bool allowRepeatedPoints)
+/* public */
+void
+LinearGeometryBuilder::add(const Coordinate& pt, bool allowRepeatedPoints)
{
if (!coordList)
coordList = new CoordinateArraySequence();
@@ -83,15 +77,16 @@
lastPt = pt;
}
-Coordinate LinearGeometryBuilder::getLastCoordinate() const
+/* public */
+Coordinate
+LinearGeometryBuilder::getLastCoordinate() const
{
return lastPt;
}
-/**
- * Terminate the current LineString.
- */
-void LinearGeometryBuilder::endLine()
+/* public */
+void
+LinearGeometryBuilder::endLine()
{
if (!coordList)
{
@@ -131,11 +126,16 @@
coordList = 0;
}
-Geometry* LinearGeometryBuilder::getGeometry()
+/* public */
+Geometry*
+LinearGeometryBuilder::getGeometry()
{
// end last line in case it was not done by user
endLine();
+
+ // NOTE: lines elements are cloned
return geomFact->buildGeometry(lines);
}
-}
-}
+
+} // namespace geos.linearref
+} // namespace geos
More information about the geos-commits
mailing list