Developer Documentation
Loading...
Searching...
No Matches
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 <OpenMesh/Core/Mesh/Handles.hh>
65#include <vector>
66
67//== FORWARDDECLARATIONS ======================================================
68
69//== NAMESPACES ===============================================================
70
71namespace MeshSelection {
72
73//== DEFINITIONS ==============================================================
74
75
76//===========================================================================
79//===========================================================================
80
85template< typename MeshT >
86inline
87void selectVertices(MeshT* _mesh, const std::vector< int >& _vertices);
88
94template< typename MeshT >
95inline
96void selectElements(MeshT* _mesh, const std::vector< int >& _vertices, OpenMesh::VertexHandle /*_tag*/)
97{
98 selectVertices(_mesh, _vertices);
99}
100
101
106template< typename MeshT >
107inline
108void unselectVertices(MeshT* _mesh, const std::vector< int >& _vertices);
109
113template< typename MeshT >
114inline
115void selectAllVertices(MeshT* _mesh);
116
120template< typename MeshT >
121inline
122void clearVertexSelection(MeshT* _mesh);
123
127template< typename MeshT >
128inline
129void invertVertexSelection(MeshT* _mesh);
130
135template< typename MeshT >
136inline
137void selectBoundaryVertices(MeshT* _mesh);
138
142template< typename MeshT >
143inline
144void shrinkVertexSelection(MeshT* _mesh) ;
145
149template< typename MeshT >
150inline
151void growVertexSelection(MeshT* _mesh);
152
158template< typename MeshT >
159inline
160std::vector< int > getVertexSelection(MeshT* _mesh);
161
167template< typename MeshT >
168inline
169std::vector< int > getVertexSelection(MeshT* _mesh, bool& _invert);
170
180template< typename MeshT >
181inline
182void selectBoundaryVertices(MeshT* _mesh, const typename MeshT::VertexHandle& _vh);
183
189template< typename MeshT >
190inline
191void convertVertexToEdgeSelection(MeshT* _mesh, const std::vector< int >& _vertices);
192
197template< typename MeshT >
198inline
199void convertVertexToEdgeSelection(MeshT* _mesh);
200
206template< typename MeshT >
207inline
208void convertVertexToHalfedgeSelection(MeshT* _mesh, const std::vector< int >& _vertices);
209
214template< typename MeshT >
215inline
216void convertVertexToHalfedgeSelection(MeshT* _mesh);
217
223template< typename MeshT >
224inline
225void convertVertexToFaceSelection(MeshT* _mesh, const std::vector< int >& _vertices);
226
231template< typename MeshT >
232inline
233void convertVertexToFaceSelection(MeshT* _mesh);
234
239template< typename MeshT >
240inline
241void convertVertexSelectionToFeatureVertices(MeshT* _mesh);
242
247template< typename MeshT >
248inline
249void convertFeatureVerticesToVertexSelection(MeshT* _mesh);
250
255template< typename MeshT >
256inline
257void clearFeatureVertices(MeshT* _mesh);
258
261//===========================================================================
264//===========================================================================
265
273template< typename MeshT >
274inline
275void setArea(MeshT* _mesh, const std::vector< int >& _vertices , unsigned int _type, bool _state);
276
283template< typename MeshT >
284inline
285void setArea(MeshT* _mesh , unsigned int _type, bool _state);
286
289template< typename MeshT >
290inline
291std::vector< int > getArea(MeshT* _mesh, unsigned int _type);
292
299template< typename MeshT >
300inline
301std::vector< int > getArea(MeshT* _mesh, unsigned int _type , bool& _invert);
302
305//===========================================================================
308//===========================================================================
309
315template< typename MeshT >
316inline
317void selectEdges(MeshT* _mesh, const std::vector< int >& _edges, const double _dihedral_angle_threshold = 0.0);
318
319
326template< typename MeshT >
327inline
328void selectElements(MeshT* _mesh, const std::vector< int >& _edges, OpenMesh::EdgeHandle /*_tag*/)
329{
330 selectEdges(_mesh, _edges);
331}
332
334template< typename MeshT >
335inline
336void unselectEdges(MeshT* _mesh, const std::vector< int >& _edges);
337
339template< typename MeshT >
340inline
341void selectAllEdges(MeshT* _mesh);
342
344template< typename MeshT >
345inline
346void clearEdgeSelection(MeshT* _mesh);
347
349template< typename MeshT >
350inline
351void invertEdgeSelection(MeshT* _mesh);
352
354template< typename MeshT >
355inline
356void growEdgeSelection(MeshT* _mesh);
357
359template< typename MeshT >
360void selectBoundaryEdges(MeshT* _mesh);
361
364template< typename MeshT >
365inline
366std::vector< int > getEdgeSelection(MeshT* _mesh);
367
372template< typename MeshT >
373inline
374std::vector< int > getEdgeSelection(MeshT* _mesh, bool& _invert);
375
381template< typename MeshT >
382inline
383void convertEdgeToVertexSelection(MeshT* _mesh, const std::vector< int >& _edges);
384
388template< typename MeshT >
389inline
390void convertEdgeToVertexSelection(MeshT* _mesh);
391
397template< typename MeshT >
398inline
399void convertEdgeToFaceSelection(MeshT* _mesh, const std::vector< int >& _edges);
400
404template< typename MeshT >
405inline
406void convertEdgeToFaceSelection(MeshT* _mesh);
407
411template< typename MeshT >
412inline
413void convertEdgeToHalfedgeSelection(MeshT* _mesh);
414
418template< typename MeshT >
419inline
420void convertEdgeSelectionToFeatureEdges(MeshT* _mesh);
421
425template< typename MeshT >
426inline
427void convertFeatureEdgesToEdgeSelection(MeshT* _mesh);
428
432template< typename MeshT >
433inline
434void clearFeatureEdges(MeshT* _mesh);
435
436
439//===========================================================================
442//===========================================================================
443
448template< typename MeshT >
449inline
450void selectHalfedges(MeshT* _mesh, const std::vector< int >& _halfedges);
451
457template< typename MeshT >
458inline
459void selectElements(MeshT* _mesh, const std::vector< int >& _halfedges, OpenMesh::HalfedgeHandle /*_tag*/)
460{
461 selectHalfedges(_mesh, _halfedges);
462}
463
465template< typename MeshT >
466inline
467void unselectHalfedges(MeshT* _mesh, const std::vector< int >& _halfedges);
468
470template< typename MeshT >
471inline
472void selectAllHalfedges(MeshT* _mesh);
473
475template< typename MeshT >
476inline
477void clearHalfedgeSelection(MeshT* _mesh);
478
480template< typename MeshT >
481inline
482void invertHalfedgeSelection(MeshT* _mesh);
483
485template< typename MeshT >
486void selectBoundaryHalfedges(MeshT* _mesh);
487
490template< typename MeshT >
491inline
492std::vector< int > getHalfedgeSelection(MeshT* _mesh);
493
497template< typename MeshT >
498inline
499void convertHalfedgeToVertexSelection(MeshT* _mesh);
500
504template< typename MeshT >
505inline
506void convertHalfedgeToEdgeSelection(MeshT* _mesh);
507
511template< typename MeshT >
512inline
513void convertHalfedgeToFaceSelection(MeshT* _mesh);
514
515//===========================================================================
518//===========================================================================
519
524template< typename MeshT >
525inline
526void selectFaces(MeshT* _mesh, const std::vector< int >& _faces );
527
533template< typename MeshT >
534inline
535void selectElements(MeshT* _mesh, const std::vector< int >& _faces, OpenMesh::FaceHandle /*_tag*/)
536{
537 selectFaces(_mesh, _faces);
538}
539
541template< typename MeshT >
542inline
543void unselectFaces(MeshT* _mesh, const std::vector< int >& _faces );
544
546template< typename MeshT >
547inline
548void selectAllFaces(MeshT* _mesh);
549
551template< typename MeshT >
552inline
553void clearFaceSelection(MeshT* _mesh);
554
556template< typename MeshT >
557inline
558void invertFaceSelection(MeshT* _mesh);
559
561template< typename MeshT >
562void selectBoundaryFaces(MeshT* _mesh);
563
568template< typename MeshT >
569inline
570void shrinkFaceSelection(MeshT* _mesh);
571
576template< typename MeshT >
577inline
578void growFaceSelection(MeshT* _mesh);
579
582template< typename MeshT >
583inline
584std::vector< int > getFaceSelection(MeshT* _mesh);
585
591template< typename MeshT >
592inline
593std::vector< int > getFaceSelection(MeshT* _mesh, bool& _invert);
594
601template< typename MeshT >
602inline
603void convertFaceToVertexSelection(MeshT* _mesh, const std::vector< int >& _faces);
604
608template< typename MeshT >
609inline
610void convertFaceToVertexSelection(MeshT* _mesh);
611
615template< typename MeshT >
616inline
617void convertFaceToEdgeSelection(MeshT* _mesh);
618
622template< typename MeshT >
623inline
624void convertFaceToHalfedgeSelection(MeshT* _mesh);
625
629template< typename MeshT >
630inline
631void convertFaceSelectionToFeatureFaces(MeshT* _mesh);
632
636template< typename MeshT >
637inline
638void convertFeatureFacesToFaceSelection(MeshT* _mesh);
639
643template< typename MeshT >
644inline
645void clearFeatureFaces(MeshT* _mesh);
646
649//=============================================================================
650} // MeshSelection Namespace
651//=============================================================================
652#if defined(INCLUDE_TEMPLATES) && !defined(MESHSELECTION_C)
653#define MESHSELECTION_TEMPLATES
654#include "MeshSelectionT_impl.hh"
655#endif
656//=============================================================================
657#endif // MESHSELECTION_HH defined
658//=============================================================================
659
void selectHalfedges(MeshT *_mesh, const std::vector< int > &_halfedges)
Select given halfedges of a mesh.
void selectVertices(MeshT *_mesh, const std::vector< int > &_vertices)
Select given vertices of a mesh.
void selectFaces(MeshT *_mesh, const std::vector< int > &_faces)
Select given faces of a mesh.
void selectElements(MeshT *_mesh, const std::vector< int > &_vertices, OpenMesh::VertexHandle)
Select given vertices of a mesh Same as selectVertices.
void selectEdges(MeshT *_mesh, const std::vector< int > &_edges, const double _dihedral_angle_threshold=0.0)
Select given edges of a mesh.
Handle for a edge entity.
Definition Handles.hh:135
Handle for a face entity.
Definition Handles.hh:142
Handle for a halfedge entity.
Definition Handles.hh:128
Handle for a vertex entity.
Definition Handles.hh:121