~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Mod/Mesh/App/FeatureMeshDefects.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de>              *
 
3
 *                                                                         *
 
4
 *   This file is part of the FreeCAD CAx development system.              *
 
5
 *                                                                         *
 
6
 *   This library is free software; you can redistribute it and/or         *
 
7
 *   modify it under the terms of the GNU Library General Public           *
 
8
 *   License as published by the Free Software Foundation; either          *
 
9
 *   version 2 of the License, or (at your option) any later version.      *
 
10
 *                                                                         *
 
11
 *   This library  is distributed in the hope that it will be useful,      *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU Library General Public License for more details.                  *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU Library General Public     *
 
17
 *   License along with this library; see the file COPYING.LIB. If not,    *
 
18
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
 
19
 *   Suite 330, Boston, MA  02111-1307, USA                                *
 
20
 *                                                                         *
 
21
 ***************************************************************************/
 
22
 
 
23
 
 
24
#ifndef MESH_FEATURE_MESH_DEFECTS_H
 
25
#define MESH_FEATURE_MESH_DEFECTS_H
 
26
 
 
27
#include <App/PropertyLinks.h>
 
28
#include "MeshFeature.h"
 
29
 
 
30
namespace Mesh
 
31
{
 
32
 
 
33
/** .
 
34
 * The FixDefects class fixes defects in the attached mesh kernel.
 
35
 * @author Werner Mayer
 
36
 */
 
37
class MeshExport FixDefects : public Mesh::Feature
 
38
{
 
39
  PROPERTY_HEADER(Mesh::FixDefects);
 
40
 
 
41
public:
 
42
  /// Constructor
 
43
  FixDefects(void);
 
44
  virtual ~FixDefects();
 
45
 
 
46
  /** @name Properties */
 
47
  //@{
 
48
  App::PropertyLink   Source;
 
49
  //@}
 
50
 
 
51
  /** @name methods override Feature */
 
52
  //@{
 
53
  /// recalculate the Feature
 
54
  virtual App::DocumentObjectExecReturn *execute(void);
 
55
  short mustExecute() const;
 
56
  //@}
 
57
 
 
58
  /// returns the type name of the ViewProvider
 
59
//  virtual const char* getViewProviderName(void) const {return "MeshGui::ViewProviderDefects";}
 
60
};
 
61
 
 
62
/** .
 
63
 * The HarmonizeNormals class harmonizes the normals of the faces.
 
64
 * @author Werner Mayer
 
65
 */
 
66
class MeshExport HarmonizeNormals : public Mesh::FixDefects
 
67
{
 
68
  PROPERTY_HEADER(Mesh::HarmonizeNormals);
 
69
 
 
70
public:
 
71
  /// Constructor
 
72
  HarmonizeNormals(void);
 
73
  virtual ~HarmonizeNormals();
 
74
 
 
75
  /** @name methods override Feature */
 
76
  //@{
 
77
  /// recalculate the Feature
 
78
  virtual App::DocumentObjectExecReturn *execute(void);
 
79
  //@}
 
80
};
 
81
 
 
82
/** .
 
83
 * The FlipNormals class flips the normals of all faces.
 
84
 * @author Werner Mayer
 
85
 */
 
86
class MeshExport FlipNormals : public Mesh::FixDefects
 
87
{
 
88
  PROPERTY_HEADER(Mesh::FlipNormals);
 
89
 
 
90
public:
 
91
  /// Constructor
 
92
  FlipNormals(void);
 
93
  virtual ~FlipNormals();
 
94
 
 
95
  /** @name methods override Feature */
 
96
  //@{
 
97
  /// recalculate the Feature
 
98
  virtual App::DocumentObjectExecReturn *execute(void);
 
99
  //@}
 
100
};
 
101
 
 
102
/** .
 
103
 * The FixNonManifolds class tries to fix edges with more than two faces attached.
 
104
 * @author Werner Mayer
 
105
 */
 
106
class MeshExport FixNonManifolds : public Mesh::FixDefects
 
107
{
 
108
  PROPERTY_HEADER(Mesh::FixNonManifolds);
 
109
 
 
110
public:
 
111
  /// Constructor
 
112
  FixNonManifolds(void);
 
113
  virtual ~FixNonManifolds();
 
114
 
 
115
  /** @name methods override Feature */
 
116
  //@{
 
117
  /// recalculate the Feature
 
118
  virtual App::DocumentObjectExecReturn *execute(void);
 
119
  //@}
 
120
};
 
121
 
 
122
/** .
 
123
 * The FixDuplicatedFaces class removes duplicated faces from the mesh.
 
124
 * @author Werner Mayer
 
125
 */
 
126
class MeshExport FixDuplicatedFaces : public Mesh::FixDefects
 
127
{
 
128
  PROPERTY_HEADER(Mesh::FixDuplicatedFaces);
 
129
 
 
130
public:
 
131
  /// Constructor
 
132
  FixDuplicatedFaces(void);
 
133
  virtual ~FixDuplicatedFaces();
 
134
 
 
135
  /** @name methods override Feature */
 
136
  //@{
 
137
  /// recalculate the Feature
 
138
  virtual App::DocumentObjectExecReturn *execute(void);
 
139
  //@}
 
140
};
 
141
 
 
142
/** .
 
143
 * The FixDuplicatedPoints class removes duplicated points from the mesh.
 
144
 * @author Werner Mayer
 
145
 */
 
146
class MeshExport FixDuplicatedPoints : public Mesh::FixDefects
 
147
{
 
148
  PROPERTY_HEADER(Mesh::FixDuplicatedPoints);
 
149
 
 
150
public:
 
151
  /// Constructor
 
152
  FixDuplicatedPoints(void);
 
153
  virtual ~FixDuplicatedPoints();
 
154
 
 
155
  /** @name methods override Feature */
 
156
  //@{
 
157
  /// recalculate the Feature
 
158
  virtual App::DocumentObjectExecReturn *execute(void);
 
159
  //@}
 
160
};
 
161
 
 
162
/** .
 
163
 * The FixDegenerations class removes degenerated faces from the mesh.
 
164
 * @author Werner Mayer
 
165
 */
 
166
class MeshExport FixDegenerations : public Mesh::FixDefects
 
167
{
 
168
  PROPERTY_HEADER(Mesh::FixDegenerations);
 
169
 
 
170
public:
 
171
  /// Constructor
 
172
  FixDegenerations(void);
 
173
  virtual ~FixDegenerations();
 
174
 
 
175
  /** @name methods override Feature */
 
176
  //@{
 
177
  /// recalculate the Feature
 
178
  virtual App::DocumentObjectExecReturn *execute(void);
 
179
  //@}
 
180
};
 
181
 
 
182
/** .
 
183
 * The FixDeformations class tries to repair deformed faces by swapping edge operations.
 
184
 * @author Werner Mayer
 
185
 */
 
186
class MeshExport FixDeformations : public Mesh::FixDefects
 
187
{
 
188
  PROPERTY_HEADER(Mesh::FixDeformations);
 
189
 
 
190
public:
 
191
  /// Constructor
 
192
  FixDeformations(void);
 
193
  virtual ~FixDeformations();
 
194
 
 
195
  /** @name Properties */
 
196
  //@{
 
197
  App::PropertyFloat MaxAngle; /**< Maximum allowed angle */
 
198
  //@}
 
199
  /** @name methods override Feature */
 
200
  //@{
 
201
  /// recalculate the Feature
 
202
  virtual App::DocumentObjectExecReturn *execute(void);
 
203
  //@}
 
204
};
 
205
 
 
206
/** .
 
207
 * The FixIndices class tries to validate invalid indices of the internal mesh data structure.
 
208
 * @author Werner Mayer
 
209
 */
 
210
class MeshExport FixIndices : public Mesh::FixDefects
 
211
{
 
212
  PROPERTY_HEADER(Mesh::FixIndices);
 
213
 
 
214
public:
 
215
  /// Constructor
 
216
  FixIndices(void);
 
217
  virtual ~FixIndices();
 
218
 
 
219
  /** @name methods override Feature */
 
220
  //@{
 
221
  /// recalculate the Feature
 
222
  virtual App::DocumentObjectExecReturn *execute(void);
 
223
  //@}
 
224
};
 
225
 
 
226
/** .
 
227
 * The FillHoles class tries to fill up holes in the internal mesh data structure.
 
228
 * @author Werner Mayer
 
229
 */
 
230
class MeshExport FillHoles : public Mesh::FixDefects
 
231
{
 
232
  PROPERTY_HEADER(Mesh::FillHoles);
 
233
 
 
234
public:
 
235
  /// Constructor
 
236
  FillHoles(void);
 
237
  virtual ~FillHoles();
 
238
  App::PropertyInteger FillupHolesOfLength;
 
239
  App::PropertyFloat MaxArea;
 
240
 
 
241
  /** @name methods override Feature */
 
242
  //@{
 
243
  /// recalculate the Feature
 
244
  virtual App::DocumentObjectExecReturn *execute(void);
 
245
  //@}
 
246
};
 
247
 
 
248
/** .
 
249
 * The RemoveComponents class removes topologic indepentent components up to a certain size from the mesh data structure.
 
250
 * @author Werner Mayer
 
251
 */
 
252
class MeshExport RemoveComponents : public Mesh::FixDefects
 
253
{
 
254
  PROPERTY_HEADER(Mesh::RemoveComponents);
 
255
 
 
256
public:
 
257
  /// Constructor
 
258
  RemoveComponents(void);
 
259
  virtual ~RemoveComponents();
 
260
  App::PropertyInteger RemoveCompOfSize;
 
261
 
 
262
  /** @name methods override Feature */
 
263
  //@{
 
264
  /// recalculate the Feature
 
265
  virtual App::DocumentObjectExecReturn *execute(void);
 
266
  //@}
 
267
};
 
268
 
 
269
} //namespace Mesh
 
270
 
 
271
 
 
272
#endif // MESH_FEATURE_MESH_DEFECTS_H