Changeset 503

Show
Ignore:
Timestamp:
11/30/2009 03:53:06 PM (2 years ago)
Author:
powell
Message:

Allow NULL boundary argument to display nothing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/matml/src/ternary/geomview.c

    r477 r503  
    191191  visual_point *points Point coordinates and colors. 
    192192 
    193   phase_boundary theboundary Phase boundary object to display. 
     193  phase_boundary theboundary Phase boundary object to display, or NULL to 
     194  display nothing. 
    194195  ++++++++++++++++++++++++++++++++++++++*/ 
    195196 
     
    198199 int npoints, visual_point *points, phase_boundary *theboundary) 
    199200{ 
    200   int i, c=theboundary->compos; 
     201  int i, n_edges=0, c; 
     202 
     203  if (theboundary) 
     204    { 
     205      n_edges = theboundary->n_edges; 
     206      c = theboundary->compos; 
     207    } 
     208  else 
     209    npoints = 0; 
    201210 
    202211  fprintf (geompipe, "(geometry \"%s\" { : %s })\n", name, label); 
    203212  fprintf (geompipe, "(read geometry { define %s \n", label); 
    204213  fprintf (geompipe, "appearance { %s }\nCOFF\n", appearance); 
    205   fprintf (geompipe, "%d %d 0\n", npoints, theboundary->n_edges); 
     214  fprintf (geompipe, "%d %d 0\n", npoints, n_edges); 
    206215 
    207216#ifdef DEBUG 
     
    209218  printf ("(read geometry { define %s \n", label); 
    210219  printf ("appearance { %s }\nCOFF\n", appearance); 
    211   printf ("%d %d 0\n", npoints, theboundary->n_edges); 
     220  printf ("%d %d 0\n", npoints, n_edges); 
    212221#endif 
    213222 
     
    223232#endif 
    224233    } 
    225   for (i=0; i<theboundary->n_edges; i++) 
     234  for (i=0; i<n_edges; i++) 
    226235    { 
    227236      fprintf (geompipe, "3 %d %d %d\n", theboundary->edges [c*i],