HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_TriDivide.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_TriDivide.h ( GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_TriDivide__
12 #define __GU_TriDivide__
13 
14 #include "GU_API.h"
15 #include <GA/GA_Edge.h>
16 #include <GA/GA_EdgeMap.h>
17 
18 class GA_PrimitiveGroup;
19 class guDivTri;
20 
21 // using TriEdgeMap = GA_EdgeMap<guDivTri *>;
22 #include <UT/UT_Map.h>
24 
26 {
27 public:
28  GU_TriDivide(GU_Detail *gdp);
29 
30  virtual ~GU_TriDivide();
31 
32  void setDetail(GU_Detail *gdp) { myGdp = gdp; }
33  GU_Detail *getDetail() const { return myGdp; }
34 
35  void setRefDetail(const GU_Detail *refgdp) { myRefGdp = refgdp; }
36  const GU_Detail *getRefDetail() const { return myRefGdp; }
37 
38  /// Builds the triangle list.
39  void buildTopology(const GA_PrimitiveGroup *grp=0);
40 
41  /// Does root(3) subdivision.
42  void tridivide(int depth);
43 
44  /// Equalizes edges by splitting the longest edges.
45  /// Splits are done until minimum length is less than minlength
46  /// or number of splits numsplits has been done. A value of -1
47  /// is ignored.
48  void equalizeEdges(fpreal minlength, int numsplit);
49 
50  /// Transforms the triangle list into actual triangles.
51  void buildGeometry();
52 
53  /// Technically should be friended to our guDivTri.
54  guDivTri *allocTri();
55 
56 protected:
57  void buildTri(GEO_PrimPoly *poly, TriEdgeMap &edgemap);
58 
59  fpreal calculateLength(GA_Index aidx, GA_Index bidx,
60  bool useref,
61  const UT_Vector3Array &refpos) const;
62 
63 protected:
67 };
68 
69 #endif
70 
void setDetail(GU_Detail *gdp)
Definition: GU_TriDivide.h:32
Unsorted map container.
Definition: UT_Map.h:83
void setRefDetail(const GU_Detail *refgdp)
Definition: GU_TriDivide.h:35
const GU_Detail * getRefDetail() const
Definition: GU_TriDivide.h:36
GU_Detail * myGdp
Definition: GU_TriDivide.h:64
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glcorearb.h:475
UT_Array< guDivTri * > myTriList
Definition: GU_TriDivide.h:66
const GU_Detail * myRefGdp
Definition: GU_TriDivide.h:65
#define GU_API
Definition: GU_API.h:12
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:611
double fpreal
Definition: SYS_Types.h:270
GU_Detail * getDetail() const
Definition: GU_TriDivide.h:33