MapLink Pro 11.2
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLNetwork Class Reference

Detailed Description

This class represents a generic network of nodes and links, where the nodes are TSLNode objects and the links are TSLLink objects. A link inserted between two nodes is considered uni-directional; therefore 2 links are required for bi-directional linkage.

The network also introduces the concept of inter-link relationships (turns). For example, in a road network, whilst two junctions may be physically connected, traffic may be prohibited from following a particular set of links (e.g. no left turn at a junction). A traditional solution to this is to locally expand the number of junction nodes and create 'dummy' one-way links which can lead to an explosion of nodes and links. The solution used by MapLink is to allow clients to specify relationships between links, where this is required. The absence of such a relationship implies freedom of connection between corresponding links. This allows clients to create networks corresponding directly to those in their problem domain; to then add the costs of inter-link communication where necessary, again corresponding directly to the problem domain. The accompanying route-traversal class is intelligent enough to use this information for routing network flow appropriately.

A Spatial Index can be created that provides a more efficient search mechanism for links. Functions exist to query the Spatial Index status, invalidate it and to update it. Additionally, the Spatial Index can be saved to a file and loaded from a previously stored file. It is advisable to save the Spatial Index, when the Network is stable, as it is much quicker to load from file than to recreate it. Adding nodes or links invalidates the Spatial Index. However, if a link's geometry is changed, the user should invalidate the Spatial Index explicitly.

Classes

class  const_link_iterator
 
class  const_node_iterator
 
class  const_turn_iterator
 
class  link_iterator
 
class  node_iterator
 
class  Query
 
class  Streamer
 
class  turn_iterator
 

Public Types

enum  find_type { tsl_nwk_find_nodes = 0 , tsl_nwk_find_links = 1 , tsl_nwk_find_both = 2 }
 

Public Member Functions

bool appendNetwork (TSLNetwork *other)
 
bool appendNetworkCopy (const TSLNetwork *other)
 
link_iterator begin_links ()
 
const_link_iterator begin_links () const
 
link_iterator begin_links (int src)
 
const_link_iterator begin_links (int src) const
 
link_iterator begin_links (const node_iterator &it)
 
const_link_iterator begin_links (const const_node_iterator &it) const
 
node_iterator begin_nodes ()
 
const_node_iterator begin_nodes () const
 
turn_iterator begin_turns ()
 
const_turn_iterator begin_turns () const
 
turn_iterator begin_turns (int src)
 
const_turn_iterator begin_turns (int src) const
 
turn_iterator begin_turns (const node_iterator &it)
 
const_turn_iterator begin_turns (const const_node_iterator &it) const
 
int capacity () const
 
void clear ()
 
void clear_links ()
 
void clear_turns ()
 
void destroy ()
 
bool empty ()
 
bool empty_links ()
 
bool empty_turns ()
 
const_link_iterator end_links (const const_node_iterator &it) const
 
link_iterator end_links ()
 
const_link_iterator end_links () const
 
link_iterator end_links (int src)
 
const_link_iterator end_links (int src) const
 
link_iterator end_links (const node_iterator &it)
 
const_node_iterator end_nodes () const
 
node_iterator end_nodes ()
 
turn_iterator end_turns ()
 
const_turn_iterator end_turns () const
 
turn_iterator end_turns (int src)
 
const_turn_iterator end_turns (int src) const
 
turn_iterator end_turns (const node_iterator &it)
 
const_turn_iterator end_turns (const const_node_iterator &it) const
 
link_iterator erase_links (const link_iterator &first, const link_iterator &last)
 
link_iterator erase_links (const link_iterator &it)
 
void erase_links (int dest)
 
node_iterator erase_nodes (int first, int last)
 
node_iterator erase_nodes (int src)
 
node_iterator erase_nodes (const node_iterator &first, const node_iterator &last)
 
node_iterator erase_nodes (const node_iterator &it)
 
void erase_turns (const link_iterator &it)
 
