Stripper.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2016 Imperial College London
5  * Copyright 2016 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef MIRTK_Stripper_H
21 #define MIRTK_Stripper_H
22 
23 #include "mirtk/MeshFilter.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Creates line strips from contiguous lines and adjacent triangles
31  *
32  * This filter is the equivalent of the vtkStripper, but with a more efficient
33  * line stripping algorithm. Moreover, VTK <7 does not have the
34  * vtkStripper::SetJoinContigousLines option.
35  */
36 class Stripper : public MeshFilter
37 {
38  mirtkObjectMacro(Stripper);
39 
40  // ---------------------------------------------------------------------------
41  // Attributes
42 
43  /// Convert contiguous lines to poly-lines
44  mirtkPublicAttributeMacro(bool, StripLines);
45 
46  /// Convert adjacent triangles to triangle strips
47  mirtkPublicAttributeMacro(bool, StripTriangles);
48 
49  /// Copy attributes of this class from another instance
50  void CopyAttributes(const Stripper &);
51 
52  // ---------------------------------------------------------------------------
53  // Construction/Destruction
54 
55 public:
56 
57  /// Default constructor
58  Stripper();
59 
60  /// Copy constructor
61  Stripper(const Stripper &);
62 
63  /// Assignment operator
64  Stripper &operator =(const Stripper &);
65 
66  /// Destructor
67  virtual ~Stripper();
68 
69  // ---------------------------------------------------------------------------
70  // Execution
71 
72 protected:
73 
74  /// Execute filter
75  virtual void Execute();
76 
77  // ---------------------------------------------------------------------------
78  // Alternative VTK-like API
79 
80 public:
81 
82  /// Enable/disable joining of contiguous lines
83  mirtkOnOffMacro(StripLines);
84 
85  /// Enable/disable generation of triangle strips
86  mirtkOnOffMacro(StripTriangles);
87 
88 };
89 
90 
91 } // namespace mirtk
92 
93 #endif // MIRTK_Stripper_H
virtual ~Stripper()
Destructor.
Definition: IOConfig.h:41
mirtkOnOffMacro(StripLines)
Enable/disable joining of contiguous lines.
Stripper & operator=(const Stripper &)
Assignment operator.
virtual void Execute()
Execute filter.
Stripper()
Default constructor.