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  {
44  };
45 
47  {
49  const GA_Attribute *src_attrib, GA_Attribute *dest_attrib)
50  : myMergeMethod(merge_method)
51  , mySrcAttrib(src_attrib)
52  , myDestAttrib(dest_attrib)
53  {
54  }
55 
57  GA_Attribute *attrib)
58  : myMergeMethod(merge_method)
59  , mySrcAttrib(attrib)
60  , myDestAttrib(attrib)
61  {
62  }
63 
65  const GA_Attribute *src_attrib, GA_Attribute *dest_attrib,
66  const GA_Attribute *src_weight)
67  : myMergeMethod(merge_method)
68  , mySrcAttrib(src_attrib)
69  , myDestAttrib(dest_attrib)
70  , mySrcWeightAttrib(src_weight)
71  {
72  }
73 
77  // We probably need to add a weight attribute parameter here.
78  // Lets see how this is used first in SOP.
79  const GA_Attribute *mySrcWeightAttrib = nullptr;
80  };
81 
83  {
85  : myQGroup(nullptr)
86  , myTGroup(nullptr)
87  , myModifyBothQueryAndTarget(false)
88  , myConsolidate(false)
89  , myDeleteConsolidated(false)
90  , myOutputGroup(nullptr)
91  {}
92 
96 
99 
101 
104  };
105 
107  {
109  : CommonSnapParms()
110  , myAlgorithm(ALGORITHM_LOWEST_POINT)
111  , myUseMatchAttrib(false)
112  {
113  }
114 
116  {
118  ALGORITHM_CLOSEST_POINT
119  };
120 
122 
124 
127 
130 
137  float myMatchTol;
140  };
141 
143  {
145  : CommonSnapParms()
146  {}
147 
150  float myXLines;
151  float myYLines;
152  float myZLines;
153  float myXOff;
154  float myYOff;
155  float myZOff;
156  float myTol;
157  };
158 
160  {
162  : CommonSnapParms()
163  {}
164 
165  /// This gives indices of target elements to snap query elements to.
168  };
169 
170  /// Snaps together points in qgdp based on parameters in parms.
171  /// If tgdp is null, qgdp is used for both the query
172  /// points and target points.
173  GU_API void snapPoints(
174  GU_Detail &qgdp,
175  const GU_Detail *tgdp,
176  const PointSnapParms &parms);
177 
178  /// NOTE: myTGroup, myModifyBothQueryAndTarget, and myOutputAttribH are NOT
179  /// used by this.
180  GU_API void snapGrid(
181  GU_Detail &gdp,
182  const GridSnapParms &parms);
183 
184  /// Snaps query elements to the target elements specified by
185  /// parms.myTargetElemAttrib and parms.myTargetOwner.
186  GU_API void snapByAttrib(
187  GU_Detail &qgdp,
188  const GU_Detail *tgdp,
189  const AttribSnapParms &parms);
190 }
191 
192 #endif
GA_ROHandleF myQPscaleH
Definition: GU_Snap.h:128
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
AttributeMergeMethod myMergeMethod
Definition: GU_Snap.h:74
GU_API void snapByAttrib(GU_Detail &qgdp, const GU_Detail *tgdp, const AttribSnapParms &parms)
AttributeMergeData(AttributeMergeMethod merge_method, const GA_Attribute *src_attrib, GA_Attribute *dest_attrib, const GA_Attribute *src_weight)
Definition: GU_Snap.h:64
AttributeMergeData(AttributeMergeMethod merge_method, GA_Attribute *attrib)
Definition: GU_Snap.h:56
GA_ROHandleS myTMatchStrH
Definition: GU_Snap.h:136
GA_RWHandleV3 myQPosH
Definition: GU_Snap.h:125
const GA_Attribute * mySrcAttrib
Definition: GU_Snap.h:75
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:166
const GA_ElementGroup * myQGroup
Definition: GU_Snap.h:93
GA_ROHandleS myQMatchStrH
Definition: GU_Snap.h:135
GA_ROHandleI myTMatchIntH
Definition: GU_Snap.h:132
GU_API void snapGrid(GU_Detail &gdp, const GridSnapParms &parms)
bool myModifyBothQueryAndTarget
Definition: GU_Snap.h:95
GA_ROHandleI myQMatchIntH
Definition: GU_Snap.h:131
GA_RWHandleV3 myPosH
Definition: GU_Snap.h:148
UT_Array< AttributeMergeData > myMergeAttribs
Definition: GU_Snap.h:100
GA_ROHandleV3 myTPosH
Definition: GU_Snap.h:126
#define GU_API
Definition: GU_API.h:14
GA_ROHandleF myTMatchFltH
Definition: GU_Snap.h:134
GA_ROHandleF myTPscaleH
Definition: GU_Snap.h:129
AttributeMergeMethod
Definition: GU_Snap.h:26
GA_RWHandleID myOutputAttribH
Definition: GU_Snap.h:103
GA_AttributeOwner
Definition: GA_Types.h:34
AttributeMergeData(AttributeMergeMethod merge_method, const GA_Attribute *src_attrib, GA_Attribute *dest_attrib)
Definition: GU_Snap.h:48
fpreal64 fpreal
Definition: SYS_Types.h:277
GA_ROHandleF myQMatchFltH
Definition: GU_Snap.h:133
GA_AttributeOwner myTargetOwner
Definition: GU_Snap.h:167
SnapAlgorithm myAlgorithm
Definition: GU_Snap.h:123
GA_ElementGroup * myOutputGroup
Definition: GU_Snap.h:102
const GA_ElementGroup * myTGroup
Definition: GU_Snap.h:94
GA_Attribute * myDestAttrib
Definition: GU_Snap.h:76