void erase_turns (int the_node)
 
Queryfind (const TSLEnvelope &extent, const TSLNwkFinder &filter, find_type filter_mode=tsl_nwk_find_both) const
 
const_link_iterator find_link (const TSLCoord &location, int aperture) const
 
Queryfind_links (const TSLCoord &location, int aperture, const TSLNwkFinder *filter=NULL, int limit=-1, bool useSpatialIndex=true)
 
const_node_iterator find_node (const TSLCoord &location, int aperture) const
 
TSLNodeget_node (int pos)
 
const TSLNodeget_node (int pos) const
 
link_iterator insert_link (int src, int dest, const TSLLink &the_link=TSLLink())
 
link_iterator insert_link (const link_iterator &link_it, const node_iterator &dest_it, const TSLLink &the_link=TSLLink())
 
link_iterator insert_link (const node_iterator &src_it, const node_iterator &dest_it, const TSLLink &the_link=TSLLink())
 
node_iterator insert_nodes (const node_iterator &it, const TSLNode &the_node=TSLNode())
 
void insert_nodes (const node_iterator &it, int N, const TSLNode &the_node=TSLNode())
 
turn_iterator insert_turn (const link_iterator &src_it, const link_iterator &dest_it, const TSLTurn &the_turn=TSLTurn())
 
turn_iterator insert_turn (int src, int dest, int via, const TSLTurn &the_turn=TSLTurn())
 
void invalidateSpatialIndex ()
 
bool isEdgeNode (int index) const
 
bool isStitchNode (int index) const
 
const TSLNodelinkDestinNode (const const_link_iterator &it) const
 
int linkDestinNodePos (const const_link_iterator &it) const
 
bool linkNodes (const const_link_iterator &it, TSLNode &src, TSLNode &dst) const
 
bool linkNodes (const TSLLink &link, TSLNode &src, TSLNode &dst) const
 
Streamer links ()
 
const TSLNodelinkSourceNode (const const_link_iterator &it) const
 
int linkSourceNodePos (const const_link_iterator &it) const
 
bool loadSpatialIndex (TSLifstream &inputStream)
 
void markEdgeNode (int index)
 
void markStitchNode (int index)
 
void mergeEdgeNodes (const TSLNodeCmp &nodePred, const TSLLinkCmp &linkPred)
 
void mergeNetwork (TSLNetwork *other, const TSLNodeCmp &nodePred)
 
Streamer net__ ()
 
Streamer nodes ()
 
void pop_back ()
 
void push_back (const TSLNode &the_node)
 
void removeEdgeNode (int index)
 
void reserve (int N)
 
void resize (int N, TSLNode the_node=TSLNode())
 
bool saveSpatialIndex (TSLofstream &outputStream) const
 
bool spatialIndexUpToDate () const
 
int size () const
 
int size_links () const
 
int size_turns () const
 
Streamer turns ()
 
const_link_iterator turnDestinLink (const const_turn_iterator &it) const
 
const_link_iterator turnSourceLink (const const_turn_iterator &it) const
 
bool updateSpatialIndex ()
 
link_iterator insert_link_between (int src, int dest, const TSLLink &the_link=TSLLink())
 
void mendEdgeNodes (TSLNetwork *other, const TSLNodeCmp &nodePred)
 
void * operator new (size_t size)
 
void * operator new (size_t size, char *filename, int line)
 

Member Enumeration Documentation

◆ find_type

The type of find

Enumerator
tsl_nwk_find_nodes 

search for nodes only

tsl_nwk_find_links 

search for links only

tsl_nwk_find_both 

search for both nodes and links

Member Function Documentation

◆ appendNetwork()

bool TSLNetwork::appendNetwork ( TSLNetwork * other)

Append one network to another. Invalidates the other network.

Parameters
otherPointer to the network to append.

Return true on success, false otherwise.

◆ appendNetworkCopy()

bool TSLNetwork::appendNetworkCopy ( const TSLNetwork * other)

Append a copy of one network to another.

Parameters
otherPointer to the network to append.

Return true on success, false otherwise.

◆ begin_links() [1/6]

link_iterator TSLNetwork::begin_links ( )

Access method for links in the network.

Returns a link_iterator to the first link.

◆ begin_links() [2/6]

const_link_iterator TSLNetwork::begin_links ( ) const

Access method (const) for links in the network.

Returns a const_link_iterator to the first link.

◆ begin_links() [3/6]

const_link_iterator TSLNetwork::begin_links ( const const_node_iterator & it) const

Access method (const) for the links outgoing from a given node in the network.

Parameters
itReference to the node iterator.
Returns
a const_link_iterator to the first outgoing link of the node associated with the given const_node_iterator.

◆ begin_links() [4/6]

link_iterator TSLNetwork::begin_links ( const node_iterator & it)

Access method for the links outgoing from a given node in the network.

Parameters
itReference to the node iterator.
Returns
a link_iterator to the first outgoing link of the node associated with the given node_iterator.

◆ begin_links() [5/6]

link_iterator TSLNetwork::begin_links ( int src)

Access method for the links outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a link_iterator to the first outgoing link of the node at the given index.

◆ begin_links() [6/6]

const_link_iterator TSLNetwork::begin_links ( int src) const

Access method (const) for the links outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a const_link_iterator to the first outgoing link of the node at the given index.

◆ begin_nodes() [1/2]

node_iterator TSLNetwork::begin_nodes ( )

Access method for nodes in the network.

Returns a node_iterator to the first node.

◆ begin_nodes() [2/2]

const_node_iterator TSLNetwork::begin_nodes ( ) const

Access method (const ) for nodes in the network.

Returns a const_node_iterator to the first node.

◆ begin_turns() [1/6]

turn_iterator TSLNetwork::begin_turns ( )

Access method for turns in the network.

Returns a turn_iterator to the first turn.

◆ begin_turns() [2/6]

const_turn_iterator TSLNetwork::begin_turns ( ) const

Access method (const) for turns in the network.

Returns a const_turn_iterator to the first turn.

◆ begin_turns() [3/6]

const_turn_iterator TSLNetwork::begin_turns ( const const_node_iterator & it) const

Access method (const) for the turns outgoing from a given node in the network.

Parameters
itA reference to the const node iterator.
Returns
a const_turn_iterator to the first outgoing turn of the node associated with the given const_node_iterator.

◆ begin_turns() [4/6]

turn_iterator TSLNetwork::begin_turns ( const node_iterator & it)

Access method for the turns outgoing from a given node in the network.

Parameters
itA reference to the node iterator.
Returns
a turn_iterator to the first outgoing turn of the node associated with the given node_iterator.

◆ begin_turns() [5/6]

turn_iterator TSLNetwork::begin_turns ( int src)

Access method for the turns outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a turn_iterator to the first outgoing turn of the node at the given index.

◆ begin_turns() [6/6]

const_turn_iterator TSLNetwork::begin_turns ( int src) const

Access method (const) for the turns outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a const_turn_iterator to the first outgoing turn of the node at the given index.

◆ capacity()

int TSLNetwork::capacity ( ) const

Query method for nodes in the network.

Returns the storage currently allocated to hold the nodes, a value at least as large as size().

◆ clear()

void TSLNetwork::clear ( )

Removes all the nodes, links and turns.

◆ clear_links()

void TSLNetwork::clear_links ( )

Removes all links (& therefore any associated turns).

◆ clear_turns()

void TSLNetwork::clear_turns ( )

Removes all the turns.

◆ destroy()

void TSLNetwork::destroy ( )

Deletes the TSLNetwork object (but does not delete contained node & link objects).

◆ empty()

bool TSLNetwork::empty ( )

Query method for nodes in the network.

Returns true if there are no nodes in the network, false otherwise.

