Skip to content
Snippets Groups Projects
Commit 90e9bbfb authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 555b9c11
No related branches found
No related tags found
No related merge requests found
// $Id: Entity.cpp,v 1.79 2008-01-11 13:56:22 remacle Exp $ // $Id: Entity.cpp,v 1.80 2008-01-12 15:14:40 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -746,11 +746,15 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256], ...@@ -746,11 +746,15 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256],
Draw_Axes(mode, tics, format, label, bbox, mikado); Draw_Axes(mode, tics, format, label, bbox, mikado);
} }
void Draw_Axe(double xmin,double ymin, double zmin,double xmax,double ymax,double zmax,int nticks,int mikado){ void Draw_Axe(double xmin, double ymin, double zmin,
double xmax, double ymax, double zmax, int nticks, int mikado)
{
if(mikado){ if(mikado){
nticks = (nticks - 1) * mikado; nticks = (nticks - 1) * mikado;
if(nticks < 1) nticks = 1; if(nticks < 1) nticks = 1;
double dd[3]={(xmax-xmin)/nticks,(ymax-ymin)/nticks,(zmax-zmin)/nticks}; double dd[3] = {(xmax - xmin) / nticks,
(ymax - ymin) / nticks,
(zmax - zmin) / nticks};
double axe_color[4]; double axe_color[4];
glGetDoublev(GL_CURRENT_COLOR, axe_color); glGetDoublev(GL_CURRENT_COLOR, axe_color);
for(int i = 1; i <= nticks; i++){ for(int i = 1; i <= nticks; i++){
...@@ -762,9 +766,11 @@ void Draw_Axe(double xmin,double ymin, double zmin,double xmax,double ymax,doubl ...@@ -762,9 +766,11 @@ void Draw_Axe(double xmin,double ymin, double zmin,double xmax,double ymax,doubl
Draw_Cylinder(3.5, cx, cy, cz, 1); Draw_Cylinder(3.5, cx, cy, cz, 1);
} }
glColor4dv(axe_color); glColor4dv(axe_color);
}else{ }
else{
glBegin(GL_LINES); glBegin(GL_LINES);
glVertex3d(xmin,ymin,zmin); glVertex3d(xmax,ymax,zmax); glVertex3d(xmin, ymin, zmin);
glVertex3d(xmax, ymax, zmax);
glEnd(); glEnd();
} }
} }
...@@ -809,10 +815,12 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256], ...@@ -809,10 +815,12 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256],
double dym[3] = {(xmin != xmax) ? -1. : 0., 0., (zmin != zmax) ? -1. : 0.}; double dym[3] = {(xmin != xmax) ? -1. : 0., 0., (zmin != zmax) ? -1. : 0.};
double dzm[3] = {(xmin != xmax) ? -1. : 0., (ymin != ymax) ? -1. : 0., 0.}; double dzm[3] = {(xmin != xmax) ? -1. : 0., (ymin != ymax) ? -1. : 0., 0.};
int nx = (xmin != xmax) ?
int nx = (xmin != xmax) ? Draw_Tics(0, tics[0], format[0], label[0], orig, xx, dxm,mikado) : 0; Draw_Tics(0, tics[0], format[0], label[0], orig, xx, dxm, mikado) : 0;
int ny = (ymin != ymax) ? Draw_Tics(1, tics[1], format[1], label[1], orig, yy, dym, mikado) : 0; int ny = (ymin != ymax) ?
int nz = (zmin != zmax) ? Draw_Tics(2, tics[2], format[2], label[2], orig, zz, dzm,mikado) : 0; Draw_Tics(1, tics[1], format[1], label[1], orig, yy, dym, mikado) : 0;
int nz = (zmin != zmax) ?
Draw_Tics(2, tics[2], format[2], label[2], orig, zz, dzm, mikado) : 0;
Draw_Axe(xmin, ymin, zmin, xmax, ymin, zmin, nx, mikado); Draw_Axe(xmin, ymin, zmin, xmax, ymin, zmin, nx, mikado);
Draw_Axe(xmin, ymin, zmin, xmin, ymax, zmin, ny, mikado); Draw_Axe(xmin, ymin, zmin, xmin, ymax, zmin, ny, mikado);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment