Changeset 332

Show
Ignore:
Timestamp:
03/26/08 17:12:43 (8 months ago)
Author:
powell
Message:

New geomview parameters: name, label, appearance.

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

Legend:

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

    r326 r332  
    7070  FILE *geompipe FILE pointer hooked to Geomview stdin. 
    7171 
     72  char *name Full name of this Geomview object. 
     73 
     74  char *label Short label of this Geomview object. 
     75 
     76  char *appearance Appearance tag for this Geomview object. 
     77 
    7278  int npoints Number of points. 
    7379 
     
    8086 
    8187int GeomviewDisplayTriangleCOFF 
    82 (FILE *geompipe, int npoints, ternary_point *points, int ntriangles, int *vertices) 
     88(FILE *geompipe, char *name, char *label, char *appearance, 
     89 int npoints, ternary_point *points, int ntriangles, int *vertices) 
    8390{ 
    8491  int i; 
    8592 
    86   fprintf (geompipe, "(geometry \"Ternary Free Energy\" { : tfe })\n"); 
    87   fprintf (geompipe, "(read geometry { define tfe \n"); 
    88   fprintf (geompipe, "appearance { shading smooth }\nCOFF\n"); 
     93  fprintf (geompipe, "(geometry \"%s\" { : %s })\n", name, label); 
     94  fprintf (geompipe, "(read geometry { define %s \n", label); 
     95  fprintf (geompipe, "appearance { %s }\nCOFF\n", appearance); 
    8996  fprintf (geompipe, "%d %d 0\n", npoints, ntriangles); 
    9097 
  • trunk/matml/src/ternary/ternary.c

    r328 r332  
    112112 
    113113  /* Send points and triangle vertex data to Geomview */ 
    114   if (i=GeomviewDisplayTriangleCOFF (pfd, (loop_max+1)*(loop_max+2)/2, points, 
    115                                      loop_max*loop_max, verts)) 
     114  if (i=GeomviewDisplayTriangleCOFF 
     115      (pfd, "Ternary Free Energy", "tfe", "shading smooth", 
     116       (loop_max+1)*(loop_max+2)/2, points, loop_max*loop_max, verts)) 
    116117    { printf ("main: Error %d in Geomview Display\n", i); exit (i); } 
    117118 
    118   printf ("Calling qhull\n"); 
    119119  if (i=qhullCalcHull (3, (loop_max+1)*(loop_max+2)/2, points, &hullnumverts, 
    120120                       &hullverts, &qh_version)) 
    121121    { printf ("main: qhullCalcHull returned %d\n", i); exit (i); } 
    122122  printf ("qhull version: %s\n", qh_version); 
     123 
     124#ifdef DEBUG 
     125  for (i=0; i<hullnumverts; i++) 
     126    printf ("Facet %d vertices: %d %d %d\n", i, hullverts[3*i], 
     127            hullverts[3*i+1], hullverts[3*i+2]); 
     128#endif 
     129 
     130  if (i=GeomviewDisplayTriangleCOFF 
     131      (pfd, "Free Energy Convex Hull", "ech", "-face +edge", 
     132       (loop_max+1)*(loop_max+2)/2, points, hullnumverts, hullverts)) 
     133    { printf ("main: Error %d in Geomview Display\n", i); exit (i); } 
    123134 
    124135  printf ("Press <return> to close up... "); 
  • trunk/matml/src/ternary/ternary.h

    r328 r332  
    2828int GeomviewBegin (FILE **geompipe, char *version); 
    2929int GeomviewDisplayTriangleCOFF 
    30 (FILE *geompipe, int npoints, ternary_point *points, 
    31  int ntriangles, int *vertices); 
     30(FILE *geompipe, char *name, char *label, char *appearance, 
     31 int npoints, ternary_point *points, int ntriangles, int *vertices); 
    3232int GeomviewEnd (FILE **geompipe); 
    3333