HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_CleanTools.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Clean Tools (C++)
7  *
8  * COMMENTS: Tools used for cleaning geometry.
9  */
10 
11 #ifndef __GU_CLEANTOOLS_H__
12 #define __GU_CLEANTOOLS_H__
13 
14 #include "GU_API.h"
15 #include <UT/UT_RTree.h>
16 #include <UT/UT_String.h>
17 
18 class GU_Detail;
19 class GA_PointGroup;
20 class GA_PrimitiveGroup;
21 
22 namespace GU_CleanTools
23 {
24 
25  // the following are used to determine whether we want to MARK, REPAIR, or
26  // plainly IGNORE bad geometry
27  enum gu_Action
28  {
32  };
33 
34  // -------------------------- filtering routines --------------------------
35  // these routines use lazy deletion on primitives and points, thus leaving
36  // the process bitarray valid even if they are used consecutively.
37  //
38  // Name Convention:
39  // process* - marks and repairs geometry problems (mutates geometry)
40  // repair* - repairs geometry problems possibly depending on input group
41  // mark* - just marks bad geometry as BAD by putting it into the input
42  // group. (no mutation)
43 
44  GU_API extern void processBadOrientation(GU_Detail *gdp,
45  gu_Action bad_orientation_actn,
46  const GA_PrimitiveGroup *process,
47  GA_PrimitiveGroup *marked_polys);
48 
49  GU_API extern void precomputePolyAreas(GU_Detail *gdp,
50  UT_ValArray<fpreal> &arr_poly_area,
51  const GA_PrimitiveGroup *process);
52 
53  GU_API extern void processLocallySmallAreas(
54  GU_Detail *gdp, gu_Action loc_small_area_actn, fpreal area_loc_threshold,
55  uint random_seed, const UT_ValArray<fpreal> &arr_poly_area,
56  const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys,
57  GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove,
58  GA_PointGroup *pts_to_remove);
59 
61  GU_Detail *gdp, gu_Action glo_small_area_actn, fpreal area_glo_threshold,
62  uint random_seed, const UT_ValArray<fpreal> &arr_poly_area,
63  const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys,
64  GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove,
65  GA_PointGroup *pts_to_remove);
66 
67  GU_API extern void processLocallySmallEdges(GU_Detail *gdp,
68  gu_Action loc_small_edge_actn,
69  fpreal edge_size_loc_threshold,
70  const GA_PrimitiveGroup *process,
71  GA_PrimitiveGroup *marked_polys,
72  GA_PointGroup *marked_pts,
73  GA_PrimitiveGroup *prims_to_remove,
74  GA_PointGroup *pts_to_remove);
75 
77  gu_Action glo_small_edge_actn,
78  fpreal edge_size_glo_threshold,
79  const GA_PrimitiveGroup *process,
80  GA_PrimitiveGroup *marked_polys,
81  GA_PointGroup *marked_pts,
82  GA_PrimitiveGroup *prims_to_remove,
83  GA_PointGroup *pts_to_remove);
84 
85  GU_API extern void processNonUniform(gu_Action non_uniform_actn,
86  fpreal uni_threshold,
87  GA_PrimitiveGroup *process,
88  GA_PrimitiveGroup *marked_polys,
89  GA_PointGroup *marked_pts,
90  GA_PrimitiveGroup *prims_to_remove,
91  GA_PointGroup *pts_to_remove,
92  GU_Detail *gdp);
93 
95  GU_Detail *gdp,
96  gu_Action actn,
97  const GA_PrimitiveGroup *process,
98  GA_PrimitiveGroup *marked_polys,
99  GA_PointGroup *marked_pts,
100  GA_PrimitiveGroup *prims_to_remove);
101 
102  GU_API extern void processIllFormed(
103  GU_Detail *gdp,
104  gu_Action ill_formed_actn,
105  GA_PrimitiveGroup *process,
106  GA_PrimitiveGroup *marked_polys,
107  GA_PointGroup *marked_pts,
108  GA_PrimitiveGroup *prims_to_remove);
109 
110  GU_API extern void processDisconnectedPts(GU_Detail *gdp,
111  GA_PointGroup *marked_pts);
112 
113  GU_API extern void processSelfIntersecting(GU_Detail *gdp,
114  fpreal intersection_threshold,
115  const GA_PrimitiveGroup *process,
116  GA_PrimitiveGroup *marked_polys,
117  GA_PointGroup *marked_pts);
118 
119  GU_API extern void processManyEdges(gu_Action many_edges_actn,
120  GA_PrimitiveGroup *process,
121  GA_PrimitiveGroup *marked_polys,
122  GU_Detail *gdp);
123 
124  GU_API extern void processNonConvex(int actn, GA_PrimitiveGroup *process,
125  GA_PrimitiveGroup *marked_polys,
126  GA_PointGroup *marked_pts, GU_Detail *gdp);
127 
128  GU_API extern void processOverlapping(const GA_PrimitiveGroup *process,
129  GA_PrimitiveGroup *prims_to_remove,
130  bool pairoverlaps, GU_Detail *gdp);
131 
132  GU_API extern void processTopology(GA_PointGroup *marked_pts,
133  GA_PointGroup *repaired_pts,
134  gu_Action nonmanifold_pts_actn,
135  bool prefer_large_angles,
136  bool ignore_windings,
137  bool visualize_maximal_manifolds,
138  bool export_manifold_numbers,
139  bool fix_windings, int min_manifold_size,
140  GU_Detail *gdp, UT_String &msg);
141 }
142 
143 
144 #endif
GU_API void processLocallySmallAreas(GU_Detail *gdp, gu_Action loc_small_area_actn, fpreal area_loc_threshold, uint random_seed, const UT_ValArray< fpreal > &arr_poly_area, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove, GA_PointGroup *pts_to_remove)
GU_API void processNonUniform(gu_Action non_uniform_actn, fpreal uni_threshold, GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove, GA_PointGroup *pts_to_remove, GU_Detail *gdp)
GU_API void processManyEdges(gu_Action many_edges_actn, GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GU_Detail *gdp)
GU_API void processBadOrientation(GU_Detail *gdp, gu_Action bad_orientation_actn, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys)
GU_API void processGloballySmallEdges(GU_Detail *gdp, gu_Action glo_small_edge_actn, fpreal edge_size_glo_threshold, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove, GA_PointGroup *pts_to_remove)
GU_API void processConsecutiveDoubleVertices(GU_Detail *gdp, gu_Action actn, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove)
GU_API void processSelfIntersecting(GU_Detail *gdp, fpreal intersection_threshold, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts)
GU_API void processDisconnectedPts(GU_Detail *gdp, GA_PointGroup *marked_pts)
GU_API void precomputePolyAreas(GU_Detail *gdp, UT_ValArray< fpreal > &arr_poly_area, const GA_PrimitiveGroup *process)
GU_API void processTopology(GA_PointGroup *marked_pts, GA_PointGroup *repaired_pts, gu_Action nonmanifold_pts_actn, bool prefer_large_angles, bool ignore_windings, bool visualize_maximal_manifolds, bool export_manifold_numbers, bool fix_windings, int min_manifold_size, GU_Detail *gdp, UT_String &msg)
#define GU_API
Definition: GU_API.h:11
unsigned int uint
Definition: SYS_Types.h:33
GU_API void processGloballySmallAreas(GU_Detail *gdp, gu_Action glo_small_area_actn, fpreal area_glo_threshold, uint random_seed, const UT_ValArray< fpreal > &arr_poly_area, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove, GA_PointGroup *pts_to_remove)
double fpreal
Definition: SYS_Types.h:263
GU_API void processLocallySmallEdges(GU_Detail *gdp, gu_Action loc_small_edge_actn, fpreal edge_size_loc_threshold, const GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove, GA_PointGroup *pts_to_remove)
GU_API void processNonConvex(int actn, GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GU_Detail *gdp)
GU_API void processIllFormed(GU_Detail *gdp, gu_Action ill_formed_actn, GA_PrimitiveGroup *process, GA_PrimitiveGroup *marked_polys, GA_PointGroup *marked_pts, GA_PrimitiveGroup *prims_to_remove)
GU_API void processOverlapping(const GA_PrimitiveGroup *process, GA_PrimitiveGroup *prims_to_remove, bool pairoverlaps, GU_Detail *gdp)