| | 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 | |
| | 136 | int 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 | /*++++++++++++++++++++++++++++++++++++++ |