Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CatmullClark.h

Go to the documentation of this file.
00001 #ifndef __CATMULLCLARK_H
00002 #define __CATMULLCLARK_H
00003 
00004 #include "Subdiv.h"
00005 
00006 #include "meshBase.h"
00007 
00008 class CatmullClarkSubdivision : public Subdivision
00009 {
00010 private:
00011         void divideFace(indexFace *face);
00012 
00013         void divideEdge(indexEdge  *edge, 
00014                                         indexFace  *face);
00015 
00016         void buildVertex(indexVertex *vertex);
00017 
00018         void subdivide(U32 base_group);
00019 
00020 public:
00021         virtual void compute(int n);    // subdivide the base mesh n times
00022 
00023         virtual int matrix(int *n, double *s);
00024                                                                                 // computes the subdivision matrix for
00025                                                                                 // a vertex of valence n. Returns the
00026                                                                                 // # of rows (columns) of the resulting
00027                                                                                 // square subdivision matrix. For dual
00028                                                                                 // subdivs, like Doo-Sabin, n may be an array
00029                                                                                 // of the number of sides of the faces sharing
00030                                                                                 // the vertex.
00031 
00032 };
00033 
00034 #endif // __CATMULLCLARK_H
00035 
00036 
00037 
00038 
00039 /*#include "Surface.h"
00040 
00041 class Subdivision : public Surface {
00042         virtual void compute(int n) = 0;        // subdivide the base mesh n times
00043 
00044         virtual int matrix(int *n, double *s) = 0;
00045                                                                                 // computes the subdivision matrix for
00046                                                                                 // a vertex of valence n. Returns the
00047                                                                                 // # of rows (columns) of the resulting
00048                                                                                 // square subdivision matrix. For dual
00049                                                                                 // subdivs, like Doo-Sabin, n may be an array
00050                                                                                 // of the number of sides of the faces sharing
00051                                                                                 // the vertex.
00052 };
00053 
00054 
00055 */
00056 
00057 /*
00058 int ImpList::Insert (Implicit *f)
00059 {
00060         Box interval;
00061 
00062         ImpElement  *ielem;
00063         ImpReferent *impindex = new ImpReferent;
00064 
00065         index.push_back (impindex);
00066 
00067         for (unsigned int i = 0; i < vtotal; i++)
00068         {
00069                 interval = map (i);
00070 
00071                 if (fabs (f->proc (interval.center ())) > 
00072                                  (f->lip  (interval) * gridrad))
00073                 {
00074                         index[instotal]->push_back (i);
00075 
00076                         ielem = new ImpElement;
00077                         ielem->id  = instotal;
00078                         ielem->imp = f;
00079 
00080                         grid[i].push_back (ielem);
00081                 }
00082         }
00083         instotal++;
00084         imptotal++;
00085 
00086         return (instotal - 1);
00087 }*/

Generated on Mon Jun 28 14:58:13 2004 for Advanced Surface Library by doxygen 1.3.4