Commit a7b2dc9a authored by Jan Möbius's avatar Jan Möbius
Browse files

MeshObjectSelection

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17219 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bf4356ed
......@@ -88,7 +88,7 @@ findClosestBoundary(MeshT* _mesh , typename MeshT::VertexHandle _vh){
//init visited property
typename MeshT::VertexIter v_it, v_end = _mesh->vertices_end();
for( v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it )
_mesh->property( visited, v_it ) = false;
_mesh->property( visited, *v_it ) = false;
std::queue< typename MeshT::VertexHandle > queue;
queue.push( _vh );
......
......@@ -300,7 +300,7 @@ void convertVertexToEdgeSelection(MeshT* _mesh) {
for (v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it) {
if ( _mesh->status( *v_it ).selected() ) {
typename MeshT::VertexOHalfedgeIter ohe_iter = _mesh->voh_iter(v_it);
typename MeshT::VertexOHalfedgeIter ohe_iter = _mesh->voh_iter(*v_it);
for (; ohe_iter.is_valid(); ++ohe_iter) {
// test if both incident vertices are in _vertices
......@@ -963,9 +963,9 @@ void selectBoundaryFaces(MeshT* _mesh) {
for (he_it = _mesh->halfedges_begin(); he_it != he_end ; ++he_it)
if (_mesh->is_boundary(*he_it) ) {
for (typename MeshT::VertexFaceIter vf_it(*_mesh ,_mesh->to_vertex_handle(he_it) ) ; vf_it.is_valid() ; ++vf_it)
for (typename MeshT::VertexFaceIter vf_it(*_mesh ,_mesh->to_vertex_handle(*he_it) ) ; vf_it.is_valid() ; ++vf_it)
_mesh->status(*vf_it).set_selected(true);
for (typename MeshT::VertexFaceIter vf_it(*_mesh ,_mesh->from_vertex_handle(he_it) ) ; vf_it.is_valid() ; ++vf_it)
for (typename MeshT::VertexFaceIter vf_it(*_mesh ,_mesh->from_vertex_handle(*he_it) ) ; vf_it.is_valid() ; ++vf_it)
_mesh->status(*vf_it).set_selected(true);
}
}
......@@ -1138,9 +1138,9 @@ void convertFaceToHalfedgeSelection(MeshT* _mesh) {
for ( typename MeshT::FaceIter f_it= _mesh->faces_begin() ; f_it != _mesh->faces_end() ; ++f_it )
if ( _mesh->status(f_it).selected() ){
if ( _mesh->status(*f_it).selected() ){
typename MeshT::FaceHalfedgeIter fh_iter = _mesh->fh_iter(f_it);
typename MeshT::FaceHalfedgeIter fh_iter = _mesh->fh_iter(*f_it);
for (; fh_iter.is_valid(); ++fh_iter)
_mesh->status(*fh_iter).set_selected(true);
......
......@@ -339,9 +339,9 @@ IdList MeshObjectSelectionPlugin::convertVertexPairsToEdges(int _id, const IdLis
TriMesh::VertexHandle vh = TriMesh::VertexHandle(*it);
if(!vh.is_valid()) continue;
for(TriMesh::VertexOHalfedgeIter voh_it = mesh->voh_iter(vh);
voh_it; ++voh_it) {
if(mesh->to_vertex_handle(voh_it.handle()).idx() == *(it+1)) {
edges.push_back(mesh->edge_handle(voh_it.handle()).idx());
voh_it.is_valid(); ++voh_it) {
if(mesh->to_vertex_handle(*voh_it).idx() == *(it+1)) {
edges.push_back(mesh->edge_handle(*voh_it).idx());
continue;
}
}
......@@ -361,9 +361,9 @@ IdList MeshObjectSelectionPlugin::convertVertexPairsToEdges(int _id, const IdLis
PolyMesh::VertexHandle vh = PolyMesh::VertexHandle(*it);
if(!vh.is_valid()) continue;
for(PolyMesh::VertexOHalfedgeIter voh_it = mesh->voh_iter(vh);
voh_it; ++voh_it) {
if(mesh->to_vertex_handle(voh_it.handle()).idx() == *(it+1)) {
edges.push_back(mesh->edge_handle(voh_it.handle()).idx());
voh_it.is_valid(); ++voh_it) {
if(mesh->to_vertex_handle(*voh_it).idx() == *(it+1)) {
edges.push_back(mesh->edge_handle(*voh_it).idx());
continue;
}
}
......
......@@ -310,9 +310,9 @@ IdList MeshObjectSelectionPlugin::convertVertexPairsToHalfedges(int _id, const I
TriMesh::VertexHandle vh = TriMesh::VertexHandle(*it);
if(!vh.is_valid()) continue;
for(TriMesh::VertexOHalfedgeIter voh_it = mesh->voh_iter(vh);
voh_it; ++voh_it) {
if(mesh->to_vertex_handle(voh_it.handle()).idx() == *(it+1)) {
halfedges.push_back(voh_it.handle().idx());
voh_it.is_valid(); ++voh_it) {
if(mesh->to_vertex_handle(*voh_it).idx() == *(it+1)) {
halfedges.push_back(voh_it->idx());
continue;
}
}
......@@ -332,9 +332,9 @@ IdList MeshObjectSelectionPlugin::convertVertexPairsToHalfedges(int _id, const I
PolyMesh::VertexHandle vh = PolyMesh::VertexHandle(*it);
if(!vh.is_valid()) continue;
for(PolyMesh::VertexOHalfedgeIter voh_it = mesh->voh_iter(vh);
voh_it; ++voh_it) {
if(mesh->to_vertex_handle(voh_it.handle()).idx() == *(it+1)) {
halfedges.push_back(voh_it.handle().idx());
voh_it.is_valid(); ++voh_it) {
if(mesh->to_vertex_handle(*voh_it).idx() == *(it+1)) {
halfedges.push_back(voh_it->idx());
continue;
}
}
......
......@@ -754,9 +754,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
TriMesh* mesh = PluginFunctions::triMesh(o_it);
std::vector<int> ids;
for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
if(mesh->status(e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 1)).idx());
if(mesh->status(*e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
}
}
selectHandleVertices(o_it->id(), ids);
......@@ -764,9 +764,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
PolyMesh* mesh = PluginFunctions::polyMesh(o_it);
std::vector<int> ids;
for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
if(mesh->status(e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 1)).idx());
if(mesh->status(*e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
}
}
selectHandleVertices(o_it->id(), ids);
......@@ -776,9 +776,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
TriMesh* mesh = PluginFunctions::triMesh(o_it);
std::vector<int> ids;
for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
if(mesh->status(e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 1)).idx());
if(mesh->status(*e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
}
}
selectModelingVertices(o_it->id(), ids);
......@@ -786,9 +786,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
PolyMesh* mesh = PluginFunctions::polyMesh(o_it);
std::vector<int> ids;
for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
if(mesh->status(e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(e_it, 1)).idx());
if(mesh->status(*e_it).selected()) {
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
}
}
selectModelingVertices(o_it->id(), ids);
......@@ -819,9 +819,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
TriMesh* mesh = PluginFunctions::triMesh(o_it);
std::vector<int> ids;
for(TriMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
if(mesh->status(h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(h_it).idx());
ids.push_back(mesh->from_vertex_handle(h_it).idx());
if(mesh->status(*h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(*h_it).idx());
ids.push_back(mesh->from_vertex_handle(*h_it).idx());
}
}
selectHandleVertices(o_it->id(), ids);
......@@ -829,9 +829,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
PolyMesh* mesh = PluginFunctions::polyMesh(o_it);
std::vector<int> ids;
for(PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
if(mesh->status(h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(h_it).idx());
ids.push_back(mesh->from_vertex_handle(h_it).idx());
if(mesh->status(*h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(*h_it).idx());
ids.push_back(mesh->from_vertex_handle(*h_it).idx());
}
}
selectHandleVertices(o_it->id(), ids);
......@@ -841,9 +841,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
TriMesh* mesh = PluginFunctions::triMesh(o_it);
std::vector<int> ids;
for(TriMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
if(mesh->status(h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(h_it).idx());
ids.push_back(mesh->from_vertex_handle(h_it).idx());
if(mesh->status(*h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(*h_it).idx());
ids.push_back(mesh->from_vertex_handle(*h_it).idx());
}
}
selectModelingVertices(o_it->id(), ids);
......@@ -851,9 +851,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
PolyMesh* mesh = PluginFunctions::polyMesh(o_it);
std::vector<int> ids;
for(PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
if(mesh->status(h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(h_it).idx());
ids.push_back(mesh->from_vertex_handle(h_it).idx());
if(mesh->status(*h_it).selected()) {
ids.push_back(mesh->to_vertex_handle(*h_it).idx());
ids.push_back(mesh->from_vertex_handle(*h_it).idx());
}
}
selectModelingVertices(o_it->id(), ids);
......@@ -889,9 +889,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
TriMesh* mesh = PluginFunctions::triMesh(o_it);
std::vector<int> ids;
for(TriMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
if(mesh->status(f_it).selected()) {
for(TriMesh::FaceVertexIter fv_it = mesh->fv_iter(f_it); fv_it; ++fv_it) {
ids.push_back(fv_it.handle().idx());
if(mesh->status(*f_it).selected()) {
for(TriMesh::FaceVertexIter fv_it = mesh->fv_iter(*f_it); fv_it.is_valid(); ++fv_it) {
ids.push_back(fv_it->idx());
}
}
}
......@@ -900,9 +900,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
PolyMesh* mesh = PluginFunctions::polyMesh(o_it);
std::vector<int> ids;
for(PolyMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
if(mesh->status(f_it).selected()) {
for(PolyMesh::FaceVertexIter fv_it = mesh->fv_iter(f_it); fv_it; ++fv_it) {
ids.push_back(fv_it.handle().idx());
if(mesh->status(*f_it).selected()) {
for(PolyMesh::FaceVertexIter fv_it = mesh->fv_iter(*f_it); fv_it.is_valid(); ++fv_it) {
ids.push_back(fv_it->idx());
}
}
}
......@@ -913,9 +913,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
TriMesh* mesh = PluginFunctions::triMesh(o_it);
std::vector<int> ids;
for(TriMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
if(mesh->status(f_it).selected()) {
for(TriMesh::FaceVertexIter fv_it = mesh->fv_iter(f_it); fv_it; ++fv_it) {
ids.push_back(fv_it.handle().idx());
if(mesh->status(*f_it).selected()) {
for(TriMesh::FaceVertexIter fv_it = mesh->fv_iter(*f_it); fv_it.is_valid(); ++fv_it) {
ids.push_back(fv_it->idx());
}
}
}
......@@ -924,9 +924,9 @@ void MeshObjectSelectionPlugin::conversion(const QString& _from, const QString&
PolyMesh* mesh = PluginFunctions::polyMesh(o_it);
std::vector<int> ids;
for(PolyMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
if(mesh->status(f_it).selected()) {
for(PolyMesh::FaceVertexIter fv_it = mesh->fv_iter(f_it); fv_it; ++fv_it) {
ids.push_back(fv_it.handle().idx());
if(mesh->status(*f_it).selected()) {
for(PolyMesh::FaceVertexIter fv_it = mesh->fv_iter(*f_it); fv_it.is_valid(); ++fv_it) {
ids.push_back(fv_it->idx());
}
}
}
......@@ -1182,7 +1182,7 @@ void MeshObjectSelectionPlugin::slotClosestBoundarySelection(QMouseEvent* _event
if(object->dataType(DATA_TRIANGLE_MESH)) {
TriMesh* m = PluginFunctions::triMesh(object);
TriMesh::VertexHandle vh = m->fv_iter(m->face_handle(target_idx)).handle();
TriMesh::VertexHandle vh = *(m->fv_iter(m->face_handle(target_idx)));
closestBoundarySelection(m, vh.idx(), _currentType, _deselect);
......@@ -1192,7 +1192,7 @@ void MeshObjectSelectionPlugin::slotClosestBoundarySelection(QMouseEvent* _event
} else if(object->dataType(DATA_POLY_MESH)) {
PolyMesh* m = PluginFunctions::polyMesh(object);
PolyMesh::VertexHandle vh = m->fv_iter(m->face_handle(target_idx)).handle();
PolyMesh::VertexHandle vh = *(m->fv_iter(m->face_handle(target_idx)));
closestBoundarySelection(m, vh.idx(), _currentType, _deselect);
......
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