HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PolyReduce.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: Polygonal reduction tool (C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_PolyReduce_h__
12 #define __GU_PolyReduce_h__
13 
14 #include "GU_API.h"
15 #include <UT/UT_Vector3.h>
16 class GA_EdgeGroup;
17 class GEO_Detail;
18 
19 // Description of a single edge collapse
21 {
22 public:
23  int myIv1, myIv2; // Source indices to reduce.
24  int myNewIv; // Resulting index.
25  int myDegenTri; // Tris removed
26  UT_Vector3 myV; // Resulting position.
27  int myNewPt; // New point number
28 
29 private:
30  friend class GU_EdgeCollapseList;
31  GU_EdgeCollapseNode *myNext, *myPrev;
32 };
33 
34 // A list of edge collapses:
36 {
37 public:
38  GU_EdgeCollapseList() { myHead = 0; myTail = 0; }
40 
42  void remove(GU_EdgeCollapseNode *node);
43  void append(GU_EdgeCollapseNode *node);
44  int empty() const { return myHead ? 0 : 1; }
45  GU_EdgeCollapseNode *first() const { return myHead; }
46 
47 private:
48  GU_EdgeCollapseNode *myHead, *myTail;
49 };
50 
52 {
53 public:
56 
57  int numpolys; // Number of polys to reduce to.
58  float percentage; // Percentage to reduce
59  int usepercent; // Which method to use.
60  bool useedgelimit; // Constrain number of edges to collapse
61  int numedgecollapse;// Max edges to collapse.
62  int meshinvert; // Test for mesh inversion?
63  float optimization; // 1 for optimized point positions
64  // 0 for just mid points
65  float borderweight; // Weighting to add to border planes
66  float lengthweight; // Weighting to add to the length of sides
67  int keepedges; // Never collapse the edges
68  int snap; // Snap to existing vertices
69 
70  // Feature edgse:
71  GEO_Detail *gdpf; // Detail containing feature edges
72  const GA_EdgeGroup *features; // Feature edges
73  const GA_EdgeGroup *forcecollapse; // Edges to collapse.
74  float featureweight; // The weight thereof
75 
76  int altergeo; // Do we change the geometry at all?
77 
78  GU_EdgeCollapseList *edgelist; // Where we accumulate all ecols.
79  int uniquevertex; // Number unique vertex
80  int initialtris; // Number stris started with
81 
82  float attribweight; // Importance of the weight attribute.
83  float topologicalweight; // Penalty factor for high valences.
84 };
85 
86 
87 #endif
88 
89 
const GA_EdgeGroup * features
Definition: GU_PolyReduce.h:72
GU_EdgeCollapseList * edgelist
Definition: GU_PolyReduce.h:78
const GA_EdgeGroup * forcecollapse
Definition: GU_PolyReduce.h:73
#define GU_API
Definition: GU_API.h:12
int empty() const
Definition: GU_PolyReduce.h:44
GU_EdgeCollapseNode * first() const
Definition: GU_PolyReduce.h:45
GEO_Detail * gdpf
Definition: GU_PolyReduce.h:71