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