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
| void addNodeRelation(std::map<int, std::vector<int> & list, Element const & elem)
{
int count = 0;
for(std::map<int, std::vector<int> >::iterator it=list.begin();
it!=list.end();++it)
{
count = 0;
if(elem == it->first)
{
it->second.push_back(elem.index()) ;
++ count;
}
}
/* normalement, count doit etre égal à 3 car on doit avoir ajouté l'index
* à chacun des noeuds correspondant
*
* Si ce n'est pas le cas, il faut trouver le(s) noeud(s) qui n'apparaissent
* pas encore dans la map
*/
if(count == 3)
return;
if(list.find(elem.firstAngle() == list.end())
{
std::vector<int> tab;
tab.push_back(elem.index());
list.insert(std::make_pair(elem.firstAngle(),elem.index());
}
if(list.find(elem.firstAngle() == list.end())
{
std::vector<int> tab;
tab.push_back(elem.index());
list.insert(std::make_pair(elem.firstAngle(),elem.index());
}
if(list.find(elem.secondAngle() == list.end())
{
std::vector<int> tab;
tab.push_back(elem.index());
list.insert(std::make_pair(elem.secondAngle(),elem.index());
}
if(list.find(elem.thirdAngle() == list.end())
{
std::vector<int> tab;
tab.push_back(elem.index());
list.insert(std::make_pair(elem.thirdAngle(),elem.index());
}
} |
Partager