#include <GlobalIDDataBase.h>
Classes | |
struct | Pack |
Public Types | |
typedef int | LayoutID_t |
typedef int | GlobalID_t |
typedef int | NodeKey_t |
typedef std::map< LayoutID_t, GlobalID_t > | Shared_t |
Public Member Functions | |
GlobalIDDataBase () | |
NodeKey_t | push (LayoutID_t layoutID, int context, GlobalID_t globalID) |
NodeKey_t | push (LayoutID_t layoutID, int context, GlobalID_t globalID, NodeKey_t parentNode) |
void | shared (LayoutID_t idNew, LayoutID_t idOld) |
GlobalID_t | globalID (LayoutID_t layoutID, NodeKey_t key) const |
int | context (LayoutID_t layoutID, NodeKey_t key) const |
int | context (NodeKey_t key) const |
bool | contextParticipates (int context, NodeKey_t key) const |
template<class OSTR > | |
void | print (OSTR &ostr) |
Static Public Member Functions | |
static NodeKey_t | nullNodeKey () |
Since an INode can come from intersecting several different layouts, the global ID's are stored with a layout ID that comes from the layout.
Basically this database stores a map: (layoutID,nodeKey)->globalID
The nodeKey is a unique key generated for each INode that is pushed into this database. The database also tracks where a node came from in the intersection process. When you perform touches on a given INode to produce new INodes, the original INode's key is used as the parent key. That way we can trace back through the parents to find the global ID for layouts that were previously intersected.
The interface GlobalIDDataBase provides is:
GlobalIDDataBase gidStore;
nodeKey = gidStore.push(layoutID,globalID);
nodeKey = gidStore.push(layoutID,globalID,parentKey);
globalID = gidStore.globalID(layoutID,myKey);
gidStore.shared(layoutID1,layoutID2);
typedef int GlobalIDDataBase::LayoutID_t |
typedef int GlobalIDDataBase::GlobalID_t |
typedef int GlobalIDDataBase::NodeKey_t |
typedef std::map<LayoutID_t, GlobalID_t> GlobalIDDataBase::Shared_t |
GlobalIDDataBase::GlobalIDDataBase | ( | ) | [inline] |
static NodeKey_t GlobalIDDataBase::nullNodeKey | ( | ) | [inline, static] |
Referenced by SimpleIntersectorData< Dim >::intersect().
NodeKey_t GlobalIDDataBase::push | ( | LayoutID_t | layoutID, | |
int | context, | |||
GlobalID_t | globalID | |||
) |
Referenced by INode< Dim >::INode().
NodeKey_t GlobalIDDataBase::push | ( | LayoutID_t | layoutID, | |
int | context, | |||
GlobalID_t | globalID, | |||
NodeKey_t | parentNode | |||
) |
void GlobalIDDataBase::shared | ( | LayoutID_t | idNew, | |
LayoutID_t | idOld | |||
) |
Referenced by SimpleIntersectorData< Dim >::shared(), and IntersectorData< Dim >::shared().
GlobalID_t GlobalIDDataBase::globalID | ( | LayoutID_t | layoutID, | |
NodeKey_t | key | |||
) | const |
Referenced by INode< Dim >::globalID().
int GlobalIDDataBase::context | ( | LayoutID_t | layoutID, | |
NodeKey_t | key | |||
) | const |
Referenced by INode< Dim >::context().
int GlobalIDDataBase::context | ( | NodeKey_t | key | ) | const |
bool GlobalIDDataBase::contextParticipates | ( | int | context, | |
NodeKey_t | key | |||
) | const |
Referenced by INode< Dim >::contextParticipates().
void GlobalIDDataBase::print | ( | OSTR & | ostr | ) | [inline] |