HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Snap.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_Snap.h ( GU Library, C++)
7 *
8 * COMMENTS: These routines allow you to snap points together without
9 * fusing them.
10 */
11 
12 #ifndef __GU_Snap_h__
13 #define __GU_Snap_h__
14 
15 #include "GU_API.h"
16 #include <GA/GA_Handle.h>
17 #include <GA/GA_Types.h>
18 #include <UT/UT_Array.h>
19 #include <SYS/SYS_Types.h>
20 
21 class GA_Attribute;
22 class GU_Detail;
23 
24 namespace GU_Snap
25 {
27  {
38  };
39 
41  {
43  const GA_Attribute *src_attrib, GA_Attribute *dest_attrib)
44  : myMergeMethod(merge_method)
45  , mySrcAttrib(src_attrib)
46  , myDestAttrib(dest_attrib)
47  {
48  }
49 
51  GA_Attribute *attrib)
52  : myMergeMethod(merge_method)
53  , mySrcAttrib(attrib)
54  , myDestAttrib(attrib)
55  {
56  }
57 
61  };
62 
64  {
66  : myQGroup(nullptr)
67  , myTGroup(nullptr)
68  , myModifyBothQueryAndTarget(false)
69  , myConsolidate(false)
70  , myDeleteConsolidated(false)
71  , myOutputGroup(nullptr)
72  {}
73 
77 
80 
82 
85  };
86 
88  {
90  : CommonSnapParms()
91  , myAlgorithm(ALGORITHM_LOWEST_POINT)
92  , myUseMatchAttrib(false)
93  {
94  }
95 
97  {
99  ALGORITHM_CLOSEST_POINT
100  };
101 
103 
105 
108 
111 
118  float myMatchTol;
121  };
122 
124  {
126  : CommonSnapParms()
127  {}
128 
131  float myXLines;
132  float myYLines;
133  float myZLines;
134  float myXOff;
135  float myYOff;
136  float myZOff;
137  float myTol;
138  };
139 
141  {
143  : CommonSnapParms()
144  {}
145 
146  /// This gives indices of target elements to snap query elements to.
149  };
150 
151  /// Snaps together points in qgdp based on parameters in parms.
152  /// If tgdp is null, qgdp is used for both the query
153  /// points and target points.
154  GU_API void snapPoints(
155  GU_Detail &qgdp,
156  const GU_Detail *tgdp,
157  const PointSnapParms &parms);
158 
159  /// NOTE: myTGroup, myModifyBothQueryAndTarget, and myOutputAttribH are NOT
160  /// used by this.
161  GU_API void snapGrid(
162  GU_Detail &gdp,
163  const GridSnapParms &parms);
164 
165  /// Snaps query elements to the target elements specified by
166  /// parms.myTargetElemAttrib and parms.myTargetOwner.
167  GU_API void snapByAttrib(
168  GU_Detail &qgdp,
169  const GU_Detail *tgdp,
170  const AttribSnapParms &parms);
171 }
172 
173 #endif
GA_ROHandleF myQPscaleH
Definition: GU_Snap.h:109
Definition of a geometry attribute.
Definition: GA_Attribute.h:196
AttributeMergeMethod myMergeMethod
Definition: GU_Snap.h:58
GU_API void snapByAttrib(GU_Detail &qgdp, const GU_Detail *tgdp, const AttribSnapParms &parms)
AttributeMergeData(AttributeMergeMethod merge_method, GA_Attribute *attrib)
Definition: GU_Snap.h:50
GA_ROHandleS myTMatchStrH
Definition: GU_Snap.h:117
GA_RWHandleV3 myQPosH
Definition: GU_Snap.h:106
const GA_Attribute * mySrcAttrib
Definition: GU_Snap.h:59
GU_API void snapPoints(GU_Detail &qgdp, const GU_Detail *tgdp, const PointSnapParms &parms)
GA_ROHandleID myTargetElemAttrib
This gives indices of target elements to snap query elements to.
Definition: GU_Snap.h:147
const GA_ElementGroup * myQGroup
Definition: GU_Snap.h:74
GA_ROHandleS myQMatchStrH
Definition: GU_Snap.h:116
GA_ROHandleI myTMatchIntH
Definition: GU_Snap.h:113
GU_API void snapGrid(GU_Detail &gdp, const GridSnapParms &parms)
bool myModifyBothQueryAndTarget
Definition: GU_Snap.h:76
GA_ROHandleI myQMatchIntH
Definition: GU_Snap.h:112
GA_RWHandleV3 myPosH
Definition: GU_Snap.h:129
UT_Array< AttributeMergeData > myMergeAttribs
Definition: GU_Snap.h:81
GA_ROHandleV3 myTPosH
Definition: GU_Snap.h:107
#define GU_API
Definition: GU_API.h:14
GA_ROHandleF myTMatchFltH
Definition: GU_Snap.h:115
GA_ROHandleF myTPscaleH
Definition: GU_Snap.h:110
AttributeMergeMethod
Definition: GU_Snap.h:26
GA_RWHandleID myOutputAttribH
Definition: GU_Snap.h:84
GA_AttributeOwner
Definition: GA_Types.h:33
AttributeMergeData(AttributeMergeMethod merge_method, const GA_Attribute *src_attrib, GA_Attribute *dest_attrib)
Definition: GU_Snap.h:42
fpreal64 fpreal
Definition: SYS_Types.h:277
GA_ROHandleF myQMatchFltH
Definition: GU_Snap.h:114
GA_AttributeOwner myTargetOwner
Definition: GU_Snap.h:148
SnapAlgorithm myAlgorithm
Definition: GU_Snap.h:104
GA_ElementGroup * myOutputGroup
Definition: GU_Snap.h:83
const GA_ElementGroup * myTGroup
Definition: GU_Snap.h:75
GA_Attribute * myDestAttrib
Definition: GU_Snap.h:60