◆ empty_links()

bool TSLNetwork::empty_links ( )

Query method for links in the network.

Returns true if there are no links in the network, false otherwise.

◆ empty_turns()

bool TSLNetwork::empty_turns ( )

Query method for turns in the network.

Returns true if there are no turns in the network, false otherwise.

◆ end_links() [1/6]

link_iterator TSLNetwork::end_links ( )

Access method for links in the network.

Returns a link_iterator to one past the last link.

◆ end_links() [2/6]

const_link_iterator TSLNetwork::end_links ( ) const

Access method (const) for links in the network.

Returns a const_link_iterator to one past the last link.

◆ end_links() [3/6]

const_link_iterator TSLNetwork::end_links ( const const_node_iterator & it) const

Access method (const) for the links outgoing from a given node in the network.

Parameters
itA reference to the const node iterator.
Returns
a const_link_iterator to one past the last outgoing link of the node associated with the given const_node_iterator.

◆ end_links() [4/6]

link_iterator TSLNetwork::end_links ( const node_iterator & it)

Access method for the links outgoing from a given node in the network.

Parameters
itA reference to the node iterator.
Returns
a link_iterator to one past the last outgoing link of the node associated with the given node_iterator.

◆ end_links() [5/6]

link_iterator TSLNetwork::end_links ( int src)

Access method for the links outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a link_iterator to one past the last outgoing link of the node at the given index.

◆ end_links() [6/6]

const_link_iterator TSLNetwork::end_links ( int src) const

Access method (const) for the links outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a const_link_iterator to one past the last outgoing link of the node at the given index.

◆ end_nodes() [1/2]

node_iterator TSLNetwork::end_nodes ( )

Access method for nodes in the network.

Returns a node_iterator to one past the last node.

◆ end_nodes() [2/2]

const_node_iterator TSLNetwork::end_nodes ( ) const

Access method (const) for nodes in the network.

Returns a const_node_iterator to one past the last node.

◆ end_turns() [1/6]

turn_iterator TSLNetwork::end_turns ( )

Access method for turns in the network.

Returns a turn_iterator to one past the last turn.

◆ end_turns() [2/6]

const_turn_iterator TSLNetwork::end_turns ( ) const

Access method (const) for turns in the network.

Returns a const_turn_iterator to one past the last turn.

◆ end_turns() [3/6]

const_turn_iterator TSLNetwork::end_turns ( const const_node_iterator & it) const

Access method (const) for the turns outgoing from a given node in the network.

Parameters
itA reference to the const node iterator.
Returns
a const_turn_iterator to one past the last outgoing turn of the node associated with the given const_node_iterator.

◆ end_turns() [4/6]

turn_iterator TSLNetwork::end_turns ( const node_iterator & it)

Access method for the turns outgoing from a given node in the network.

Parameters
itA reference to the node iterator.
Returns
a turn_iterator to one past the last outgoing turn of the node associated with the given node_iterator.

◆ end_turns() [5/6]

turn_iterator TSLNetwork::end_turns ( int src)

Access method for the turns outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a turn_iterator to one past the last outgoing turn of the node at the given index.

◆ end_turns() [6/6]

const_turn_iterator TSLNetwork::end_turns ( int src) const

Access method (const) for the turns outgoing from a given node in the network.

Parameters
srcThe index of the node.
Returns
a const_turn_iterator to one past the last outgoing turn of the node at the given index.

◆ erase_links() [1/3]

link_iterator TSLNetwork::erase_links ( const link_iterator & first,
const link_iterator & last )

Remove the links in the range [first, last).

Parameters
firstA reference to the link_iterator pointing to the first link to remove.
lastA reference to the link_iterator pointing to the last link.
Returns
a link_iterator that points to first remaining link beyond those that have been removed.

◆ erase_links() [2/3]

link_iterator TSLNetwork::erase_links ( const link_iterator & it)

Remove the link pointed to by the link_iterator.

Parameters
itA reference to the link_iterator pointing to the link to remove.
Returns
a link_iterator that points to first remaining link beyond the one that has been removed.

◆ erase_links() [3/3]

void TSLNetwork::erase_links ( int dest)

Remove all links that have the given node as their destination.

Parameters
destThe index of the destination node.

◆ erase_nodes() [1/4]

node_iterator TSLNetwork::erase_nodes ( const node_iterator & first,
const node_iterator & last )

Remove the nodes in the range [first, last).

Parameters
firstA reference to the node_iterator pointing to the first node to remove.
lastA reference to the node_iterator pointing to the last node.
Returns
a node_iterator that points to first remaining node beyond those that have been removed.

◆ erase_nodes() [2/4]

node_iterator TSLNetwork::erase_nodes ( const node_iterator & it)

Remove the node pointed to by the node_iterator.

Parameters
itA reference to the node_iterator pointing to the node to remove.
Returns
a node_iterator that points to first remaining node beyond the one that has been removed.

◆ erase_nodes() [3/4]

node_iterator TSLNetwork::erase_nodes ( int first,
int last )

Remove the nodes in the range [first, last).

Parameters
firstThe index of the first node to remove.
lastThe index of the last node.
Returns
a node_iterator that points to first remaining node beyond those that have been removed.

◆ erase_nodes() [4/4]

node_iterator TSLNetwork::erase_nodes ( int src)

Remove the node at the given index.

Parameters
srcThe index of the node to remove.
Returns
a node_iterator that points to first remaining node beyond the one that has been removed.

◆ erase_turns() [1/2]

void TSLNetwork::erase_turns ( const link_iterator & it)

Remove all the turns associated with the given link_iterator.

Parameters
itA reference to the link_iterator pointing to the link.

◆ erase_turns() [2/2]

void TSLNetwork::erase_turns ( int the_node)

Remove all the turns that are associated with the given node.

Parameters
the_nodeThe index of the node.

◆ find()

Query * TSLNetwork::find ( const TSLEnvelope & extent,
const TSLNwkFinder & filter,
find_type filter_mode = tsl_nwk_find_both ) const

Returns a query object which contains the elements satisfying the filter criteria and search mode supplied by the client. Checks the status of the Spatial Index. If the Spatial Index is valid, then if links are being searched for the Spatial Index is used.

Parameters
extentThe region to query.
filterA reference finder object. filter_mode: Any of TSLNetwork::tsl_nwk_find_nodes / tsl_nwk_find_links / tsl_nwk_find_both..

◆ find_link()

const_link_iterator TSLNetwork::find_link ( const TSLCoord & location,
int aperture ) const

Finds the nearest link based on location and (square) aperture. Checks the status of the Spatial Index. If the Spatial Index is valid, then the Spatial Index is used.

Parameters
locationThe centre point of area to search.
apertureThe distance from the centre point to search.
Returns
a link_iterator that refers to the link that was found.

◆ find_links()

Query * TSLNetwork::find_links ( const TSLCoord & location,
int aperture,
const TSLNwkFinder * filter = NULL,
int limit = -1,
bool useSpatialIndex = true )

Function that returns a set (Query) of Links within the boundary of the search area, dependent on additional optional filter logic. If the Spatial Index is valid, then it is used for the search and the links within the query object are ordered by distance and the distance is also stored in the query. All links should be within the aperture distance set. Initially, the set should contain all the Links that are within the boundary of the aperture from the location. This can be reduced by the optional filter and limit. If the Limit is supplied then the query object is restricted to return only this number of links or less. The limit is only used if the Spatial Index is valid.

Parameters
locationThe centre point of area to search.
apertureThe distance from the centre point to search.
filterOptional Filter object.
limitOptional limit on the number of links to return.
useSpatialIndexIf true the spatial index for the loaded network will be used if it is valid. If no spatial index is available then the standard search method will be used. Defaults to true.

