Blender V2.61 - r43446

CCGSubSurf.h

Go to the documentation of this file.
00001 
00006 typedef void* CCGMeshHDL;
00007 typedef void* CCGVertHDL;
00008 typedef void* CCGEdgeHDL;
00009 typedef void* CCGFaceHDL;
00010 
00011 typedef struct _CCGVert CCGVert;
00012 typedef struct _CCGEdge CCGEdge;
00013 typedef struct _CCGFace CCGFace;
00014 
00015 typedef struct _CCGMeshIFC CCGMeshIFC;
00016 struct _CCGMeshIFC {
00017     int         vertUserSize, edgeUserSize, faceUserSize;
00018 
00019     int         vertDataSize;
00020 };
00021 
00022 /***/
00023 
00024 typedef void* CCGAllocatorHDL;
00025 
00026 typedef struct _CCGAllocatorIFC CCGAllocatorIFC;
00027 struct _CCGAllocatorIFC {
00028     void*       (*alloc)            (CCGAllocatorHDL a, int numBytes);
00029     void*       (*realloc)          (CCGAllocatorHDL a, void *ptr, int newSize, int oldSize);
00030     void        (*free)             (CCGAllocatorHDL a, void *ptr);
00031     void        (*release)          (CCGAllocatorHDL a);
00032 };
00033 
00034 /***/
00035 
00036 typedef enum {
00037     eCCGError_None = 0,
00038 
00039     eCCGError_InvalidSyncState,
00040     eCCGError_InvalidValue,
00041 } CCGError;
00042 
00043 /***/
00044 
00045 #define CCG_OMP_LIMIT   1000000
00046 
00047 /***/
00048 
00049 typedef struct _CCGSubSurf CCGSubSurf;
00050 
00051 CCGSubSurf* ccgSubSurf_new  (CCGMeshIFC *ifc, int subdivisionLevels, CCGAllocatorIFC *allocatorIFC, CCGAllocatorHDL allocator);
00052 void        ccgSubSurf_free (CCGSubSurf *ss);
00053 
00054 CCGError    ccgSubSurf_sync (CCGSubSurf *ss);
00055 
00056 CCGError    ccgSubSurf_initFullSync     (CCGSubSurf *ss);
00057 CCGError    ccgSubSurf_initPartialSync  (CCGSubSurf *ss);
00058 
00059 CCGError    ccgSubSurf_syncVert     (CCGSubSurf *ss, CCGVertHDL vHDL, const void *vertData, int seam, CCGVert **v_r);
00060 CCGError    ccgSubSurf_syncEdge     (CCGSubSurf *ss, CCGEdgeHDL eHDL, CCGVertHDL e_vHDL0, CCGVertHDL e_vHDL1, float crease, CCGEdge **e_r);
00061 CCGError    ccgSubSurf_syncFace     (CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGVertHDL *vHDLs, CCGFace **f_r);
00062 
00063 CCGError    ccgSubSurf_syncVertDel  (CCGSubSurf *ss, CCGVertHDL vHDL);
00064 CCGError    ccgSubSurf_syncEdgeDel  (CCGSubSurf *ss, CCGEdgeHDL eHDL);
00065 CCGError    ccgSubSurf_syncFaceDel  (CCGSubSurf *ss, CCGFaceHDL fHDL);
00066 
00067 CCGError    ccgSubSurf_processSync  (CCGSubSurf *ss);
00068 
00069 CCGError    ccgSubSurf_updateFromFaces(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces);
00070 CCGError    ccgSubSurf_updateToFaces(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces);
00071 CCGError    ccgSubSurf_updateNormals(CCGSubSurf *ss, CCGFace **faces, int numFaces);
00072 CCGError    ccgSubSurf_updateLevels(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces);
00073 CCGError    ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces);
00074 
00075 CCGError    ccgSubSurf_setSubdivisionLevels     (CCGSubSurf *ss, int subdivisionLevels);
00076 
00077 CCGError    ccgSubSurf_setAllowEdgeCreation     (CCGSubSurf *ss, int allowEdgeCreation, float defaultCreaseValue, void *defaultUserData);
00078 void        ccgSubSurf_getAllowEdgeCreation     (CCGSubSurf *ss, int *allowEdgeCreation_r, float *defaultCreaseValue_r, void *defaultUserData_r);
00079 
00080 void        ccgSubSurf_getUseAgeCounts          (CCGSubSurf *ss, int *useAgeCounts_r, int *vertUserOffset_r, int *edgeUserOffset_r, int *faceUserOffset_r);
00081 CCGError    ccgSubSurf_setUseAgeCounts          (CCGSubSurf *ss, int useAgeCounts, int vertUserOffset, int edgeUserOffset, int faceUserOffset);
00082 
00083 CCGError    ccgSubSurf_setCalcVertexNormals     (CCGSubSurf *ss, int useVertNormals, int normalDataOffset);
00084 
00085 /***/
00086 
00087 int         ccgSubSurf_getNumVerts              (const CCGSubSurf *ss);
00088 int         ccgSubSurf_getNumEdges              (const CCGSubSurf *ss);
00089 int         ccgSubSurf_getNumFaces              (const CCGSubSurf *ss);
00090 
00091 int         ccgSubSurf_getSubdivisionLevels     (const CCGSubSurf *ss);
00092 int         ccgSubSurf_getEdgeSize              (const CCGSubSurf *ss);
00093 int         ccgSubSurf_getEdgeLevelSize         (const CCGSubSurf *ss, int level);
00094 int         ccgSubSurf_getGridSize              (const CCGSubSurf *ss);
00095 int         ccgSubSurf_getGridLevelSize         (const CCGSubSurf *ss, int level);
00096 
00097 CCGVert*    ccgSubSurf_getVert                  (CCGSubSurf *ss, CCGVertHDL v);
00098 CCGVertHDL  ccgSubSurf_getVertVertHandle        (CCGVert *v);
00099 int         ccgSubSurf_getVertNumFaces          (CCGVert *v);
00100 CCGFace*    ccgSubSurf_getVertFace              (CCGVert *v, int index);
00101 int         ccgSubSurf_getVertNumEdges          (CCGVert *v);
00102 CCGEdge*    ccgSubSurf_getVertEdge              (CCGVert *v, int index);
00103 
00104 int         ccgSubSurf_getVertAge               (CCGSubSurf *ss, CCGVert *v);
00105 void*       ccgSubSurf_getVertUserData          (CCGSubSurf *ss, CCGVert *v);
00106 void*       ccgSubSurf_getVertData              (CCGSubSurf *ss, CCGVert *v);
00107 void*       ccgSubSurf_getVertLevelData         (CCGSubSurf *ss, CCGVert *v, int level);
00108 
00109 CCGEdge*    ccgSubSurf_getEdge                  (CCGSubSurf *ss, CCGEdgeHDL e);
00110 CCGEdgeHDL  ccgSubSurf_getEdgeEdgeHandle        (CCGEdge *e);
00111 int         ccgSubSurf_getEdgeNumFaces          (CCGEdge *e);
00112 CCGFace*    ccgSubSurf_getEdgeFace              (CCGEdge *e, int index);
00113 CCGVert*    ccgSubSurf_getEdgeVert0             (CCGEdge *e);
00114 CCGVert*    ccgSubSurf_getEdgeVert1             (CCGEdge *e);
00115 float       ccgSubSurf_getEdgeCrease            (CCGEdge *e);
00116 
00117 int         ccgSubSurf_getEdgeAge               (CCGSubSurf *ss, CCGEdge *e);
00118 void*       ccgSubSurf_getEdgeUserData          (CCGSubSurf *ss, CCGEdge *e);
00119 void*       ccgSubSurf_getEdgeDataArray         (CCGSubSurf *ss, CCGEdge *e);
00120 void*       ccgSubSurf_getEdgeData              (CCGSubSurf *ss, CCGEdge *e, int x);
00121 void*       ccgSubSurf_getEdgeLevelData         (CCGSubSurf *ss, CCGEdge *e, int x, int level);
00122 
00123 CCGFace*    ccgSubSurf_getFace                  (CCGSubSurf *ss, CCGFaceHDL f);
00124 CCGFaceHDL  ccgSubSurf_getFaceFaceHandle        (CCGSubSurf *ss, CCGFace *f);
00125 int         ccgSubSurf_getFaceNumVerts          (CCGFace *f);
00126 CCGVert*    ccgSubSurf_getFaceVert              (CCGSubSurf *ss, CCGFace *f, int index);
00127 CCGEdge*    ccgSubSurf_getFaceEdge              (CCGSubSurf *ss, CCGFace *f, int index);
00128 int         ccgSubSurf_getFaceEdgeIndex         (CCGFace *f, CCGEdge *e);
00129 
00130 int         ccgSubSurf_getFaceAge               (CCGSubSurf *ss, CCGFace *f);
00131 void*       ccgSubSurf_getFaceUserData          (CCGSubSurf *ss, CCGFace *f);
00132 void*       ccgSubSurf_getFaceCenterData        (CCGFace *f);
00133 void*       ccgSubSurf_getFaceGridEdgeDataArray (CCGSubSurf *ss, CCGFace *f, int gridIndex);
00134 void*       ccgSubSurf_getFaceGridEdgeData      (CCGSubSurf *ss, CCGFace *f, int gridIndex, int x);
00135 void*       ccgSubSurf_getFaceGridDataArray     (CCGSubSurf *ss, CCGFace *f, int gridIndex);
00136 void*       ccgSubSurf_getFaceGridData          (CCGSubSurf *ss, CCGFace *f, int gridIndex, int x, int y);
00137 
00138 int         ccgSubSurf_getNumFinalVerts     (const CCGSubSurf *ss);
00139 int         ccgSubSurf_getNumFinalEdges     (const CCGSubSurf *ss);
00140 int         ccgSubSurf_getNumFinalFaces     (const CCGSubSurf *ss);
00141 
00142 /***/
00143 
00144 typedef struct _CCGVertIterator CCGVertIterator;
00145 typedef struct _CCGEdgeIterator CCGEdgeIterator;
00146 typedef struct _CCGFaceIterator CCGFaceIterator;
00147 
00148 CCGVertIterator*    ccgSubSurf_getVertIterator  (CCGSubSurf *ss);
00149 CCGEdgeIterator*    ccgSubSurf_getEdgeIterator  (CCGSubSurf *ss);
00150 CCGFaceIterator*    ccgSubSurf_getFaceIterator  (CCGSubSurf *ss);
00151 
00152 CCGVert*            ccgVertIterator_getCurrent  (CCGVertIterator *vi);
00153 int                 ccgVertIterator_isStopped   (CCGVertIterator *vi);
00154 void                ccgVertIterator_next        (CCGVertIterator *vi);
00155 void                ccgVertIterator_free        (CCGVertIterator *vi);
00156 
00157 CCGEdge*            ccgEdgeIterator_getCurrent  (CCGEdgeIterator *ei);
00158 int                 ccgEdgeIterator_isStopped   (CCGEdgeIterator *ei);
00159 void                ccgEdgeIterator_next        (CCGEdgeIterator *ei);
00160 void                ccgEdgeIterator_free        (CCGEdgeIterator *ei);
00161 
00162 CCGFace*            ccgFaceIterator_getCurrent  (CCGFaceIterator *fi);
00163 int                 ccgFaceIterator_isStopped   (CCGFaceIterator *fi);
00164 void                ccgFaceIterator_next        (CCGFaceIterator *fi);
00165 void                ccgFaceIterator_free        (CCGFaceIterator *fi);