Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out...
[geos.git] / src / geomgraph / NodeFactory.cpp
blobd2635cc5d820c16fee41f555258ef1e9181df96e
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005 Refractions Research Inc.
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
14 **********************************************************************
16 * Last port: geomgraph/NodeFactory.java rev. 1.3 (JTS-1.10)
18 **********************************************************************/
20 #include <geos/geomgraph/NodeFactory.h>
21 #include <geos/geomgraph/Node.h>
23 using namespace geos::geom;
25 namespace geos {
26 namespace geomgraph { // geos.geomgraph
28 Node *
29 NodeFactory::createNode(const Coordinate &coord) const
31 return new Node(coord,NULL);
34 const NodeFactory &
35 NodeFactory::instance()
37 static const NodeFactory nf;
38 return nf;
42 } // namespace geos.geomgraph
43 } // namespace geos
45 /**********************************************************************
46 * $Log$
47 * Revision 1.5 2006/03/15 17:16:29 strk
48 * streamlined headers inclusion
50 * Revision 1.4 2006/02/19 19:46:49 strk
51 * Packages <-> namespaces mapping for most GEOS internal code (uncomplete, but working). Dir-level libs for index/ subdirs.
53 * Revision 1.3 2005/11/21 16:03:20 strk
55 * Coordinate interface change:
56 * Removed setCoordinate call, use assignment operator
57 * instead. Provided a compile-time switch to
58 * make copy ctor and assignment operators non-inline
59 * to allow for more accurate profiling.
61 * Coordinate copies removal:
62 * NodeFactory::createNode() takes now a Coordinate reference
63 * rather then real value. This brings coordinate copies
64 * in the testLeaksBig.xml test from 654818 to 645991
65 * (tested in 2.1 branch). In the head branch Coordinate
66 * copies are 222198.
67 * Removed useless coordinate copies in ConvexHull
68 * operations
70 * STL containers heap allocations reduction:
71 * Converted many containers element from
72 * pointers to real objects.
73 * Made some use of .reserve() or size
74 * initialization when final container size is known
75 * in advance.
77 * Stateless classes allocations reduction:
78 * Provided ::instance() function for
79 * NodeFactories, to avoid allocating
80 * more then one (they are all
81 * stateless).
83 * HCoordinate improvements:
84 * Changed HCoordinate constructor by HCoordinates
85 * take reference rather then real objects.
86 * Changed HCoordinate::intersection to avoid
87 * a new allocation but rather return into a provided
88 * storage. LineIntersector changed to reflect
89 * the above change.
91 * Revision 1.2 2004/07/02 13:28:26 strk
92 * Fixed all #include lines to reflect headers layout change.
93 * Added client application build tips in README.
95 * Revision 1.1 2004/03/19 09:48:45 ybychkov
96 * "geomgraph" and "geomgraph/indexl" upgraded to JTS 1.4
98 * Revision 1.7 2003/11/07 01:23:42 pramsey
99 * Add standard CVS headers licence notices and copyrights to all cpp and h
100 * files.
103 **********************************************************************/