
Definition at line 99 of file NIImporter_OpenStreetMap.cpp.
Public Member Functions | |
| void | operator() (const std::pair< std::string, Edge * > &p) const |
| Substitutes the nodes in the edge of the given pair. | |
| SubstituteNode (const NIOSMNode *const toSubstitute, const NIOSMNode *const substituteWith) | |
| Initializes the functor with the node to substitute and the node with that the node in the first argument is substituted. | |
Private Attributes | |
| const NIOSMNode *const *const | mySubstituteWith |
| const NIOSMNode *const | myToSubstitute |
| NIImporter_OpenStreetMap::SubstituteNode::SubstituteNode | ( | const NIOSMNode *const | toSubstitute, | |
| const NIOSMNode *const | substituteWith | |||
| ) | [inline] |
Initializes the functor with the node to substitute and the node with that the node in the first argument is substituted.
| [in] | toSubstitute | Every occurrence of this node should substituted |
| [in] | substituteWith | This node is overwrites the occurrences of toSubstitute |
Definition at line 111 of file NIImporter_OpenStreetMap.cpp.
00112 : 00113 myToSubstitute(toSubstitute), mySubstituteWith(substituteWith) { 00114 }
| void NIImporter_OpenStreetMap::SubstituteNode::operator() | ( | const std::pair< std::string, Edge * > & | p | ) | const [inline] |
Substitutes the nodes in the edge of the given pair.
In the node list, all occurrences of toSubstitute are substituted with substituteWith. The final list has no equal adjacent nodes.
| [in] | p | A pair with the edge in which the nodes are substituted |
Definition at line 123 of file NIImporter_OpenStreetMap.cpp.
References NIImporter_OpenStreetMap::NIOSMNode::id, mySubstituteWith, and myToSubstitute.
00123 { 00124 std::vector<int>& edgeNodes = p.second->myCurrentNodes; 00125 // Substitute nodes 00126 std::replace_if(edgeNodes.begin(), edgeNodes.end(), std::bind2nd( 00127 std::equal_to<int>(), myToSubstitute->id), mySubstituteWith->id); 00128 00129 // Remove adjacent duplicates 00130 std::vector<int>::iterator newEnd = std::unique(edgeNodes.begin(), 00131 edgeNodes.end()); 00132 edgeNodes.erase(newEnd, edgeNodes.end()); 00133 }
const NIOSMNode* const * const NIImporter_OpenStreetMap::SubstituteNode::mySubstituteWith [private] |
const NIOSMNode* const NIImporter_OpenStreetMap::SubstituteNode::myToSubstitute [private] |
1.5.6