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
MeshSelection::convertEdgeToHalfedgeSelection
void convertEdgeToHalfedgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:743
MeshSelection::unselectEdges
void unselectEdges(MeshT *_mesh, const std::vector< int > &_edges)
Unselect given edges of a mesh.
Definition: MeshSelectionT_impl.hh:533
MeshSelection::convertEdgeToFaceSelection
void convertEdgeToFaceSelection(MeshT *_mesh, const std::vector< int > &_edges)
Definition: MeshSelectionT_impl.hh:695
MeshSelection::clearFeatureFaces
void clearFeatureFaces(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:1214
MeshSelection::selectHalfedges
void selectHalfedges(MeshT *_mesh, const std::vector< int > &_halfedges)
Select given edges of a mesh.
Definition: MeshSelectionT_impl.hh:800
MeshSelection::invertHalfedgeSelection
void invertHalfedgeSelection(MeshT *_mesh)
Invert Edge selection.
Definition: MeshSelectionT_impl.hh:850
MeshSelection::selectAllEdges
void selectAllEdges(MeshT *_mesh)
Select all edges of a mesh.
Definition: MeshSelectionT_impl.hh:547
MeshSelection::clearFeatureVertices
void clearFeatureVertices(MeshT *_mesh)
Clear all features.
Definition: MeshSelectionT_impl.hh:445
MeshSelection::selectBoundaryEdges
void selectBoundaryEdges(MeshT *_mesh)
Select all boundary edges of a mesh.
Definition: MeshSelectionT_impl.hh:610
MeshSelection::convertVertexSelectionToFeatureVertices
void convertVertexSelectionToFeatureVertices(MeshT *_mesh)
Convert vertex selection to feature selection.
Definition: MeshSelectionT_impl.hh:415
MeshSelection::growVertexSelection
void growVertexSelection(MeshT *_mesh)
Grow vertex selection.
Definition: MeshSelectionT_impl.hh:181
MeshSelection::selectAllHalfedges
void selectAllHalfedges(MeshT *_mesh)
Select all edges of a mesh.
Definition: MeshSelectionT_impl.hh:828
MeshSelection::convertFeatureVerticesToVertexSelection
void convertFeatureVerticesToVertexSelection(MeshT *_mesh)
Convert feature selection to vertex selection.
Definition: MeshSelectionT_impl.hh:430
MeshSelection
Definition: MeshSelectionT.hh:70
MeshSelection::selectEdges
void selectEdges(MeshT *_mesh, const std::vector< int > &_edges, const double _dihedral_angle_threshold=0.0)
Select given edges of a mesh.
Definition: MeshSelectionT_impl.hh:518
MeshSelection::unselectHalfedges
void unselectHalfedges(MeshT *_mesh, const std::vector< int > &_halfedges)
Unselect given edges of a mesh.
Definition: MeshSelectionT_impl.hh:814
MeshSelection::convertHalfedgeToVertexSelection
void convertHalfedgeToVertexSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:886
MeshSelection::growEdgeSelection
void growEdgeSelection(MeshT *_mesh)
Invert Edge selection.
Definition: MeshSelectionT_impl.hh:580
MeshSelection::selectAllVertices
void selectAllVertices(MeshT *_mesh)
Select all vertices of a mesh.
Definition: MeshSelectionT_impl.hh:102
MeshSelection::convertFaceToEdgeSelection
void convertFaceToEdgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:1154
MeshSelection::selectVertices
void selectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Select given vertices of a mesh.
Definition: MeshSelectionT_impl.hh:74
MeshSelection::invertEdgeSelection
void invertEdgeSelection(MeshT *_mesh)
Invert Edge selection.
Definition: MeshSelectionT_impl.hh:569
MeshSelection::clearHalfedgeSelection
void clearHalfedgeSelection(MeshT *_mesh)
Set all edges to unselected.
Definition: MeshSelectionT_impl.hh:839
MeshSelection::convertEdgeToVertexSelection
void convertEdgeToVertexSelection(MeshT *_mesh, const std::vector< int > &_edges)
Definition: MeshSelectionT_impl.hh:660
MeshSelection::shrinkVertexSelection
void shrinkVertexSelection(MeshT *_mesh)
Shrink vertex selection.
Definition: MeshSelectionT_impl.hh:151
MeshSelection::convertVertexToHalfedgeSelection
void convertVertexToHalfedgeSelection(MeshT *_mesh, const std::vector< int > &_vertices)
Select for each vertex in _vertices all incident halfedges.
Definition: MeshSelectionT_impl.hh:319
MeshSelection::getFaceSelection
std::vector< int > getFaceSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:1070
MeshSelection::selectAllFaces
void selectAllFaces(MeshT *_mesh)
Select all faces of a mesh.
Definition: MeshSelectionT_impl.hh:958
MeshSelection::getHalfedgeSelection
std::vector< int > getHalfedgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:874
MeshSelection::clearEdgeSelection
void clearEdgeSelection(MeshT *_mesh)
Set all edges to unselected.
Definition: MeshSelectionT_impl.hh:558
MeshSelection::shrinkFaceSelection
void shrinkFaceSelection(MeshT *_mesh)
Shrink Face selection.
Definition: MeshSelectionT_impl.hh:1010
MeshSelection::selectBoundaryVertices
void selectBoundaryVertices(MeshT *_mesh)
Select all vertices of the mesh which are boundary vertices.
Definition: MeshSelectionT_impl.hh:137
MeshSelection::clearVertexSelection
void clearVertexSelection(MeshT *_mesh)
Set all vertices to unselected.
Definition: MeshSelectionT_impl.hh:114
MeshSelection::convertFaceSelectionToFeatureFaces
void convertFaceSelectionToFeatureFaces(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:1184
MeshSelection::convertHalfedgeToFaceSelection
void convertHalfedgeToFaceSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:911
MeshSelection::convertVertexToEdgeSelection
void convertVertexToEdgeSelection(MeshT *_mesh, const std::vector< int > &_vertices)
Select for each vertex in _vertices all incident edges.
Definition: MeshSelectionT_impl.hh:276
MeshSelection::unselectFaces
void unselectFaces(MeshT *_mesh, const std::vector< int > &_faces)
Unselect given faces of a mesh.
Definition: MeshSelectionT_impl.hh:944
MeshSelection::convertFeatureEdgesToEdgeSelection
void convertFeatureEdgesToEdgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:771
MeshSelection::invertFaceSelection
void invertFaceSelection(MeshT *_mesh)
Invert face selection.
Definition: MeshSelectionT_impl.hh:982
MeshSelection::getVertexSelection
std::vector< int > getVertexSelection(MeshT *_mesh)
Get the current vertex selection.
Definition: MeshSelectionT_impl.hh:204
MeshSelection::convertVertexToFaceSelection
void convertVertexToFaceSelection(MeshT *_mesh, const std::vector< int > &_vertices)
Select for each vertex in _vertices all adjacent faces.
Definition: MeshSelectionT_impl.hh:367
MeshSelection::selectFaces
void selectFaces(MeshT *_mesh, const std::vector< int > &_faces)
Select given faces of a mesh.
Definition: MeshSelectionT_impl.hh:930
MeshSelection::convertFeatureFacesToFaceSelection
void convertFeatureFacesToFaceSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:1199
MeshSelection::invertVertexSelection
void invertVertexSelection(MeshT *_mesh)
invert vertex selection
Definition: MeshSelectionT_impl.hh:125
MeshSelection::growFaceSelection
void growFaceSelection(MeshT *_mesh)
Grow Face selection.
Definition: MeshSelectionT_impl.hh:1045
MeshSelection::selectBoundaryFaces
void selectBoundaryFaces(MeshT *_mesh)
Select all boundary faces of a mesh.
Definition: MeshSelectionT_impl.hh:993
MeshSelection::clearFaceSelection
void clearFaceSelection(MeshT *_mesh)
Set all faces to unselected.
Definition: MeshSelectionT_impl.hh:970
MeshSelection::convertHalfedgeToEdgeSelection
void convertHalfedgeToEdgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:899
MeshSelection::convertFaceToHalfedgeSelection
void convertFaceToHalfedgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:1169
MeshSelection::getArea
std::vector< int > getArea(MeshT *_mesh, unsigned int _type)
Definition: MeshSelectionT_impl.hh:478
MeshSelection::convertEdgeSelectionToFeatureEdges
void convertEdgeSelectionToFeatureEdges(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:756
MeshSelection::selectBoundaryHalfedges
void selectBoundaryHalfedges(MeshT *_mesh)
Select all boundary edges of a mesh.
Definition: MeshSelectionT_impl.hh:862
MeshSelection::convertFaceToVertexSelection
void convertFaceToVertexSelection(MeshT *_mesh, const std::vector< int > &_faces)
Definition: MeshSelectionT_impl.hh:1107
MeshSelection::setArea
void setArea(MeshT *_mesh, const std::vector< int > &_vertices, unsigned int _type, bool _state)
Set the area bit for all defined vertices.
Definition: MeshSelectionT_impl.hh:459
MeshSelection::unselectVertices
void unselectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Unselect given vertices of a mesh.
Definition: MeshSelectionT_impl.hh:88
MeshSelection::clearFeatureEdges
void clearFeatureEdges(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:786
MeshSelection::getEdgeSelection
std::vector< int > getEdgeSelection(MeshT *_mesh)
Definition: MeshSelectionT_impl.hh:623