Commit c552202e authored by Matthias Möller's avatar Matthias Möller

OM3 iterators

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17222 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d845a97c
...@@ -826,11 +826,11 @@ find_nearest_point( const MeshT& _mesh, ...@@ -826,11 +826,11 @@ find_nearest_point( const MeshT& _mesh,
typename MeshT::ConstFaceIter cf_end = _mesh.faces_end(); typename MeshT::ConstFaceIter cf_end = _mesh.faces_end();
for (; cf_it != cf_end; ++cf_it) { for (; cf_it != cf_end; ++cf_it) {
typename MeshT::ConstFaceVertexIter cfv_it = _mesh.cfv_iter(cf_it); typename MeshT::ConstFaceVertexIter cfv_it = _mesh.cfv_iter(*cf_it);
const typename MeshT::Point& pt0 = _mesh.point(cfv_it); const typename MeshT::Point& pt0 = _mesh.point(*cfv_it);
const typename MeshT::Point& pt1 = _mesh.point(++cfv_it); const typename MeshT::Point& pt1 = _mesh.point(*(++cfv_it));
const typename MeshT::Point& pt2 = _mesh.point(++cfv_it); const typename MeshT::Point& pt2 = _mesh.point(*(++cfv_it));
typename MeshT::Point ptn; typename MeshT::Point ptn;
...@@ -840,7 +840,7 @@ find_nearest_point( const MeshT& _mesh, ...@@ -840,7 +840,7 @@ find_nearest_point( const MeshT& _mesh,
d_best = d; d_best = d;
p_best = ptn; p_best = ptn;
fh_best = cf_it.handle(); fh_best = *cf_it;
} }
} }
...@@ -856,9 +856,9 @@ find_nearest_point( const MeshT& _mesh, ...@@ -856,9 +856,9 @@ find_nearest_point( const MeshT& _mesh,
typename MeshT::FaceHandle fh = _ssearch->nearest(p0).handle; typename MeshT::FaceHandle fh = _ssearch->nearest(p0).handle;
typename MeshT::CFVIter fv_it = _mesh.cfv_iter(fh); typename MeshT::CFVIter fv_it = _mesh.cfv_iter(fh);
const typename MeshT::Point& pt0 = _mesh.point(fv_it); const typename MeshT::Point& pt0 = _mesh.point(*fv_it);
const typename MeshT::Point& pt1 = _mesh.point(++fv_it); const typename MeshT::Point& pt1 = _mesh.point(*(++fv_it));
const typename MeshT::Point& pt2 = _mesh.point(++fv_it); const typename MeshT::Point& pt2 = _mesh.point(*(++fv_it));
// project // project
d_best = Geometry::distPointTriangleSquared(p0, pt0, pt1, pt2, p_best); d_best = Geometry::distPointTriangleSquared(p0, pt0, pt1, pt2, p_best);
......
...@@ -28,7 +28,7 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh, ...@@ -28,7 +28,7 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh,
typename MeshT::HalfedgeIter e_it, e_end = _mesh->halfedges_end(); typename MeshT::HalfedgeIter e_it, e_end = _mesh->halfedges_end();
for( e_it = _mesh->halfedges_begin(); e_it != e_end; ++e_it ) for( e_it = _mesh->halfedges_begin(); e_it != e_end; ++e_it )
_mesh->property( cut, e_it ) = false; _mesh->property( cut, *e_it ) = false;
// int id = -1; // int id = -1;
bool stop = false; bool stop = false;
...@@ -47,12 +47,12 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh, ...@@ -47,12 +47,12 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh,
stop = true; stop = true;
// First check the face we are in // First check the face we are in
for ( typename MeshT::FaceHalfedgeIter fhe_it( *_mesh, current_face ); fhe_it; ++fhe_it){ for ( typename MeshT::FaceHalfedgeIter fhe_it( *_mesh, current_face ); fhe_it.is_valid(); ++fhe_it){
if ( _mesh->property(cut,fhe_it) ) if ( _mesh->property(cut,*fhe_it) )
continue; continue;
typename MeshT::Point p0 = _mesh->point( _mesh->from_vertex_handle(fhe_it) ); typename MeshT::Point p0 = _mesh->point( _mesh->from_vertex_handle(*fhe_it) );
typename MeshT::Point p1 = _mesh->point( _mesh->to_vertex_handle(fhe_it) ); typename MeshT::Point p1 = _mesh->point( _mesh->to_vertex_handle(*fhe_it) );
typename MeshT::Point u = p1 - p0; typename MeshT::Point u = p1 - p0;
typename MeshT::Point w = p0 - _planePoint; typename MeshT::Point w = p0 - _planePoint;
...@@ -68,9 +68,9 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh, ...@@ -68,9 +68,9 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh,
nothingFound = false; nothingFound = false;
stop = false; stop = false;
_mesh->property(cut,fhe_it.handle()) = true; _mesh->property(cut,*fhe_it) = true;
_mesh->property(cut,_mesh->opposite_halfedge_handle(fhe_it)) = true; _mesh->property(cut,_mesh->opposite_halfedge_handle(*fhe_it)) = true;
current_face = _mesh->face_handle(_mesh->opposite_halfedge_handle(fhe_it)); current_face = _mesh->face_handle(_mesh->opposite_halfedge_handle(*fhe_it));
if (!current_face.is_valid()) if (!current_face.is_valid())
stop = true; stop = true;
...@@ -98,8 +98,8 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh, ...@@ -98,8 +98,8 @@ std::vector< ACG::Vec3d > PolyLinePlugin::getIntersectionPoints( MeshT* _mesh,
//add the "expansionLevel"-ring of the start-face to the start candidates //add the "expansionLevel"-ring of the start-face to the start candidates
for (uint i=0; i < expandable.size(); i++) for (uint i=0; i < expandable.size(); i++)
for( typename MeshT::FaceFaceIter ff_it(*_mesh, expandable[i]); ff_it; ++ff_it ) for( typename MeshT::FaceFaceIter ff_it(*_mesh, expandable[i]); ff_it.is_valid(); ++ff_it )
startCandidates.push_back( ff_it.handle() ); startCandidates.push_back( *ff_it );
expandable.clear(); expandable.clear();
expansionLevel++; expansionLevel++;
...@@ -148,7 +148,7 @@ PolyLinePlugin::getCuttedEdge(MeshT& _mesh, ACG::Vec3d& _planeNormal, ACG::Vec3d ...@@ -148,7 +148,7 @@ PolyLinePlugin::getCuttedEdge(MeshT& _mesh, ACG::Vec3d& _planeNormal, ACG::Vec3d
for (e_it = _mesh.edges_begin(); e_it != e_end; ++e_it){ for (e_it = _mesh.edges_begin(); e_it != e_end; ++e_it){
typename MeshT::HalfedgeHandle hh = _mesh.halfedge_handle(e_it, 0); typename MeshT::HalfedgeHandle hh = _mesh.halfedge_handle(*e_it, 0);
//get intersection point with plane //get intersection point with plane
typename MeshT::Point p0 = _mesh.point( _mesh.from_vertex_handle(hh) ); typename MeshT::Point p0 = _mesh.point( _mesh.from_vertex_handle(hh) );
...@@ -172,7 +172,7 @@ PolyLinePlugin::getCuttedEdge(MeshT& _mesh, ACG::Vec3d& _planeNormal, ACG::Vec3d ...@@ -172,7 +172,7 @@ PolyLinePlugin::getCuttedEdge(MeshT& _mesh, ACG::Vec3d& _planeNormal, ACG::Vec3d
if ( dist < minDistance ){ if ( dist < minDistance ){
minDistance = dist; minDistance = dist;
minEdge = e_it.handle(); minEdge = *e_it;
} }
} }
} }
......
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