◆ find_node()

const_node_iterator TSLNetwork::find_node ( const TSLCoord & location,
int aperture ) const

Finds the nearest node based on location and (square) aperture.

Parameters
locationThe centre point of area to search.
apertureThe distance from the centre point to search.
Returns
a node_iterator that refers to the link that was found.

◆ get_node() [1/2]

TSLNode & TSLNetwork::get_node ( int pos)

Access method for nodes.

Parameters
posThe index position.
Returns
a reference to the node at the specified position.

◆ get_node() [2/2]

const TSLNode & TSLNetwork::get_node ( int pos) const

Access method (const) for nodes.

Parameters
posThe index position.
Returns
a reference to the (const) node at the specified position.

◆ insert_link() [1/3]

link_iterator TSLNetwork::insert_link ( const link_iterator & link_it,
const node_iterator & dest_it,
const TSLLink & the_link = TSLLink() )

Inserts a link between two nodes in the network, given the source node's link _iterator and the node_iterator object for the destination node.

Parameters
link_itA reference to the source link_iterator.
dest_itA reference to the destination node_iterator.
the_linkA reference to the link to insert.
Returns
a link_iterator that points to the newly inserted link.

◆ insert_link() [2/3]

link_iterator TSLNetwork::insert_link ( const node_iterator & src_it,
const node_iterator & dest_it,
const TSLLink & the_link = TSLLink() )

Inserts a link between two nodes in the network, given the node_iterator objects for the source and destination nodes.

Parameters
src_itA reference to the source node_iterator.
dest_itA reference to the destination node_iterator.
the_linkA reference to the link to insert.
Returns
a link_iterator that points to the newly inserted link.

Insert a link between two nodes given the iterators to both nodes.

◆ insert_link() [3/3]

link_iterator TSLNetwork::insert_link ( int src,
int dest,
const TSLLink & the_link = TSLLink() )

Inserts a link between two nodes in the network, given the index position of the source and destination nodes.

Parameters
srcThe source node index.
destThe destination node index.
the_linkA reference to the link to insert.
Returns
a link_iterator that points to the newly inserted link.

◆ insert_link_between()

link_iterator TSLNetwork::insert_link_between ( int src,
int dest,
const TSLLink & the_link = TSLLink() )

Inserts a link between two nodes in the network, given the index position of the source and destination nodes.

The destination node need not exist.

This method is provided to aid in constructing tiled networks.

Parameters
srcThe source node index.
destThe destination node index.
the_linkA reference to the link to insert.
Returns
a link_iterator that points to the newly inserted link.

◆ insert_nodes() [1/2]

node_iterator TSLNetwork::insert_nodes ( const node_iterator & it,
const TSLNode & the_node = TSLNode() )

Inserts a node into the network, before the node pointed to by the given node _iterator.

Parameters
itA reference to the node iterator.
the_nodeA reference to the node to insert.
Returns
a node_iterator that points to the newly inserted node.

◆ insert_nodes() [2/2]

void TSLNetwork::insert_nodes ( const node_iterator & it,
int N,
const TSLNode & the_node = TSLNode() )

Inserts a repetition of N nodes of value the_node into the network, before the node pointed to by the given node_iterator.

Parameters
itA reference to the node iterator.
NThe number of nodes required.
the_nodeA reference to the node to insert.

◆ insert_turn() [1/2]

turn_iterator TSLNetwork::insert_turn ( const link_iterator & src_it,
const link_iterator & dest_it,
const TSLTurn & the_turn = TSLTurn() )

Inserts a turn (inter-link relationship) between two links in the network, given the link_iterator objects of the source and destination links.

Parameters
src_itA reference to the source link_iterator.
dest_itA reference to the destination link_iterator.
the_turnA reference to the turn to insert.
Returns
a turn_iterator that points to the newly inserted turn.

◆ insert_turn() [2/2]

turn_iterator TSLNetwork::insert_turn ( int src,
int dest,
int via,
const TSLTurn & the_turn = TSLTurn() )

Inserts a turn (inter-link relationship) between two links in the network, given the source, destination & via node index positions.

Parameters
srcThe source node index.
destThe destination node index.
viaThe via node index.
the_turnA reference to the turn to insert.
Returns
a turn_iterator that points to the newly inserted turn.
Note
Clients must be absolutely certain that the given indices describe unique links.

◆ invalidateSpatialIndex()

void TSLNetwork::invalidateSpatialIndex ( )

Function that invalidates the Spatial Index. An example of when to use this function would be when a Link has had its geometry changed.

◆ isEdgeNode()

bool TSLNetwork::isEdgeNode ( int index) const

Returns true if the node is an edge node, false otherwise.

Parameters
indexthe index position of the node

◆ isStitchNode()

bool TSLNetwork::isStitchNode ( int index) const

Returns true if the node is a stitch node, false otherwise.

Parameters
indexthe index position of the node

◆ linkDestinNode()

const TSLNode & TSLNetwork::linkDestinNode ( const const_link_iterator & it) const

Query method for links.

Parameters
itA reference to the const_link_iterator pointing to the link.
Returns
a reference to the link's destination Node object.

◆ linkDestinNodePos()

int TSLNetwork::linkDestinNodePos ( const const_link_iterator & it) const

Query method for links.

Parameters
itA reference to the const_link_iterator pointing to the link.
Returns
the index of the link's destination node.

◆ linkNodes() [1/2]

bool TSLNetwork::linkNodes ( const const_link_iterator & it,
TSLNode & src,
TSLNode & dst ) const

Query method for links. Returns the link's source & destination Node objects, via the supplied arguments.

Parameters
itA reference to the const_link_iterator pointing to the link.
srcA reference to the link's source Node object.
dstA reference to the link's destination Node object.
Returns
true if link exists, false otherwise.

◆ linkNodes() [2/2]

bool TSLNetwork::linkNodes ( const TSLLink & link,
TSLNode & src,
TSLNode & dst ) const

Query method for links. Returns the link's source & destination Node objects, via the supplied arguments.

Parameters
linkA reference to the Link object.
srcA reference to the link's source Node object.
dstA reference to the link's destination Node object.
Returns
true if link exists, false otherwise.

◆ links()

Streamer TSLNetwork::links ( )

This method extracts the network links for subsequent streaming.

◆ linkSourceNode()

const TSLNode & TSLNetwork::linkSourceNode ( const const_link_iterator & it) const

Query method for links.

Parameters
itA reference to the const_link_iterator pointing to the link.
Returns
a reference to the link's source Node object.

◆ linkSourceNodePos()

int TSLNetwork::linkSourceNodePos ( const const_link_iterator & it) const

Query method for links.

Parameters
itA reference to the const_link_iterator pointing to the link.
Returns
the index of the link's source node.

◆ loadSpatialIndex()

bool TSLNetwork::loadSpatialIndex ( TSLifstream & inputStream)

Function that reads and creates the Spatial Index from a file stream. If the Spatial Index already exists, it is deleted. Returns true on success or false on error.

Parameters
inputStreamReference to stream.

◆ markEdgeNode()

void TSLNetwork::markEdgeNode ( int index)

Indicates that the node at the supplied position is an edge node i.e. it originated from the edge of a dataset.

Parameters
indexThe node index.

◆ markStitchNode()

void TSLNetwork::markStitchNode ( int index)

Indicates that the node at the supplied position is a stitch node i.e. its purpose in the original data is to break links across datasets.

Parameters
indexThe node index.

◆ mendEdgeNodes()

void TSLNetwork::mendEdgeNodes ( TSLNetwork * other,
const TSLNodeCmp & nodePred )

This method tags nodes in other network as stitch nodes where appropriate.

◆ mergeEdgeNodes()

