-
Notifications
You must be signed in to change notification settings - Fork 0
/
GW_NodeMap.cpp
executable file
·64 lines (54 loc) · 1.89 KB
/
GW_NodeMap.cpp
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
54
55
56
57
58
59
60
61
62
63
64
/*------------------------------------------------------------------------------*/
/**
* \file GW_NodeMap.cpp
* \brief Definition of class \c GW_NodeMap
* \author Gabriel Peyré
* \date 10-31-2002
*/
/*------------------------------------------------------------------------------*/
#ifdef GW_SCCSID
static const char* sccsid = "@(#) GW_NodeMap.cpp(c) Gabriel Peyré2002";
#endif // GW_SCCSID
#include "stdafx.h"
#include "GW_NodeMap.h"
#ifndef GW_USE_INLINE
#include "GW_NodeMap.inl"
#endif
using namespace GW;
/*------------------------------------------------------------------------------*/
// Name : GW_NodeMap::Add
/**
* \param Node [GW_QuadTreeNode&] The node.
* \author Gabriel Peyré
* \date 10-31-2002
*
* Add a node to the map. Assign to the node its new Id.
*/
/*------------------------------------------------------------------------------*/
void GW_NodeMap::Add( GW_QuadTreeNode& Node )
{
Map_[ nNextId_ ] = &Node;
Node.SetId( nNextId_ );
nNextId_++;
}
/*------------------------------------------------------------------------------*/
// Name : GW_NodeMap::Remove
/**
* \param Node [GW_QuadTreeNode&] The node to remove.
* \author Gabriel Peyré
* \date 10-31-2002
*
* Remove an element from the map.
*/
/*------------------------------------------------------------------------------*/
void GW_NodeMap::Remove( GW_QuadTreeNode& Node )
{
IT_QuadTreeNodeMap it = Map_.find( Node.GetId() );
GW_ASSERT( it!=Map_.end() );
Map_.erase( it );
}
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Gabriel Peyré
///////////////////////////////////////////////////////////////////////////////
// END OF FILE //
///////////////////////////////////////////////////////////////////////////////