HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Sweep.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: Geometry Utility Library (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __GU_Sweep_h__
13 #define __GU_Sweep_h__
14 
15 #include "GU_API.h"
16 #include "GU_Error.h"
17 #include "GU_Types.h"
19 #include <GA/GA_ElementGroup.h>
20 #include <GA/GA_Types.h>
21 #include <UT/UT_Array.h>
22 #include <UT/UT_Matrix3.h>
23 
25 
26 class UT_Interrupt;
27 class GA_PointGroup;
28 class GA_PrimitiveGroup;
29 class GEO_PrimPoly;
30 class GU_Detail;
31 
33 {
38 };
39 
41 {
47 };
48 
49 typedef float (*GU_SweepCallBack)(void *data, GA_Index pathindex,
50  int vertexNumber, int numberOfVertices);
51 
53 {
54 public:
55  GU_SweepParms();
57 
58  void reset();
59  GU_ERROR doIt( GU_Detail *gdp );
60 
62  const GU_Detail *paths; // the backbone rails
63  const GU_Detail *refpaths; // the orientation reference paths
64  const GU_Detail *xSection; // the cross-section
66  GU_SweepFixType fixType; // fix type
67  int skipCoin; // skip coincident points
68  int aimAtRef; // Aim at points reference path.
69  int useVertex; // use vertex to attach to
70  int vertexNumber; // vertex to attach to
71  float scale; // scale
72  float twist; // twist
73  float roll; // roll
74  int outputGroups; // output sweep groups switch
75  GU_SweepSkinType skinType; // convert output to meshes
76  int outputPolys; // Convert output mesh to poly
77  char *sweepGrpName; // sweep groups prefix name
78  const GA_PrimitiveGroup *pathGroup; // optional rail group
79  const GA_PrimitiveGroup *refGroup; // optional ref. group
80  const GA_PrimitiveGroup *xGroup; // optional xsec group
81 
82  /// Set useInstanceMatrix to true and initialize instanceMatrix
83  /// in order to use the backbone's
84  /// N, up, trans, pscale, scale, rot, orient, pivot to determine
85  /// how to transform cross-sections, instead of the scale, twist,
86  /// and roll values above.
87  /// @{
90  /// @}
91  GU_SweepCallBack getTwist; // way of computing twist
92  GU_SweepCallBack getScale; // and scale
93  GU_SweepCallBack getRoll; // and roll during sweep
94  void *callbackData;
95 
96  /// Pattern for selecting which attributes to transfer from path
97  /// to cross-sections.
98  const char *myAttribPattern;
99 
100 private:
101 
102  GU_ERROR sweepPaths(GU_Detail* dest,
103  const GA_PrimitiveGroup *tgroup,
104  GA_PrimitiveGroupUPtr &onePrimGroup,
105  bool use_template,
106  GA_Index &template_startpt,
107  UT_Interrupt *boss, int &stop);
108 
109  GU_ERROR sweep(const GEO_PrimPoly &path,
110  const GEO_PrimPoly *refpath,
111  const GA_PrimitiveGroup *tGroup,
112  GA_PrimitiveGroupUPtr &onePrimGroup,
113  GU_Detail &dest,
114  bool use_template, GA_Index &template_startpt,
115  UT_Interrupt *boss, int &stop);
116 
117  bool calculateRotations(
118  const GEO_PrimPoly &path,
119  const GEO_PrimPoly *refPoly,
120  GA_Size numPathVertices,
121  UT_Matrix3 &rotOrigin,
122  UT_Vector3 &tEnd,
123  float *&refRollArray,
124  bool *&sweepOk);
125 
126  utMatrixArray dihedralArray;
127  utMatrixArray stretchArray;
128  utMatrixArray refTiltArray;
129 
130  int angleFlag;
131  int cycleAll;
132  int cycleOne;
133  int noFlip;
134  int sweepGroupCount;
135 
136  GA_PrimitiveGroup *dest_skingroup;
137  GA_PrimitiveGroup *dest_delgroup;
138 };
139 
140 #endif
const char * myAttribPattern
Definition: GU_Sweep.h:98
const GU_Detail * paths
Definition: GU_Sweep.h:62
UT_Array< UT_Matrix3 > utMatrixArray
Definition: GU_Sweep.h:24
int outputGroups
Definition: GU_Sweep.h:74
const GU_Detail * xSection
Definition: GU_Sweep.h:64
GU_CrossSectionType cycleType
Definition: GU_Sweep.h:65
GLboolean * data
Definition: glcorearb.h:131
char * sweepGrpName
Definition: GU_Sweep.h:77
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int vertexNumber
Definition: GU_Sweep.h:70
float roll
Definition: GU_Sweep.h:73
UT_ErrorSeverity
Definition: UT_Error.h:25
GU_SweepFixType fixType
Definition: GU_Sweep.h:66
const GA_PrimitiveGroup * refGroup
Definition: GU_Sweep.h:79
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:235
float(* GU_SweepCallBack)(void *data, GA_Index pathindex, int vertexNumber, int numberOfVertices)
Definition: GU_Sweep.h:49
void * callbackData
Definition: GU_Sweep.h:94
float scale
Definition: GU_Sweep.h:71
GLboolean reset
Definition: glad.h:5138
const GU_Detail * refpaths
Definition: GU_Sweep.h:63
GU_SweepCallBack getTwist
Definition: GU_Sweep.h:91
int aimAtRef
Definition: GU_Sweep.h:68
~GU_SweepParms()
Definition: GU_Sweep.h:56
GU_SweepFixType
Definition: GU_Sweep.h:32
GU_Detail * templateGdp
Definition: GU_Sweep.h:61
UT_UniquePtr< GA_PrimitiveGroup > GA_PrimitiveGroupUPtr
GU_SweepCallBack getScale
Definition: GU_Sweep.h:92
GU_SweepSkinType
Definition: GU_Sweep.h:40
#define GU_API
Definition: GU_API.h:14
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:635
GA_AttributeInstanceMatrix instanceMatrix
Definition: GU_Sweep.h:89
GU_SweepSkinType skinType
Definition: GU_Sweep.h:75
bool useInstanceMatrix
Definition: GU_Sweep.h:88
GU_CrossSectionType
Definition: GU_Types.h:49
Compute an instance transform given a set of attributes.
int skipCoin
Definition: GU_Sweep.h:67
int useVertex
Definition: GU_Sweep.h:69
int outputPolys
Definition: GU_Sweep.h:76
GU_SweepCallBack getRoll
Definition: GU_Sweep.h:93
float twist
Definition: GU_Sweep.h:72
const GA_PrimitiveGroup * pathGroup
Definition: GU_Sweep.h:78
const GA_PrimitiveGroup * xGroup
Definition: GU_Sweep.h:80