Commit 2cb08372 authored by Sylvain Thery's avatar Sylvain Thery

small adds in OBJ import

parent 949f5539
......@@ -369,7 +369,13 @@ public:
*/
bool createGroupMatVBO_PTN( Utils::VBO* positionVBO, Utils::VBO* texcoordVBO, Utils::VBO* normalVBO);
/**
* @brief add a dart by each face of group in a vector
* @param groupId the group to add
* @param dartFaces the vector in which we want to add
* @return the number of faces added.
*/
unsigned int storeFacesOfGroup(unsigned int groupId, std::vector<Dart>& dartFaces);
};
......
......@@ -1395,6 +1395,22 @@ bool OBJModel<PFP>::import( const std::string& filename, std::vector<std::string
}
template <typename PFP>
unsigned int OBJModel<PFP>::storeFacesOfGroup(unsigned int groupId, std::vector<Dart>& dartFaces)
{
unsigned int nb=dartFaces.size();
TraversorF<typename PFP::MAP> traf(m_map);
for (Dart d=traf.begin(); d!= traf.end(); d = traf.next())
{
if (m_groups[d] == groupId)
{
dartFaces.push_back(d);
}
}
return dartFaces.size()-nb;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment