HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_ExtractTransform.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  */
7 
8 #ifndef __GU_ExtractTransform_h__
9 #define __GU_ExtractTransform_h__
10 
11 #include "GU_API.h"
12 
13 #include <UT/UT_Quaternion.h>
14 #include <UT/UT_Vector3.h>
15 #include <UT/UT_VectorTypes.h>
16 
17 class GA_Range;
18 class GU_Detail;
19 
20 namespace GU_ExtractTransform
21 {
22 /// Specifies whether to only compute the best-fit rigid transform, allow
23 /// for a (non-)uniform scale, or just compute the full best-fit transform.
24 enum class Method
25 {
26  Rigid,
29  Full
30 };
31 
32 struct GU_API Result
33 {
34  UT_Matrix4D getXform() const;
35 
36  UT_Vector3D myPivot = {0, 0, 0};
37  UT_Vector3D myPosition = {0, 0, 0};
38  UT_QuaternionD myRotate = {0, 0, 0, 1};
39  UT_Vector3D myScale = {1, 1, 1};
40  UT_Vector3D myShear = {0, 0, 0};
41  fpreal myDistortion = 0;
42 };
43 
44 /// Computes the best-fit transform that aligns the reference geometry (A)
45 /// points with the target geometry (B) points.
46 GU_API void solve(const GU_Detail &gdp_a,
47  const GA_Range &pts_a,
48  const GU_Detail &gdp_b,
49  const GA_Range &pts_b,
50  Method method,
51  bool compute_distortion,
52  Result &result);
53 }
54 
55 #endif
A range of elements in an index-map.
Definition: GA_Range.h:42
GLuint64EXT * result
Definition: glew.h:14311
#define GU_API
Definition: GU_API.h:14
fpreal64 fpreal
Definition: SYS_Types.h:277
GU_API void solve(const GU_Detail &gdp_a, const GA_Range &pts_a, const GU_Detail &gdp_b, const GA_Range &pts_b, Method method, bool compute_distortion, Result &result)