Commit f09570dd authored by Thomas's avatar Thomas

manque de code dans 3gmap, mini correction et ENCORE probleme de reserve sur un vector

parent 6e7f22fc
......@@ -55,6 +55,11 @@ add_executable( texturesExample ../texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExample
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h)
add_executable( simpleGMap2 ../simpleGMap2.cpp ${simpleGMap2_moc} )
target_link_libraries( simpleGMap2
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h)
add_executable( extrusionView ../extrusionView.cpp ${extrusionView_moc})
target_link_libraries( extrusionView
......
......@@ -64,7 +64,7 @@ bool isPointInVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3&
* @param the point
*/
template <typename PFP>
bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW);
bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW=true);
/**
* test if a point is inside a face in a plane
......
......@@ -319,8 +319,8 @@ void Topo3RenderGMap::updateData(typename PFP::MAP& map, const FunctorSelect& go
AutoAttributeHandler<Geom::Vec3f> posBeta2x(map, DART); //beta 3 link is represented at the same location as beta2
AutoAttributeHandler<Geom::Vec3f> vert(map, DART);
// if (m_attIndex.map() != &map)
if(!m_attIndex.isValid())
if (m_attIndex.map() != &map)
// if(!m_attIndex.isValid())
{
m_attIndex = map.template addAttribute<unsigned int>(DART, "dart_index");
}
......
......@@ -546,6 +546,42 @@ bool GMap2::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
return false ;
}
bool GMap2::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mark(*this,thread); // Lock a marker
bool found = false; // Last functor return value
std::list<Dart> visitedFaces; // Faces that are traversed
visitedFaces.push_back(d); // Start with the face of d
std::list<Dart>::iterator face;
// For every face added to the list
for (face = visitedFaces.begin(); !found && face != visitedFaces.end(); ++face)
{
if (!mark.isMarked(*face)) // Face has not been visited yet
{
// Apply functor to the darts of the face
found = foreach_dart_of_oriented_face(*face, f);
// If functor returns false then mark visited darts (current face)
// and add non visited adjacent faces to the list of face
if (!found)
{
Dart dNext = *face ;
do
{
mark.mark(dNext); // Mark
Dart adj = phi2(dNext); // Get adjacent face
if (adj != dNext && !mark.isMarked(adj))
visitedFaces.push_back(adj); // Add it
dNext = phi1(dNext);
} while(dNext != *face);
}
}
}
return found;
}
bool GMap2::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
{
bool found = false;
......
......@@ -34,7 +34,7 @@ void GMap3::deleteOrientedVolume(Dart d)
bool found = false; // Last functor return value
std::vector<Dart> visitedFaces; // Faces that are traversed
visitedFaces.reserve(16);
visitedFaces.reserve(512);
visitedFaces.push_back(d); // Start with the face of d
std::vector<Dart>::iterator face;
......@@ -65,6 +65,7 @@ void GMap3::deleteOrientedVolume(Dart d)
}
}
// delete every visited face
for (face = visitedFaces.begin(); face != visitedFaces.end(); ++face)
GMap1::deleteFace(*face);
......@@ -395,7 +396,7 @@ bool GMap3::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
bool GMap3::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread)
{
return GMap1::foreach_dart_of_face(d, f, thread) || GMap1::foreach_dart_of_face(beta3(d), f, thread) ;
return GMap1::foreach_dart_of_face(d, f, thread) || (beta3(d)==d) || GMap1::foreach_dart_of_face(beta3(d), f, thread) ;
}
bool GMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
......
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