Changeset 417

Show
Ignore:
Timestamp:
02/22/2009 11:06:34 AM (3 years ago)
Author:
powell
Message:

First cut phase boundary display, only shows a black line using edges.

Location:
trunk/matml/src/ternary
Files:
2 modified

Legend:

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

    r362 r417  
    114114 
    115115/*++++++++++++++++++++++++++++++++++++++ 
     116  Displays a phase boundary.  Note this pipes all of the points back to 
     117  geomview again. 
     118 
     119  int GeomviewDisplayPhaseBoundary It returns zero or an error code. 
     120 
     121  FILE *geompipe FILE pointer hooked to Geomview stdin. 
     122 
     123  char *name Full name of this Geomview object. 
     124 
     125  char *label Short label of this Geomview object. 
     126 
     127  char *appearance Appearance tag for this Geomview object. 
     128 
     129  int npoints Number of points. 
     130 
     131  ternary_point *points Point coordinates and colors. 
     132 
     133  phase_boundary theboundary Phase boundary object to display. 
     134  ++++++++++++++++++++++++++++++++++++++*/ 
     135 
     136int GeomviewDisplayPhaseBoundary 
     137(FILE *geompipe, char *name, char *label, char *appearance, 
     138 int npoints, ternary_point *points, phase_boundary *theboundary) 
     139{ 
     140  int i, c=theboundary->compos; 
     141  printf ("c=%d\n", c); fflush (stdout); 
     142 
     143  fprintf (geompipe, "(geometry \"%s\" { : %s })\n", name, label); 
     144  fprintf (geompipe, "(read geometry { define %s \n", label); 
     145  fprintf (geompipe, "appearance { %s }\nCOFF\n", appearance); 
     146  fprintf (geompipe, "%d %d 0\n", npoints, theboundary->n_edges); 
     147 
     148  for (i=0; i<npoints; i++) 
     149    fprintf (geompipe, "%g %g %g %g %g %g %g\n", points[i].x, points[i].y, 
     150             points[i].z, points[i].red, points[i].green, points[i].blue, 
     151             points[i].alpha); 
     152 
     153  printf ("First edge: %d %d\n", theboundary->edges [0], theboundary->edges [1]); 
     154  fflush (stdout); 
     155 
     156  for (i=0; i<theboundary->n_edges; i++) 
     157    fprintf (geompipe, "3 %d %d %d\n", theboundary->edges [c*i], 
     158             (c>1) ? theboundary->edges [c*i+1] : theboundary->edges [c*i], 
     159             (c>2) ? theboundary->edges [c*i+2] : theboundary->edges [c*i]); 
     160  fprintf (geompipe, "})\n"); 
     161  fflush (geompipe); 
     162 
     163  return 0; 
     164} 
     165 
     166 
     167/*++++++++++++++++++++++++++++++++++++++ 
    116168  GeomviewEnd exits geomview, closes its FILE, and sets its FILE to NULL so 
    117169  nobody tries to use it again. 
  • trunk/matml/src/ternary/ternary.h

    r416 r417  
    151151(FILE *geompipe, char *name, char *label, char *appearance, 
    152152 int npoints, ternary_point *points, int ntriangles, int *vertices); 
     153int GeomviewDisplayPhaseBoundary 
     154(FILE *geompipe, char *name, char *label, char *appearance, 
     155 int npoints, ternary_point *points, phase_boundary *theboundary); 
    153156int GeomviewEnd (FILE **geompipe); 
    154157