Skip to main content
gamedev.net
🔒 Locked

Hash Map Help

Started by serious_learner07 Jun 14, 2010 at 12:16 PM 0 replies 400+ views
Original Post
serious_learner07
serious_learner07

I have a tetrahedral mesh. I need to store the triangles of each tetrahedron
to a hash map. I have never programmed using hash map. So I have little difficulty in implementing the hash map. Following is the incomplete code.


for (UINT IdxTet = 0; IdxTet <uiNumTetarhede; IdxTet++){		Eement* pElement1 = pModel->GetElement(IdxTet);		Node* pNode1 = pElement1->GetNodeList();		/* Triangles and it indices of a tetrahedron*/		int pTriangle1[4][3] = {{pNode1[0].GetID(),pNode1[1].GetID(),pNode1[2].GetID()},								{pNode1[0].GetID(),pNode1[2].GetID(),pNode1[3].GetID()},								{pNode1[0].GetID(),pNode1[1].GetID(),pNode1[3].GetID()},								{pNode1[1].GetID(),pNode1[2].GetID(),pNode1[3].GetID()};                // hash map definition		hash_map<int,int,int> TMap;                //Here I need add 4 triangles (pTriangle1) to TMap                // Please help me} 


ApochPiQ
ApochPiQ
Why do you "need" to use a hash map?

This sounds suspiciously like homework, and homework questions are not permitted. At the very least you will need to provide some indication that you are making some effort to understand and solve the problem, rather than just scrape a free answer off the internet.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.