void TSLNetwork::mergeEdgeNodes ( const TSLNodeCmp & nodePred,
const TSLLinkCmp & linkPred )

For every link crossing a tile boundary, its segments are replaced by a single link and the corresponding edge nodes are removed.

Parameters
nodePredA reference to the TSLNodeCmp object.
linkPredA reference to the TSLLinkCmp object.

◆ mergeNetwork()

void TSLNetwork::mergeNetwork ( TSLNetwork * other,
const TSLNodeCmp & nodePred )

Merges the supplied network into the current one.

Parameters
otherThe network to merge into this one.
nodePredA reference to the TSLNodeCmp object.

◆ net__()

Streamer TSLNetwork::net__ ( )

This method extracts the network internals for subsequent streaming.

◆ nodes()

Streamer TSLNetwork::nodes ( )

This method extracts the network nodes for subsequent streaming.

◆ operator new() [1/2]

void * TSLNetwork::operator new ( size_t size)

These are here to avoid being documented Allocation override for API redirection.

◆ operator new() [2/2]

void * TSLNetwork::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ pop_back()

void TSLNetwork::pop_back ( )

Removes the last node in the network - clients must ensure that at least some nodes have been added to the network prior to calling this method.

◆ push_back()

void TSLNetwork::push_back ( const TSLNode & the_node)

Inserts a node into the end of the network.

Parameters
the_nodeA reference to the node to insert.

◆ removeEdgeNode()

void TSLNetwork::removeEdgeNode ( int index)

Indicates that the node at the supplied position is no longer an edge node.

Parameters
indexThe node index.

◆ reserve()

void TSLNetwork::reserve ( int N)

The member function ensures that capacity() henceforth returns at least N.

Parameters
NThe number of nodes to reserve space for.

◆ resize()

void TSLNetwork::resize ( int N,
TSLNode the_node = TSLNode() )

Ensures that size() henceforth returns N. If it must lengthen the storage for nodes, it appends nodes with value the_node.

Parameters
NThe required number of nodes.
the_nodeThe node to insert.

◆ saveSpatialIndex()

bool TSLNetwork::saveSpatialIndex ( TSLofstream & outputStream) const

Function that saves the Spatial Index to a file stream. Returns true on success, or false on error.

Parameters
outputStreamReference to stream.

◆ size()

int TSLNetwork::size ( ) const

Query method for nodes in the network.

Returns the number of nodes in the network.

◆ size_links()

int TSLNetwork::size_links ( ) const

Query method for links in the network.

Returns the number of links in the network.

◆ size_turns()

int TSLNetwork::size_turns ( ) const

Query method for turns in the network.

Returns the number of turns in the network.

◆ spatialIndexUpToDate()

bool TSLNetwork::spatialIndexUpToDate ( ) const

Returns the status of the Spatial Index.

Returns true if the spatial index is valid and can be used, false otherwise.

◆ turnDestinLink()

const_link_iterator TSLNetwork::turnDestinLink ( const const_turn_iterator & it) const

Query method for turns.

Parameters
itA reference to the const_turn_iterator pointing to the turn.
Returns
the const_link_iterator pointing to the turn's destination link.

◆ turns()

Streamer TSLNetwork::turns ( )

This method extracts the network turns for subsequent streaming.

◆ turnSourceLink()

const_link_iterator TSLNetwork::turnSourceLink ( const const_turn_iterator & it) const

Query method for turns.

Parameters
itA reference to the const_turn_iterator pointing to the turn.
Returns
the const_link_iterator pointing to the turn's source link.

◆ updateSpatialIndex()

bool TSLNetwork::updateSpatialIndex ( )

Function that updates the Networks Spatial Index. If the Spatial Index exists, it is deleted and rebuilt. If the Spatial Index doesn't exist it is constructed.

Returns true if the Spatial Index was created successfully. Returns false if an error was encountered. The TSLErrorStack should be interrogated for further information.