File: Subgraph.cpp

package info (click to toggle)
geos 3.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 10,060 kB
  • ctags: 8,674
  • sloc: cpp: 64,513; xml: 23,384; sh: 8,965; ruby: 1,295; makefile: 1,124; python: 824; ansic: 289
file content (53 lines) | stat: -rw-r--r-- 1,498 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**********************************************************************
 * $Id: Subgraph.cpp 1820 2006-09-06 16:54:23Z mloskot $
 *
 * GEOS - Geometry Engine Open Source
 * http://geos.refractions.net
 *
 * Copyright (C) 2006 Refractions Research Inc.
 *
 * This is free software; you can redistribute and/or modify it under
 * the terms of the GNU Lesser General Licence as published
 * by the Free Software Foundation. 
 * See the COPYING file for more information.
 *
 * Last port: planargraph/Subgraph.java rev. 1.3 (JTS-1.7)
 *
 **********************************************************************/

#include <geos/planargraph/Subgraph.h>
#include <geos/planargraph/Edge.h>
#include <geos/planargraph/DirectedEdge.h>

#include <utility>
#include <vector>

using namespace std;

namespace geos {
namespace planargraph {

pair<Edge::NonConstSet::iterator, bool>
Subgraph::add(Edge *e)
{
	pair<Edge::NonConstSet::iterator,bool> p = edges.insert(e);
	if (!p.second) return p;

	dirEdges.push_back(e->getDirEdge(0));
	dirEdges.push_back(e->getDirEdge(1));
	nodeMap.add(e->getDirEdge(0)->getFromNode());
	nodeMap.add(e->getDirEdge(1)->getFromNode());

	return p;
}

} // namespace planargraph
} // namespace geos

/**********************************************************************
 * $Log$
 * Revision 1.1  2006/03/21 21:42:54  strk
 * planargraph.h header split, planargraph:: classes renamed to match JTS symbols
 *
 **********************************************************************/