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

*** empty log message ***

parent db1f1833
Branches
Tags
No related merge requests found
......@@ -100,6 +100,8 @@ void Draw_Vector(int Type, int Fill,
double relHeadRadius, double relStemLength, double relStemRadius,
double x, double y, double z, double dx, double dy, double dz,
int light);
void Draw_Box(double xmin, double ymin, double zmin,
double xmax, double ymax, double zmax);
void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin,
double xmax, double ymax, double zmax,
double a, double b, double c, double d, int shade=0);
......
// $Id: Entity.cpp,v 1.67 2006-08-15 03:43:38 geuzaine Exp $
// $Id: Entity.cpp,v 1.68 2006-08-15 04:15:19 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -454,6 +454,33 @@ public:
};
};
void Draw_Box(double xmin, double ymin, double zmin,
double xmax, double ymax, double zmax)
{
glBegin(GL_LINE_LOOP);
glVertex3d(xmin, ymin, zmin);
glVertex3d(xmax, ymin, zmin);
glVertex3d(xmax, ymax, zmin);
glVertex3d(xmin, ymax, zmin);
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3d(xmin, ymin, zmax);
glVertex3d(xmax, ymin, zmax);
glVertex3d(xmax, ymax, zmax);
glVertex3d(xmin, ymax, zmax);
glEnd();
glBegin(GL_LINES);
glVertex3d(xmin, ymin, zmin);
glVertex3d(xmin, ymin, zmax);
glVertex3d(xmax, ymin, zmin);
glVertex3d(xmax, ymin, zmax);
glVertex3d(xmax, ymax, zmin);
glVertex3d(xmax, ymax, zmax);
glVertex3d(xmin, ymax, zmin);
glVertex3d(xmin, ymax, zmax);
glEnd();
}
void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin,
double xmax, double ymax, double zmax,
double a, double b, double c, double d,
......
// $Id: Geom.cpp,v 1.112 2006-08-15 02:17:25 geuzaine Exp $
// $Id: Geom.cpp,v 1.113 2006-08-15 04:15:19 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -419,6 +419,60 @@ void Draw_Geom()
for(int i = 0; i < 6; i++)
glDisable((GLenum)(GL_CLIP_PLANE0 + i));
bool geometryExists =
GMODEL->numVertex() || GMODEL->numEdge() || GMODEL->numFace() || GMODEL->numRegion();
if(geometryExists && (CTX.draw_bbox || !CTX.mesh.draw)) {
glColor4ubv((GLubyte *) & CTX.color.fg);
glLineWidth(CTX.line_width);
gl2psLineWidth(CTX.line_width * CTX.print.eps_line_width_factor);
Draw_Box(CTX.min[0], CTX.min[1], CTX.min[2],
CTX.max[0], CTX.max[1], CTX.max[2]);
char label[256];
double offset = 0.3 * CTX.gl_fontsize * CTX.pixel_equiv_x;
glRasterPos3d(CTX.min[0] + offset / CTX.s[0],
CTX.min[1] + offset / CTX.s[0],
CTX.min[2] + offset / CTX.s[0]);
sprintf(label, "(%g,%g,%g)", CTX.min[0], CTX.min[1], CTX.min[2]);
Draw_String(label);
glRasterPos3d(CTX.max[0] + offset / CTX.s[0],
CTX.max[1] + offset / CTX.s[0],
CTX.max[2] + offset / CTX.s[0]);
sprintf(label, "(%g,%g,%g)", CTX.max[0], CTX.max[1], CTX.max[2]);
Draw_String(label);
glColor3d(1.,0.,0.);
for(int i = 0; i < 6; i++)
if(CTX.clip[i] & 1 || CTX.clip[i] & 2)
Draw_PlaneInBoundingBox(CTX.min[0], CTX.min[1], CTX.min[2],
CTX.max[0], CTX.max[1], CTX.max[2],
CTX.clip_plane[i][0], CTX.clip_plane[i][1],
CTX.clip_plane[i][2], CTX.clip_plane[i][3]);
if(CTX.mesh.use_cut_plane)
Draw_PlaneInBoundingBox(CTX.min[0], CTX.min[1], CTX.min[2],
CTX.max[0], CTX.max[1], CTX.max[2],
CTX.mesh.cut_planea, CTX.mesh.cut_planeb,
CTX.mesh.cut_planec, CTX.mesh.cut_planed);
}
if(CTX.axes){
glColor4ubv((GLubyte *) & CTX.color.axes);
glLineWidth(CTX.line_width);
gl2psLineWidth(CTX.line_width * CTX.print.eps_line_width_factor);
if(!CTX.axes_auto_position){
Draw_Axes(CTX.axes, CTX.axes_tics, CTX.axes_format, CTX.axes_label,
CTX.axes_position);
}
else if(geometryExists){
double bb[6] = {CTX.min[0], CTX.max[0],
CTX.min[1], CTX.max[1],
CTX.min[2], CTX.max[2]};
Draw_Axes(CTX.axes, CTX.axes_tics, CTX.axes_format, CTX.axes_label, bb);
}
}
}
void HighlightEntity(GEntity *e, int permanent)
......
// $Id: Mesh.cpp,v 1.162 2006-08-15 03:43:38 geuzaine Exp $
// $Id: Mesh.cpp,v 1.163 2006-08-15 04:15:19 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -341,6 +341,28 @@ class drawMeshGFace {
drawNormals(f, f->quadrangles);
}
if(CTX.mesh.points_per_element){
// TODO
}
if(CTX.mesh.dual) {
/* TODO
glColor4ubv((GLubyte *) & CTX.color.fg);
glEnable(GL_LINE_STIPPLE);
glLineStipple(1, 0x0F0F);
gl2psEnable(GL2PS_LINE_STIPPLE);
glBegin(GL_LINES);
for(int i = 0; i < 3; i++) {
int j = i ? (i - 1) : 2;
glVertex3d(Xc, Yc, Zc);
glVertex3d((X[i] + X[j]) / 2., (Y[i] + Y[j]) / 2., (Z[i] + Z[j]) / 2.);
}
glEnd();
glDisable(GL_LINE_STIPPLE);
gl2psDisable(GL2PS_LINE_STIPPLE);
*/
}
if(CTX.render_mode == GMSH_SELECT) {
glPopName();
glPopName();
......
// $Id: OpenFile.cpp,v 1.110 2006-08-12 21:31:24 geuzaine Exp $
// $Id: OpenFile.cpp,v 1.111 2006-08-15 04:15:19 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -327,6 +327,7 @@ int MergeProblem(char *name, int warn_if_missing)
}
SetBoundingBox();
CTX.mesh.changed = 1;
Msg(STATUS2, "Read '%s'", name);
fclose(fp);
return status;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment