HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Classify.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: GU_Classify.h ( GU Library, C++)
7 *
8 * COMMENTS:
9 * Useful functions for classifying components by various criteria.
10 */
11 
12 #ifndef __GU_Classify_h__
13 #define __GU_Classify_h__
14 
15 #include "GU_API.h"
16 
17 #include <UT/UT_VectorTypes.h>
18 #include <UT/UT_Map.h>
19 #include <GA/GA_Types.h>
20 #include <GA/GA_Edge.h>
21 #include <GA/GA_Breakpoint.h>
22 
23 class UT_Classifier;
24 class GA_Primitive;
25 class GA_Range;
26 class GA_PointGroup;
27 class GA_PrimitiveGroup;
28 class GA_EdgeGroup;
29 class GA_BreakpointGroup;
30 class GEO_Detail;
31 
32 namespace GU_Classify
33 {
34 
35  /// Classify primitives by shared point references, so two primitives will
36  /// be in the same class iff they both reference a common point.
37  ///
38  /// point_closure is optional
40  const GEO_Detail &gdp,
41  const GA_PrimitiveGroup *prim_group,
42  const GA_PointGroup *point_closure,
43  const UT_Map<GA_Offset, exint> &class_map,
44  UT_Classifier &prim_classifier);
45 
46  /// Partition a group of primitives (or all primitives if no group is given)
47  /// into a single array that groups all primitives classified to the same
48  /// class together. Both the classes and the member primitives in each are
49  /// in the order encountered by a standard traversal.
50  ///
51  /// The class_start_indices array is set to contain the start index into
52  /// the class_prims for each class, plus an extra entry containing the
53  /// number of entries of class_prims.
55  const GEO_Detail &gdp,
56  const GA_PrimitiveGroup *prim_group,
57  GA_OffsetArray &class_prims,
58  UT_ExintArray &class_start_indices);
59 
60  /// Classify points by shared primitive references, so two points will be
61  /// in the same class iff they are both referenced by a common primitive.
62  ///
63  /// candidate_prims is optional
65  const GEO_Detail &gdp,
66  const GA_PointGroup *point_group,
67  const GA_PrimitiveGroup *candidate_prims,
68  const UT_Map<GA_Offset, exint> &class_map,
69  UT_Classifier &point_classifier);
70 
71  /// Classify points by edge connectivity, so two points will be in the
72  /// same class iff they are connected by an edge.
73  ///
74  /// prim_closure is optional
76  const GEO_Detail &gdp,
77  const GA_PointGroup *point_group,
78  const GA_PrimitiveGroup *prim_closure,
79  const UT_Map<GA_Offset, exint> &class_map,
80  UT_Classifier &point_classifier);
81  /// Classify points by edge connectivity, so two points will be in the
82  /// same class iff they are connected by an edge.
83  ///
84  /// Class map is optional. If not present, the point indices are used.
86  const GEO_Detail &gdp,
87  const UT_Map<GA_Offset, exint> *class_map,
88  UT_Classifier &point_classifier);
89 
90  /// Partition a group of points (or all points if no group is given)
91  /// into a single array that groups all primitives classified to the same
92  /// class together. Both the classes and the member points in each are
93  /// in the order encountered by a standard traversal.
94  ///
95  /// The class_start_indices array is set to contain the start index into
96  /// the class_points for each class, plus an extra entry containing the
97  /// number of entries of class_points.
99  const GEO_Detail &gdp,
100  const GA_PointGroup *point_group,
101  const GA_PrimitiveGroup *prim_closure,
102  GA_OffsetArray &class_points,
103  UT_ExintArray &class_start_indices);
104 
105  /// Partition a group of edges into a single array that groups all edges
106  /// classified to the same class together. Both the classes and the member
107  /// edges in each are in the order encountered by a standard traversal.
108  ///
109  /// The class_start_indices array is set to contain the start index into
110  /// the class_edges for each class, plus an extra entry containing the
111  /// number of entries of class_edges.
113  const GEO_Detail &gdp,
114  const GA_EdgeGroup &edge_group,
115  UT_Array<GA_Edge> &class_edges,
116  UT_ExintArray &class_start_indices);
117 
118  /// Partition a group of breakpoints (or all breakpoints if no group is
119  /// given) into a single array that groups all breakpoints classified to
120  /// the same class together. Both the classes and the member breakpoints
121  /// in each are in the order encountered by a standard traversal.
122  ///
123  /// The class_start_indices array is set to contain the start index into
124  /// the class_bkpts for each class, plus an extra entry containing the
125  /// number of entries of class_bkpts.
127  const GEO_Detail &gdp,
128  const GA_BreakpointGroup *bkpt_group,
129  UT_Array<GA_Breakpoint> &class_bkpts,
130  UT_ExintArray &class_start_indices);
131 }
132 
133 #endif // __GU_Classify_h__
Unsorted map container.
Definition: UT_Map.h:83
GU_API void partitionBreakpointsBySpline(const GEO_Detail &gdp, const GA_BreakpointGroup *bkpt_group, UT_Array< GA_Breakpoint > &class_bkpts, UT_ExintArray &class_start_indices)
A range of elements in an index-map.
Definition: GA_Range.h:42
GU_API void partitionEdgesByConnectivity(const GEO_Detail &gdp, const GA_EdgeGroup &edge_group, UT_Array< GA_Edge > &class_edges, UT_ExintArray &class_start_indices)
#define GU_API
Definition: GU_API.h:14
GU_API void classifyPrimsBySharedPoints(const GEO_Detail &gdp, const GA_PrimitiveGroup *prim_group, const GA_PointGroup *point_closure, const UT_Map< GA_Offset, exint > &class_map, UT_Classifier &prim_classifier)
GU_API void partitionPointsByEdgeConnectivity(const GEO_Detail &gdp, const GA_PointGroup *point_group, const GA_PrimitiveGroup *prim_closure, GA_OffsetArray &class_points, UT_ExintArray &class_start_indices)
GU_API void classifyPointsByEdgeConnectivity(const GEO_Detail &gdp, const GA_PointGroup *point_group, const GA_PrimitiveGroup *prim_closure, const UT_Map< GA_Offset, exint > &class_map, UT_Classifier &point_classifier)
GU_API void partitionPrimsBySharedPoints(const GEO_Detail &gdp, const GA_PrimitiveGroup *prim_group, GA_OffsetArray &class_prims, UT_ExintArray &class_start_indices)
GU_API void classifyPointsBySharedPrims(const GEO_Detail &gdp, const GA_PointGroup *point_group, const GA_PrimitiveGroup *candidate_prims, const UT_Map< GA_Offset, exint > &class_map, UT_Classifier &point_classifier)