![]() |
Vis 2 Demo
1.0
Technical illustration type real-time rendering of geometry
|
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< colorContainer > | neighb_lists |
a vector containing lists of color ids, one for each member More... | |
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.
|
inline |
Empty constructor.
Definition at line 21 of file NeighborhoodRecord.h.
|
inline |
Empty destructor.
Definition at line 23 of file NeighborhoodRecord.h.
|
private |
Hidden copy-constructor.
void NeighborhoodRecord::addMember | ( | const glm::vec3 & | _new_member | ) |
Function adds a new member as color to the list of members.
[in] | _new_member | is 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.
[in] | _exiting_member | is the existing member; if it cannot be found, no change occurs. |
[in] | _new_neighbor | is 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.
|
private |
Function adds a neighbor to the neighbor list at that index.
This function is called by addNeighbor.
[in] | _slot | is the index of the existing member, |
[in] | _new_neighbor | is the new neighbor. |
Definition at line 89 of file NeighborhoodRecord.cpp.
|
private |
Function queries, if a neighbor list contains a color.
This function is called by isNeighborOf.
[in] | _slot | is the index of the found existing member, |
[in] | _new_neighbor | is 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.
[in] | _id_1 | is a color, |
[in] | _id_2 | is another color, |
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.
|
private |
a vector containing color ids
Definition at line 69 of file NeighborhoodRecord.h.
|
private |
a vector containing lists of color ids, one for each member
Definition at line 70 of file NeighborhoodRecord.h.