source: subversion/applications/lib/libosm/Way.h @ 11683

Last change on this file since 11683 was 11683, checked in by nienhueser, 11 years ago

Start making accessors const
Encapsulate the previously public id member in the Object class
Replace some duplicated constructors with default arguments
Use initialization lists in constructors

File size: 1.2 KB
Line 
1#ifndef WAY_H
2#define WAY_H
3
4/*
5 Copyright (C) 2006 Nick Whitelegg, Hogweed Software, nick@hogweed.org
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
20
21 */
22
23#include "Node.h"
24#include "Object.h"
25
26#include <vector>
27
28
29namespace OSM
30{
31
32class Way: public Object
33{
34public:
35        Way(int id = 0) : Object(id)
36        {
37        }
38
39        void addNode(int n)
40        {
41                nodes.push_back(n);
42        }
43
44        int removeNode(int);
45
46        bool addNodeAt(int index, int n);
47
48        int getNode(int i) const;
49
50        int nNodes() const
51        {
52                return nodes.size();
53        }
54
55        void toXML(std::ostream &strm);
56
57private:
58        std::vector<int> nodes;
59};
60
61}
62
63#endif
Note: See TracBrowser for help on using the repository browser.