git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14506 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2016-01-27 20:33:55 +00:00
parent dca90d44b7
commit fa7543b714
7 changed files with 150 additions and 50 deletions

View File

@ -178,11 +178,13 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 3;
} else if (strcmp(arg[iarg],"tri") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
triflag = YES;
if (strcmp(arg[iarg+1],"type") == 0) tcolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
iarg += 2;
tstyle = force->inumeric(FLERR,arg[iarg+2]);
tdiamvalue = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"body") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
@ -806,12 +808,19 @@ void DumpImage::create_image()
}
// render atoms that are triangles
// tstyle = 1 for tri only, 2 for edges only, 3 for both
if (triflag) {
int tridraw = 1;
if (tstyle == 2) tridraw = 0;
int edgedraw = 1;
if (tstyle == 1) edgedraw = 0;
double **x = atom->x;
int *tri = atom->tri;
int *type = atom->type;
for (i = 0; i < nchoose; i++) {
j = clist[i];
if (tri[j] < 0) continue;
@ -828,7 +837,12 @@ void DumpImage::create_image()
MathExtra::add3(pt2,x[i],pt2);
MathExtra::add3(pt3,x[i],pt3);
image->draw_triangle(pt1,pt2,pt3,color);
if (tridraw) image->draw_triangle(pt1,pt2,pt3,color);
if (edgedraw) {
image->draw_cylinder(pt1,pt2,color,tdiamvalue,3);
image->draw_cylinder(pt2,pt3,color,tdiamvalue,3);
image->draw_cylinder(pt3,pt1,color,tdiamvalue,3);
}
}
}