Author: richefeu
Date: 2009-07-01 13:56:46 +0200 (Wed, 01 Jul 2009)
New Revision: 1827

Modified:
   trunk/extra/mgpost/src/display_funcs.c
   trunk/extra/mgpost/src/files.c
Log:
Add sphere reading for gdm-tk format


Modified: trunk/extra/mgpost/src/display_funcs.c
===================================================================
--- trunk/extra/mgpost/src/display_funcs.c      2009-06-30 20:10:30 UTC (rev 
1826)
+++ trunk/extra/mgpost/src/display_funcs.c      2009-07-01 11:56:46 UTC (rev 
1827)
@@ -107,7 +107,7 @@
 {
   GLdouble Xcam = Xviewp * TRANS_CAM_FACTOR, Ycam = Yviewp * TRANS_CAM_FACTOR;
   double extendx,extendy;
-  /*unsigned int i;*/
+  unsigned int i;
   
   glLoadIdentity ();
   gluLookAt (Xcam, Ycam, distance, Xcam, Ycam, 0.0f, 0.0f, 1.0f, 0.0f);
@@ -131,7 +131,7 @@
   glEnd();
  
   glEnable (GL_LIGHTING);
-/*
+
   
   for (i = 0; i < nbel; i++)   
        { 
@@ -166,7 +166,7 @@
          mgbodyselect_plein (i, state);
          
        }
-       */
+       
 }
 
 
@@ -866,7 +866,7 @@
 {
   int i, ii, nbtac = 0, current_adh = 0, anta;
   GLdouble Xcam = Xviewp * TRANS_CAM_FACTOR, Ycam = Yviewp * TRANS_CAM_FACTOR;
-  int coul;
+
   float save_valc_bleu, save_valc_rouge;
   double dist;
   double l, ls, lc, sina, cosa;

Modified: trunk/extra/mgpost/src/files.c
===================================================================
--- trunk/extra/mgpost/src/files.c      2009-06-30 20:10:30 UTC (rev 1826)
+++ trunk/extra/mgpost/src/files.c      2009-07-01 11:56:46 UTC (rev 1827)
@@ -391,6 +391,43 @@
                     i++;
                     nbel++;
                   }
+
+                                 if (!strcmp((const char *) token,"polyg"))
+                                 {
+                                       int nbVertex = 0,v;
+                                       double xnode,ynode;
+                                       double dist=0.0,Rout=0.0;
+                                       fscanf(his_file, "%*d %d", &nbVertex);
+
+                                       dataqty[i]       = 1;
+                                       datadistrib[i]   = datapos;
+
+                                       for (v=0;v<nbVertex;++v)
+                                       {
+                                         fscanf(his_file, "%lf 
%lf",&xnode,&ynode);
+                                         dist = sqrt(xnode*xnode+ynode*ynode);
+                                         if (dist>Rout) Rout=dist;
+                                         datas[datapos++] = xnode;
+                                         dataqty[i] += 1;
+                                         datas[datapos++] = ynode;
+                                         dataqty[i] += 1;
+                                       }
+                                       datas[datapos++] = Rout;
+                                       radius[nbel][0] = Rout;
+
+                                       fscanf(his_file, "%lf %lf %lf %lf %lf 
%lf",
+                                                       &x[nbel][0], 
&y[nbel][0], &rot[nbel][0],
+                                                       &vx[nbel][0], 
&vy[nbel][0], &vrot[nbel][0]);
+
+
+
+                                       mode2D      = MG_TRUE;
+                                       bdyty[i]    = MGP_POLYG;
+                                       bdyclass[i] = MGP_GRAIN;
+
+                                       i++;
+                                       nbel++;
+                                 }
                                  
                                  if (!strcmp((const char *) token,"CellBiP"))
                                  {


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to