[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30382] branches/soc-2010-rohith291991/ intern/comiso: Testing done for parametrization.

Rohith B V rohith291991 at gmail.com
Thu Jul 15 17:23:10 CEST 2010


Revision: 30382
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30382
Author:   rohith291991
Date:     2010-07-15 17:23:09 +0200 (Thu, 15 Jul 2010)

Log Message:
-----------
Testing done for parametrization. Some changes have to be made.

Modified Paths:
--------------
    branches/soc-2010-rohith291991/intern/comiso/extern/CMesh.h
    branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp

Modified: branches/soc-2010-rohith291991/intern/comiso/extern/CMesh.h
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/extern/CMesh.h	2010-07-15 15:20:53 UTC (rev 30381)
+++ branches/soc-2010-rohith291991/intern/comiso/extern/CMesh.h	2010-07-15 15:23:09 UTC (rev 30382)
@@ -1,112 +1,112 @@
-#ifndef CMESH_H
-#define CMESH_H
-
-#include "comiso.h"
-
-//flags for CFace
-#define CF_CONSTRAINED (1)
-#define CF_VISITED (1<<2)
-
-//flags for CEdge
-#define CE_MARKED (1)
-
-//flags for CVert
-#define CV_MARKED (1)
-#define CV_SINGULARITY (1<<2)
-#define CV_VISITED (1<<3)
-#define CV_LEAF (1<<4)
-
-struct CFace;
-struct CEdge;
-struct CVert;
-struct HEdge;
-struct HFace;
-struct HVert;
-
-typedef struct CVert
-{
-
-int * neighbors; //Indices of all neighboring vertices
-int * edges; //Indices of the edges, corresponding to neighbors
-int vvar; //Vertex duplications
-int index; //Index of the vertex
-int flag; //Flag for various purposes (if needed)
-int numNeighbors; //Number of neighboring vertices
-int pvert; //Parent vertex in Dijsktra
-float u; //u Parameter
-float v; //v Parameter
-float co[3]; //Coordinates of the vertex
-
-}CVert;
-
-typedef struct CEdge{
-
-int faces[2];//Indices of all faces having this edge
-double uflux[2];//Flux of u through edge from face[0] to face[1]
-double vflux[2];//Flux of v through edge from face[0] to face[1]
-//Optimization variables
-int usign[2]; 
-int vsign[2];
-int uvar[2];
-int vvar[2];
-int tvar[2];
-int test[2];
-double kappa;//Correction angle between two adjacent faces
-int index; //Index of the edge
-int p;// Period Jump for v1-v2. For v2-v1 it is -p
-int flag; //Flag for various purposes (eg. Cut graph)
-int v[2]; // Indices of vertices
-
-}CEdge;
-
-typedef struct CFace{
-
-int * neighbors; //Indices of all neighboring faces
-int * edges; //Indices of the edges, corresponding to neighbors
-int vvar[3]; //Vertex variable
-int index; //Index of the face
-int group; //Group index of the face
-int flag; //Flag for various purposes
-int numNeighbors; //Number of neighboring faces
-int v[4];// Indices of vertices. v4 is -1 if it is a triangle
-double theta; //Angle that the principle direction field makes with the edge represented by v1-v2
-double ut[3]; //Direction of u field
-double vt[3]; //Direction of v field
-
-}CFace;
-
-typedef struct CMesh
-{
-
-CVert* verts; //Vertex data
-CEdge * edges; //Edge data
-CFace * faces; //Face data
-int numFaces,numEdges,numVerts; // Self explanatory
-
-}CMesh;
-
+#ifndef CMESH_H
+#define CMESH_H
+
+#include "comiso.h"
+
+//flags for CFace
+#define CF_CONSTRAINED (1)
+#define CF_VISITED (1<<2)
+
+//flags for CEdge
+#define CE_MARKED (1)
+
+//flags for CVert
+#define CV_MARKED (1)
+#define CV_SINGULARITY (1<<2)
+#define CV_VISITED (1<<3)
+#define CV_LEAF (1<<4)
+
+struct CFace;
+struct CEdge;
+struct CVert;
+struct HEdge;
+struct HFace;
+struct HVert;
+
+typedef struct CVert
+{
+
+int * neighbors; //Indices of all neighboring vertices
+int * edges; //Indices of the edges, corresponding to neighbors
+int vvar; //Vertex duplications
+int index; //Index of the vertex
+int flag; //Flag for various purposes (if needed)
+int numNeighbors; //Number of neighboring vertices
+int pvert; //Parent vertex in Dijsktra
+float u; //u Parameter
+float v; //v Parameter
+float co[3]; //Coordinates of the vertex
+
+}CVert;
+
+typedef struct CEdge{
+
+int faces[2];//Indices of all faces having this edge
+double uflux[2];//Flux of u through edge from face[0] to face[1]
+double vflux[2];//Flux of v through edge from face[0] to face[1]
+//Optimization variables
+int usign[2]; 
+int vsign[2];
+int uvar[2];
+int vvar[2];
+int tvar[2];
+int test[2];
+double kappa;//Correction angle between two adjacent faces
+int index; //Index of the edge
+int p;// Period Jump for v1-v2. For v2-v1 it is -p
+int flag; //Flag for various purposes (eg. Cut graph)
+int v[2]; // Indices of vertices
+
+}CEdge;
+
+typedef struct CFace{
+
+int * neighbors; //Indices of all neighboring faces
+int * edges; //Indices of the edges, corresponding to neighbors
+int vvar[3]; //Vertex variable
+int index; //Index of the face
+int group; //Group index of the face
+int flag; //Flag for various purposes
+int numNeighbors; //Number of neighboring faces
+int v[4];// Indices of vertices. v4 is -1 if it is a triangle
+double theta; //Angle that the principle direction field makes with the edge represented by v1-v2
+double ut[3]; //Direction of u field
+double vt[3]; //Direction of v field
+
+}CFace;
+
+typedef struct CMesh
+{
+
+CVert* verts; //Vertex data
+CEdge * edges; //Edge data
+CFace * faces; //Face data
+int numFaces,numEdges,numVerts; // Self explanatory
+
+}CMesh;
+
 typedef struct HVert
     {
         double co[3]; //coordinates of the vertex
         struct HEdge* edge; //halfedge associated with the vertex (chosen as right)
 
-		int index; //Index of the vertex
-		int flag; //Flag for various purposes (if needed)
-		double u; //u Parameter
-		double v; //v Parameter
+		int index; //Index of the vertex
+		int flag; //Flag for various purposes (if needed)
+		double u; //u Parameter
+		double v; //v Parameter
 		            
-    }HVert;
+    }HVert;
  
 typedef struct HFace
     {
 	struct HEdge* edge; //halfedge associated with the face (random)
 
 	double normal[3]; //normal (for direction purposes)
-	int index; //Index of the face
-	//int group; //Group index of the face
-	int flag; //Flag for various purposes
-	double theta; //Angle that the principle direction field makes with the edge represented by v1-v2
-	double ut[3]; //Direction of u field
+	int index; //Index of the face
+	//int group; //Group index of the face
+	int flag; //Flag for various purposes
+	double theta; //Angle that the principle direction field makes with the edge represented by v1-v2
+	double ut[3]; //Direction of u field
 	double vt[3]; //Direction of v field
 	int v[3]; //Redundancy
 		            
@@ -121,50 +121,51 @@
         struct HEdge* next;   // next half-edge around the face
 		struct HEdge* prev;   // previous half-edge around the face
 
-		double uflux;//Flux of u through edge from face[0] to face[1]
-		double vflux;//Flux of v through edge from face[0] to face[1]
-		double je; //rotational extra 1
-		double ke; //rotational extra 2
-		double u; //Parametrization variable 1 (associated with vertex)
-		double v; //Parametrization variable 2 (associated with vertex)
-		//Optimization variables
-		int usign; 
-		int vsign;
-		int uvar;
-		int vvar;
-		int tvar;
-		int test;
-		double kappa;//Correction angle between two adjacent faces
-		int index; //Index of the edge (from cmesh)
-		int p;// Period Jump for v1-v2. For v2-v1 it is -p
-		int flag; //Flag for various purposes (eg. Cut graph)
+		double uflux;//Flux of u through edge from face[0] to face[1]
+		double vflux;//Flux of v through edge from face[0] to face[1]
+		double je; //rotational extra 1
+		double ke; //rotational extra 2
+		double u; //Parametrization variable 1 (associated with vertex)
+		double v; //Parametrization variable 2 (associated with vertex)
+		//Optimization variables
+		int usign; 
+		int vsign;
+		int uvar;
+		int vvar;
+		int tvar;
+		int test;
+		int is_resp;
+		double kappa;//Correction angle between two adjacent faces
+		int index; //Index of the edge (from cmesh)
+		int p;// Period Jump for v1-v2. For v2-v1 it is -p
+		int flag; //Flag for various purposes (eg. Cut graph)
 		//int v[2]; // Indices of vertices
     
     }HEdge;
 
 
 
-typedef struct HMesh
-{
-
-HVert* verts; //Vertex data
-HEdge * edges; //Edge data
-HFace * faces; //Face data
-int numFaces,numEdges,numVerts; // Self explanatory
-
-}HMesh;
+typedef struct HMesh
+{
 
- 
-#ifdef __cplusplus
-extern "C"  {
-#endif
-
-int generateVoronoiCells(CMesh * mesh);
-int generateDirectionField(CMesh *mesh);
-int generateParametrization(CMesh *mesh,double h);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
+HVert* verts; //Vertex data
+HEdge * edges; //Edge data
+HFace * faces; //Face data
+int numFaces,numEdges,numVerts; // Self explanatory
+
+}HMesh;
+
+ 
+#ifdef __cplusplus
+extern "C"  {
+#endif
+
+int generateVoronoiCells(CMesh * mesh);
+int generateDirectionField(CMesh *mesh);
+int generateParametrization(CMesh *mesh,double h);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif

Modified: branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp	2010-07-15 15:20:53 UTC (rev 30381)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/uv.cpp	2010-07-15 15:23:09 UTC (rev 30382)
@@ -21,38 +21,38 @@
   vvar = 2*var + (rot+1)%2 ;
 }
 
-void compute_edge_flux(HMesh *hm, bool curl_correction = true) { //with optional curl correction
- 
-
-  //Reset the fluxes
+void compute_edge_flux(HMesh *hm, bool curl_correction = true) { //with optional curl correction
+ 
+
+  //Reset the fluxes
 	int totedge,totface,totvert;
 	totvert=hm->numVerts;
 	totedge=hm->numEdges;
-	totface=hm->numFaces;
-
-	for(int i=0;i<totedge;i++)
-  {
-    hm->edges[i].uflux = 0 ;
-    hm->edges[i].uflux = 0 ;
-  }
-
-  //Compute facet_K2 and fluxes per half edge
- for(int l=0;l<totface;l++) {
-    //recover the edge vectors
-    HEdge* hi = hm->faces[l].edge ;
-
-    Vector3d p[3] ;
-    for(int i=0; i<3; ++i) {
-      p[i][0] = hi->vertex->co[0] ;
-	  p[i][1] = hi->vertex->co[1] ;
-	  p[i][2] = hi->vertex->co[2] ;
-      hi = hi->next ;
-    }
-
-    Vector3d e[3] ;
-    for(int i=0; i<3; ++i)
-      e[i] = p[i]-p[(i+2)%3] ; 
+	totface=hm->numFaces;
 
+	for(int i=0;i<totedge;i++)
+  {
+    hm->edges[i].uflux = 0 ;
+    hm->edges[i].uflux = 0 ;
+  }
+
+  //Compute facet_K2 and fluxes per half edge
+ for(int l=0;l<totface;l++) {
+    //recover the edge vectors
+    HEdge* hi = hm->faces[l].edge ;
+
+    Vector3d p[3] ;
+    for(int i=0; i<3; ++i) {
+      p[i][0] = hi->vertex->co[0] ;
+	  p[i][1] = hi->vertex->co[1] ;
+	  p[i][2] = hi->vertex->co[2] ;
+      hi = hi->next ;
+    }
+
+    Vector3d e[3] ;
+    for(int i=0; i<3; ++i)
+      e[i] = p[i]-p[(i+2)%3] ; 
+
     //compute u for facet
     Vector3d normal = e[1].cross(e[0]);
     normal.normalize() ;
@@ -77,115 +77,115 @@
     hm->faces[l].vt[0]=vt[0];
 	hm->faces[l].vt[1]=vt[1];
 	hm->faces[l].vt[2]=vt[2];
-   
-    //compute the flux through each edge
-    hi = hm->faces[l].edge;//probably useless
-    for(int i=0; i<3; ++i) {
-      hi->uflux = ut.dot(e[i]) ;
-      hi->vflux = vt.dot(e[i]) ;
-      hi = hi->next ;
-    }
-  }
-
-  if(!curl_correction) return ;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list