Vis 2 Demo  1.0
Technical illustration type real-time rendering of geometry
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vis2::NeighborhoodRecord Class Reference

This class keeps a record of objects colors and their neighborhood relationship. More...

Public Member Functions

 NeighborhoodRecord ()
 Empty constructor. More...
 
 ~NeighborhoodRecord ()
 Empty destructor. More...
 
void addMember (const glm::vec3 &_new_member)
 Function adds a new member as color to the list of members. More...
 
void addNeighbor (const glm::vec3 &_exiting_member, const glm::vec3 &_new_neighbor)
 Function adds a new neighbor to an existing member. More...
 
bool isNeighborOf (const glm::vec3 &_id_1, const glm::vec3 &_id_2) const
 Function queries if two color ids are neighbors. More...
 
void printNeighbLists () const
 Function writes the contents of members and neighb_lists to the cout. More...
 

Private Member Functions

 NeighborhoodRecord (const NeighborhoodRecord &)
 Hidden copy-constructor. More...
 
void addNeighbor2ExistingMember (unsigned int _slot, const glm::vec3 &_new_neighbor)
 Function adds a neighbor to the neighbor list at that index. More...
 
bool isNeighbor2ExistingMember (unsigned int _slot, const glm::vec3 &_id) const
 Function queries, if a neighbor list contains a color. More...
 

Private Attributes

colorContainer members
 a vector containing color ids More...
 
std::vector< colorContainerneighb_lists
 a vector containing lists of color ids, one for each member More...
 

Detailed Description

This class keeps a record of objects colors and their neighborhood relationship.

This class is used to keep track of neighborhood relationships in a scene,
in which logical entities are prepesented by colors.

Definition at line 17 of file NeighborhoodRecord.h.

Constructor & Destructor Documentation

vis2::NeighborhoodRecord::NeighborhoodRecord ( )
inline

Empty constructor.

Definition at line 21 of file NeighborhoodRecord.h.

vis2::NeighborhoodRecord::~NeighborhoodRecord ( )
inline

Empty destructor.

Definition at line 23 of file NeighborhoodRecord.h.

vis2::NeighborhoodRecord::NeighborhoodRecord ( const NeighborhoodRecord )
private

Hidden copy-constructor.

Member Function Documentation

void NeighborhoodRecord::addMember ( const glm::vec3 &  _new_member)

Function adds a new member as color to the list of members.

Parameters
[in]_new_memberis the color to be added.
If it already exists, no entry is made.

Definition at line 5 of file NeighborhoodRecord.cpp.

void NeighborhoodRecord::addNeighbor ( const glm::vec3 &  _exiting_member,
const glm::vec3 &  _new_neighbor 
)

Function adds a new neighbor to an existing member.

Parameters
[in]_exiting_memberis the existing member; if it cannot be found, no change occurs.
[in]_new_neighboris the new neighbor; if it is already in the list of neighbors of _exiting_member, nothing changes.
The neighborhood lists of both colors are updated.

Definition at line 30 of file NeighborhoodRecord.cpp.

void NeighborhoodRecord::addNeighbor2ExistingMember ( unsigned int  _slot,
const glm::vec3 &  _new_neighbor 
)
private

Function adds a neighbor to the neighbor list at that index.

This function is called by addNeighbor.

Parameters
[in]_slotis the index of the existing member,
[in]_new_neighboris the new neighbor.

Definition at line 89 of file NeighborhoodRecord.cpp.

bool NeighborhoodRecord::isNeighbor2ExistingMember ( unsigned int  _slot,
const glm::vec3 &  _id 
) const
private

Function queries, if a neighbor list contains a color.

This function is called by isNeighborOf.

Parameters
[in]_slotis the index of the found existing member,
[in]_new_neighboris the color id we are looking for.

Definition at line 100 of file NeighborhoodRecord.cpp.

bool NeighborhoodRecord::isNeighborOf ( const glm::vec3 &  _id_1,
const glm::vec3 &  _id_2 
) const

Function queries if two color ids are neighbors.

Parameters
[in]_id_1is a color,
[in]_id_2is another color,
Returns
true if hey are neighbors, false otherwise.

Definition at line 55 of file NeighborhoodRecord.cpp.

void NeighborhoodRecord::printNeighbLists ( ) const

Function writes the contents of members and neighb_lists to the cout.

Definition at line 72 of file NeighborhoodRecord.cpp.

Member Data Documentation

colorContainer vis2::NeighborhoodRecord::members
private

a vector containing color ids

Definition at line 69 of file NeighborhoodRecord.h.

std::vector<colorContainer> vis2::NeighborhoodRecord::neighb_lists
private

a vector containing lists of color ids, one for each member

Definition at line 70 of file NeighborhoodRecord.h.


The documentation for this class was generated from the following files: