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