HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GQ_PolyBevel.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: GQ_PolyBevel.h ( GQ Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GQ_PolyBevel_h__
12 #define __GQ_PolyBevel_h__
13 
14 #include "GQ_API.h"
15 #include "GQ_Detail.h"
17 #include <GA/GA_AttributeRefMap.h>
18 #include <UT/UT_Map.h>
19 
21 {
22 public:
30 };
31 
33 
35 {
36 public:
37  GQ_PolyBevel(GU_Detail *gdp, GA_VertexPool &pool, int relative,
38  float inset, int type, int repetitions);
39  ~GQ_PolyBevel();
40 
41  GA_PrimitiveGroup *pointBevel(GA_PointGroup *pointgroup);
42  GA_PrimitiveGroup *edgeBevel(GA_EdgeGroup *edgegroup);
43 
44 protected:
45  void smoothBevel();
46 
47  // in GQ_BevelPoints.C:
48  void bevelPoints();
49  void cornerBevelPoints();
50 
51  // in GQ_BevelEdges.C:
52  void bevelEdges();
53 
54  // in GQ_SmoothBevel.C:
55  void smoothBevelEdges();
56  void smoothBevelPoints();
57 
58 
59 private:
60  class GQ_API gq_BevelPointNode
61  {
62  public:
63  GEO_PrimPoly *myPoly;
64  GEO_Vertex *myVertex;
65  };
66 
67  // in GQ_BevelPoints.C:
68  void findBevelPoint(GA_Offset, float, GQ_Edge *,
69  GA_Offset &, bool &);
70  void addCornerPoints(GA_Offset, GA_Offset,
72  <GA_Offset> &, GEO_PrimPoly *);
73 
74  // in GQ_BevelEdges.C:
75  void selectBevelPoints(GA_PointGroup *&);
76  void findEdgePoint(GA_Offset, GQ_Edge *,
78  GA_Offset&, GA_Offset, bool &);
79  void findBeforePoint(GA_Offset, GQ_Edge *,
81  GA_Offset &);
82  void findAfterPoint(GA_Offset, GQ_Edge *,
84  GA_Offset &, GA_Offset);
85  void startBevelFace(GQ_Edge *, UT_Array<GQ_Face *>&,
87  void finishBevelFace(GQ_Edge *, UT_Array<GQ_Face *>&,
89  GEO_PrimPoly *createMidPoly(GA_Index, const UT_Array<GA_Offset> &);
90 
91  // in GQ_Smoothbevel.C:
92  void addPerimeter(GQ_Face *,
94  const GEO_Vertex &);
95  void addMajorDivisions(GQ_Face *,
96  const UT_Array<GA_Offset> &,
98  const GEO_Vertex &);
99  void findMajorPoints(const UT_Vector3 &, float borderw,
100  UT_Array<GA_Offset> &, const UT_Vector3 &,
101  const UT_Plane &, const UT_Vector3 &,
102  const GEO_Vertex &, GQ_Edge *);
103  void addMinorDivisions(GQ_Face *,
104  const UT_Array<GA_Offset> &,
105  const UT_Array<GA_Offset> &,
106  const UT_Vector3 &, const GEO_Vertex &);
107  void addFillPolys(GQ_Face *face, const
108  UT_Array<GA_Offset> &, const
110  void addPatchPolys(GQ_Face *face,
111  const UT_Array<GA_Offset> &);
112  void addCornerPolys(const UT_Array<GQ_Face *> &,
114  void addEdgePolys(const UT_Array<GQ_Face *> &,
117  UT_Array<GA_Offset> addEdgePoints(GQ_Edge *,
118  const UT_Vector3 &, const UT_Vector3 &,
119  const UT_Vector3 &);
120  GEO_PrimPoly *addTriangle(GA_Offset, GA_Offset, GA_Offset,
121  GEO_PrimPoly *);
122  GEO_PrimPoly *addRectangle(GA_Offset, GA_Offset, GA_Offset,
124 
125  gq_BevelPointNode *getOldPoint(exint &index);
126 
128 
129  GU_Detail *myGdp;
130  GQ_Detail *myGqd;
131  int myRepetitions;
132  float myInset;
133  int myType;
134  bool myRelative;
135  GA_PrimitiveGroup *myOutput;
136  GA_PointGroup *myPointGroup;
137  GA_EdgeGroup *myEdgeGroup;
138  UT_Array<gq_BevelEdgeNode> myBevelList;
139  UT_Array<gq_BevelPointNode *> myOldPoints;
140  GEO_WorkVertexBuffer myVertexBuffer;
141  PolyMap *myBevelTable;
142  PolyMap *myPointTable;
143  GA_PrimitiveGroup *myNewOutput;
144  UT_Array<GA_Offset> myAddedPoints;
145  UT_Array<GA_Offset> myAddedPointsonFace;
146 };
147 
149 
150 #endif
#define GQ_API
Definition: GQ_API.h:10
Unsorted map container.
Definition: UT_Map.h:107
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:623
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
GA_Offset myPt2
Definition: GQ_PolyBevel.h:25
int64 exint
Definition: SYS_Types.h:125
Manages allocation/deletion of temporary vertex/points for a detail.
Definition: GA_VertexPool.h:35
GA_Size GA_Offset
Definition: GA_Types.h:646
UT_Vector3 myCorner2
Definition: GQ_PolyBevel.h:29
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:640
GEO_PrimPoly * myPoly
Definition: GQ_PolyBevel.h:23
GLuint index
Definition: glcorearb.h:786
UT_Vector3 myDir1
Definition: GQ_PolyBevel.h:26
UT_Vector3 myCorner1
Definition: GQ_PolyBevel.h:28
type
Definition: core.h:1059
GA_Offset myPt1
Definition: GQ_PolyBevel.h:24
**Note that the tasks the is the thread number *for the pool
Definition: thread.h:637
UT_Vector3 myDir2
Definition: GQ_PolyBevel.h:27