00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Jeff Lait 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: Polygonal reduction tool (C++) 00015 * 00016 * COMMENTS: 00017 */ 00018 00019 #ifndef __GU_PolyReduce_h__ 00020 #define __GU_PolyReduce_h__ 00021 00022 #include "GU_API.h" 00023 class GB_EdgeGroup; 00024 00025 // Description of a single edge collapse 00026 class GU_API GU_EdgeCollapseNode 00027 { 00028 public: 00029 int myIv1, myIv2; // Source indices to reduce. 00030 int myNewIv; // Resulting index. 00031 int myDegenTri; // Tris removed 00032 UT_Vector3 myV; // Resulting position. 00033 int myNewPt; // New point number 00034 00035 private: 00036 friend class GU_EdgeCollapseList; 00037 GU_EdgeCollapseNode *myNext, *myPrev; 00038 }; 00039 00040 // A list of edge collapses: 00041 class GU_API GU_EdgeCollapseList 00042 { 00043 public: 00044 GU_EdgeCollapseList() { myHead = 0; myTail = 0; } 00045 ~GU_EdgeCollapseList(); 00046 00047 GU_EdgeCollapseNode *next(GU_EdgeCollapseNode *node); 00048 void remove(GU_EdgeCollapseNode *node); 00049 void append(GU_EdgeCollapseNode *node); 00050 int empty() const { return myHead ? 0 : 1; } 00051 GU_EdgeCollapseNode *first() const { return myHead; } 00052 00053 private: 00054 GU_EdgeCollapseNode *myHead, *myTail; 00055 }; 00056 00057 class GU_API GU_PolyReduceParms 00058 { 00059 public: 00060 GU_PolyReduceParms(); 00061 ~GU_PolyReduceParms(); 00062 00063 int numpolys; // Number of polys to reduce to. 00064 float percentage; // Percentage to reduce 00065 int usepercent; // Which method to use. 00066 bool useedgelimit; // Constrain number of edges to collapse 00067 int numedgecollapse;// Max edges to collapse. 00068 int meshinvert; // Test for mesh inversion? 00069 float optimization; // 1 for optimized point positions 00070 // 0 for just mid points 00071 float borderweight; // Weighting to add to border planes 00072 float lengthweight; // Weighting to add to the length of sides 00073 int keepedges; // Never collapse the edges 00074 int snap; // Snap to existing vertices 00075 00076 // Feature edgse: 00077 GEO_Detail *gdpf; // Detail containing feature edges 00078 const GB_EdgeGroup *features; // Feature edges 00079 const GB_EdgeGroup *forcecollapse; // Edges to collapse. 00080 float featureweight; // The weight thereof 00081 00082 int altergeo; // Do we change the geometry at all? 00083 00084 GU_EdgeCollapseList *edgelist; // Where we accumulate all ecols. 00085 int uniquevertex; // Number unique vertex 00086 int initialtris; // Number stris started with 00087 00088 float attribweight; // Importance of the weight attribute. 00089 float topologicalweight; // Penalty factor for high valences. 00090 }; 00091 00092 00093 #endif 00094 00095
1.5.9