Developer Documentation
MeshSelectionT.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 
43 
44 
45 
46 
47 //=============================================================================
48 //
49 //
50 //=============================================================================
51 
52 
53 #ifndef MESHSELECTION_HH
54 #define MESHSELECTION_HH
55 
56 
62 //== INCLUDES =================================================================
63 
64 #include <vector>
65 
66 //== FORWARDDECLARATIONS ======================================================
67 
68 //== NAMESPACES ===============================================================
69 
70 namespace MeshSelection {
71 
72 //== DEFINITIONS ==============================================================
73 
74 //===========================================================================
77 //===========================================================================
78 
83 template< typename MeshT >
84 inline
85 void selectVertices(MeshT* _mesh, const std::vector< int >& _vertices);
86 
87 
92 template< typename MeshT >
93 inline
94 void unselectVertices(MeshT* _mesh, const std::vector< int >& _vertices);
95 
99 template< typename MeshT >
100 inline
101 void selectAllVertices(MeshT* _mesh);
102 
106 template< typename MeshT >
107 inline
108 void clearVertexSelection(MeshT* _mesh);
109 
113 template< typename MeshT >
114 inline
115 void invertVertexSelection(MeshT* _mesh);
116 
121 template< typename MeshT >
122 inline
123 void selectBoundaryVertices(MeshT* _mesh);
124 
128 template< typename MeshT >
129 inline
130 void shrinkVertexSelection(MeshT* _mesh) ;
131 
135 template< typename MeshT >
136 inline
137 void growVertexSelection(MeshT* _mesh);
138 
144 template< typename MeshT >
145 inline
146 std::vector< int > getVertexSelection(MeshT* _mesh);
147 
153 template< typename MeshT >
154 inline
155 std::vector< int > getVertexSelection(MeshT* _mesh, bool& _invert);
156 
166 template< typename MeshT >
167 inline
168 void selectBoundaryVertices(MeshT* _mesh, const typename MeshT::VertexHandle& _vh);
169 
175 template< typename MeshT >
176 inline
177 void convertVertexToEdgeSelection(MeshT* _mesh, const std::vector< int >& _vertices);
178 
183 template< typename MeshT >
184 inline
185 void convertVertexToEdgeSelection(MeshT* _mesh);
186 
192 template< typename MeshT >
193 inline
194 void convertVertexToHalfedgeSelection(MeshT* _mesh, const std::vector< int >& _vertices);
195 
200 template< typename MeshT >
201 inline
202 void convertVertexToHalfedgeSelection(MeshT* _mesh);
203 
209 template< typename MeshT >
210 inline
211 void convertVertexToFaceSelection(MeshT* _mesh, const std::vector< int >& _vertices);
212 
217 template< typename MeshT >
218 inline
219 void convertVertexToFaceSelection(MeshT* _mesh);
220 
225 template< typename MeshT >
226 inline
227 void convertVertexSelectionToFeatureVertices(MeshT* _mesh);
228 
233 template< typename MeshT >
234 inline
235 void convertFeatureVerticesToVertexSelection(MeshT* _mesh);
236 
241 template< typename MeshT >
242 inline
243 void clearFeatureVertices(MeshT* _mesh);
244 
247 //===========================================================================
250 //===========================================================================
251 
259 template< typename MeshT >
260 inline
261 void setArea(MeshT* _mesh, const std::vector< int >& _vertices , unsigned int _type, bool _state);
262 
269 template< typename MeshT >
270 inline
271 void setArea(MeshT* _mesh , unsigned int _type, bool _state);
272 
275 template< typename MeshT >
276 inline
277 std::vector< int > getArea(MeshT* _mesh, unsigned int _type);
278 
285 template< typename MeshT >
286 inline
287 std::vector< int > getArea(MeshT* _mesh, unsigned int _type , bool& _invert);
288 
291 //===========================================================================
294 //===========================================================================
295 
297 template< typename MeshT >
298 inline
299 void selectEdges(MeshT* _mesh, const std::vector< int >& _edges, const double _dihedral_angle_threshold = 0.0);
300 
302 template< typename MeshT >
303 inline
304 void unselectEdges(MeshT* _mesh, const std::vector< int >& _edges);
305 
307 template< typename MeshT >
308 inline
309 void selectAllEdges(MeshT* _mesh);
310 
312 template< typename MeshT >
313 inline
314 void clearEdgeSelection(MeshT* _mesh);
315 
317 template< typename MeshT >
318 inline
319 void invertEdgeSelection(MeshT* _mesh);
320 
322 template< typename MeshT >
323 inline
324 void growEdgeSelection(MeshT* _mesh);
325 
327 template< typename MeshT >
328 void selectBoundaryEdges(MeshT* _mesh);
329 
332 template< typename MeshT >
333 inline
334 std::vector< int > getEdgeSelection(MeshT* _mesh);
335 
340 template< typename MeshT >
341 inline
342 std::vector< int > getEdgeSelection(MeshT* _mesh, bool& _invert);
343 
349 template< typename MeshT >
350 inline
351 void convertEdgeToVertexSelection(MeshT* _mesh, const std::vector< int >& _edges);
352 
356 template< typename MeshT >
357 inline
358 void convertEdgeToVertexSelection(MeshT* _mesh);
359 
365 template< typename MeshT >
366 inline
367 void convertEdgeToFaceSelection(MeshT* _mesh, const std::vector< int >& _edges);
368 
372 template< typename MeshT >
373 inline
374 void convertEdgeToFaceSelection(MeshT* _mesh);
375 
379 template< typename MeshT >
380 inline
381 void convertEdgeToHalfedgeSelection(MeshT* _mesh);
382 
386 template< typename MeshT >
387 inline
388 void convertEdgeSelectionToFeatureEdges(MeshT* _mesh);
389 
393 template< typename MeshT >
394 inline
395 void convertFeatureEdgesToEdgeSelection(MeshT* _mesh);
396 
400 template< typename MeshT >
401 inline
402 void clearFeatureEdges(MeshT* _mesh);
403 
404 
407 //===========================================================================
410 //===========================================================================
411 
413 template< typename MeshT >
414 inline
415 void selectHalfedges(MeshT* _mesh, const std::vector< int >& _halfedges);
416 
418 template< typename MeshT >
419 inline
420 void unselectHalfedges(MeshT* _mesh, const std::vector< int >& _halfedges);
421 
423 template< typename MeshT >
424 inline
425 void selectAllHalfedges(MeshT* _mesh);
426 
428 template< typename MeshT >
429 inline
430 void clearHalfedgeSelection(MeshT* _mesh);
431 
433 template< typename MeshT >
434 inline
435 void invertHalfedgeSelection(MeshT* _mesh);
436 
438 template< typename MeshT >
439 void selectBoundaryHalfedges(MeshT* _mesh);
440 
443 template< typename MeshT >
444 inline
445 std::vector< int > getHalfedgeSelection(MeshT* _mesh);
446 
450 template< typename MeshT >
451 inline
452 void convertHalfedgeToVertexSelection(MeshT* _mesh);
453 
457 template< typename MeshT >
458 inline
459 void convertHalfedgeToEdgeSelection(MeshT* _mesh);
460 
464 template< typename MeshT >
465 inline
466 void convertHalfedgeToFaceSelection(MeshT* _mesh);
467 
468 //===========================================================================
471 //===========================================================================
472 
474 template< typename MeshT >
475 inline
476 void selectFaces(MeshT* _mesh, const std::vector< int >& _faces );
477 
479 template< typename MeshT >
480 inline
481 void unselectFaces(MeshT* _mesh, const std::vector< int >& _faces );
482 
484 template< typename MeshT >
485 inline
486 void selectAllFaces(MeshT* _mesh);
487 
489 template< typename MeshT >
490 inline
491 void clearFaceSelection(MeshT* _mesh);
492 
494 template< typename MeshT >
495 inline
496 void invertFaceSelection(MeshT* _mesh);
497 
499 template< typename MeshT >
500 void selectBoundaryFaces(MeshT* _mesh);
501 
506 template< typename MeshT >
507 inline
508 void shrinkFaceSelection(MeshT* _mesh);
509 
514 template< typename MeshT >
515 inline
516 void growFaceSelection(MeshT* _mesh);
517 
520 template< typename MeshT >
521 inline
522 std::vector< int > getFaceSelection(MeshT* _mesh);
523 
529 template< typename MeshT >
530 inline
531 std::vector< int > getFaceSelection(MeshT* _mesh, bool& _invert);
532 
539 template< typename MeshT >
540 inline
541 void convertFaceToVertexSelection(MeshT* _mesh, const std::vector< int >& _faces);
542 
546 template< typename MeshT >
547 inline
548 void convertFaceToVertexSelection(MeshT* _mesh);
549 
553 template< typename MeshT >
554 inline
555 void convertFaceToEdgeSelection(MeshT* _mesh);
556 
560 template< typename MeshT >
561 inline
562 void convertFaceToHalfedgeSelection(MeshT* _mesh);
563 
567 template< typename MeshT >
568 inline
569 void convertFaceSelectionToFeatureFaces(MeshT* _mesh);
570 
574 template< typename MeshT >
575 inline
576 void convertFeatureFacesToFaceSelection(MeshT* _mesh);
577 
581 template< typename MeshT >
582 inline
583 void clearFeatureFaces(MeshT* _mesh);
584 
587 //=============================================================================
588 } // MeshSelection Namespace
589 //=============================================================================
590 #if defined(INCLUDE_TEMPLATES) && !defined(MESHSELECTION_C)
591 #define MESHSELECTION_TEMPLATES
592 #include "MeshSelectionT_impl.hh"
593 #endif
594 //=============================================================================
595 #endif // MESHSELECTION_HH defined
596 //=============================================================================
597 
void convertEdgeToHalfedgeSelection(MeshT *_mesh)
void unselectEdges(MeshT *_mesh, const std::vector< int > &_edges)
Unselect given edges of a mesh.
void convertEdgeToFaceSelection(MeshT *_mesh, const std::vector< int > &_edges)
void clearFeatureFaces(MeshT *_mesh)
void selectHalfedges(MeshT *_mesh, const std::vector< int > &_halfedges)
Select given edges of a mesh.
void invertHalfedgeSelection(MeshT *_mesh)
Invert Edge selection.
void selectAllEdges(MeshT *_mesh)
Select all edges of a mesh.
void clearFeatureVertices(MeshT *_mesh)
Clear all features.
void selectBoundaryEdges(MeshT *_mesh)
Select all boundary edges of a mesh.
void convertVertexSelectionToFeatureVertices(MeshT *_mesh)
Convert vertex selection to feature selection.
void growVertexSelection(MeshT *_mesh)
Grow vertex selection.
void selectAllHalfedges(MeshT *_mesh)
Select all edges of a mesh.
void convertFeatureVerticesToVertexSelection(MeshT *_mesh)
Convert feature selection to vertex selection.
void selectEdges(MeshT *_mesh, const std::vector< int > &_edges, const double _dihedral_angle_threshold=0.0)
Select given edges of a mesh.
void unselectHalfedges(MeshT *_mesh, const std::vector< int > &_halfedges)
Unselect given edges of a mesh.
void convertHalfedgeToVertexSelection(MeshT *_mesh)
void growEdgeSelection(MeshT *_mesh)
Invert Edge selection.
void selectAllVertices(MeshT *_mesh)
Select all vertices of a mesh.
void convertFaceToEdgeSelection(MeshT *_mesh)
void selectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Select given vertices of a mesh.
void invertEdgeSelection(MeshT *_mesh)
Invert Edge selection.
void clearHalfedgeSelection(MeshT *_mesh)
Set all edges to unselected.
void convertEdgeToVertexSelection(MeshT *_mesh, const std::vector< int > &_edges)
void shrinkVertexSelection(MeshT *_mesh)
Shrink vertex selection.
void convertVertexToHalfedgeSelection(MeshT *_mesh, const std::vector< int > &_vertices)
Select for each vertex in _vertices all incident halfedges.
std::vector< int > getFaceSelection(MeshT *_mesh)
void selectAllFaces(MeshT *_mesh)
Select all faces of a mesh.
std::vector< int > getHalfedgeSelection(MeshT *_mesh)
void clearEdgeSelection(MeshT *_mesh)
Set all edges to unselected.
void shrinkFaceSelection(MeshT *_mesh)
Shrink Face selection.
void selectBoundaryVertices(MeshT *_mesh)
Select all vertices of the mesh which are boundary vertices.
void clearVertexSelection(MeshT *_mesh)
Set all vertices to unselected.
void convertFaceSelectionToFeatureFaces(MeshT *_mesh)
void convertHalfedgeToFaceSelection(MeshT *_mesh)
void convertVertexToEdgeSelection(MeshT *_mesh, const std::vector< int > &_vertices)
Select for each vertex in _vertices all incident edges.
void unselectFaces(MeshT *_mesh, const std::vector< int > &_faces)
Unselect given faces of a mesh.
void convertFeatureEdgesToEdgeSelection(MeshT *_mesh)
void invertFaceSelection(MeshT *_mesh)
Invert face selection.
std::vector< int > getVertexSelection(MeshT *_mesh)
Get the current vertex selection.
void convertVertexToFaceSelection(MeshT *_mesh, const std::vector< int > &_vertices)
Select for each vertex in _vertices all adjacent faces.
void selectFaces(MeshT *_mesh, const std::vector< int > &_faces)
Select given faces of a mesh.
void convertFeatureFacesToFaceSelection(MeshT *_mesh)
void invertVertexSelection(MeshT *_mesh)
invert vertex selection
void growFaceSelection(MeshT *_mesh)
Grow Face selection.
void selectBoundaryFaces(MeshT *_mesh)
Select all boundary faces of a mesh.
void clearFaceSelection(MeshT *_mesh)
Set all faces to unselected.
void convertHalfedgeToEdgeSelection(MeshT *_mesh)
void convertFaceToHalfedgeSelection(MeshT *_mesh)
std::vector< int > getArea(MeshT *_mesh, unsigned int _type)
void convertEdgeSelectionToFeatureEdges(MeshT *_mesh)
void selectBoundaryHalfedges(MeshT *_mesh)
Select all boundary edges of a mesh.
void convertFaceToVertexSelection(MeshT *_mesh, const std::vector< int > &_faces)
void setArea(MeshT *_mesh, const std::vector< int > &_vertices, unsigned int _type, bool _state)
Set the area bit for all defined vertices.
void unselectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Unselect given vertices of a mesh.
void clearFeatureEdges(MeshT *_mesh)
std::vector< int > getEdgeSelection(MeshT *_mesh)