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

*** empty log message ***

parent 4aae6062
No related branches found
No related tags found
No related merge requests found
// $Id: GUI.cpp,v 1.36 2001-02-04 10:23:56 geuzaine Exp $
// $Id: GUI.cpp,v 1.37 2001-02-04 12:46:08 geuzaine Exp $
// To make the interface as visually consistent as possible, please:
// - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
......@@ -36,7 +36,9 @@ Fl_Menu_Item m_menubar_table[] = {
{"GREF...", 0, (Fl_Callback *)file_save_as_gref_cb, 0},
{"EPS simple sort...", 0, (Fl_Callback *)file_save_as_eps_simple_cb, 0},
{"EPS accurate sort...", 0, (Fl_Callback *)file_save_as_eps_accurate_cb, 0},
#ifndef WIN32
{"JPEG...", 0, (Fl_Callback *)file_save_as_jpeg_cb, 0},
#endif
{"GIF...", 0, (Fl_Callback *)file_save_as_gif_cb, 0},
{"GIF dithered...", 0, (Fl_Callback *)file_save_as_gif_dithered_cb, 0},
{"GIF transparent...", 0, (Fl_Callback *)file_save_as_gif_transparent_cb, 0},
......@@ -553,6 +555,7 @@ void GUI::create_menu_window(int argc, char **argv){
m_window = new Fl_Window(width,MH);
m_window->box(FL_THIN_UP_BOX);
m_window->label("Gmsh");
m_window->callback(file_quit_cb);
m_menu_bar = new Fl_Menu_Bar(0,0,width,BH);
m_menu_bar->menu(m_menubar_table);
......@@ -746,6 +749,8 @@ void GUI::create_graphic_window(int argc, char **argv){
g_window = new Fl_Window(width, height);
g_window->callback(file_quit_cb);
g_opengl_window = new Opengl_Window(0,0,width,glheight);
g_opengl_window->end();
......
// $Id: Opengl.cpp,v 1.16 2001-02-03 21:20:32 geuzaine Exp $
// $Id: Opengl.cpp,v 1.17 2001-02-04 12:46:09 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
......@@ -34,6 +34,14 @@ void InitOverlay(void){
Orthogonalize(0,0);
}
void ClearOpengl(void){
glClearColor(UNPACK_RED(CTX.color.bg)/255.,
UNPACK_GREEN(CTX.color.bg)/255.,
UNPACK_BLUE(CTX.color.bg)/255.,
0.);
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
}
void Draw(void){
WID->redraw_opengl();
}
......
// $Id: Opengl_Window.cpp,v 1.10 2001-02-04 10:23:56 geuzaine Exp $
// $Id: Opengl_Window.cpp,v 1.11 2001-02-04 12:46:09 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
......@@ -42,11 +42,7 @@ void Opengl_Window::draw() {
}
if(!ZOOM){
Orthogonalize(0,0);
glClearColor(UNPACK_RED(CTX.color.bg)/255.,
UNPACK_GREEN(CTX.color.bg)/255.,
UNPACK_BLUE(CTX.color.bg)/255.,
0.);
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
ClearOpengl();
Draw3d();
Draw2d();
}
......
// $Id: CreateFile.cpp,v 1.12 2001-01-29 08:43:44 geuzaine Exp $
// $Id: CreateFile.cpp,v 1.13 2001-02-04 12:46:09 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
......@@ -29,6 +29,12 @@ extern XContext_T XCTX;
#include "gl2ppm.h"
#include "gl2yuv.h"
void FillBuffer(void){
InitOpengl();
ClearOpengl();
Draw3d();
Draw2d();
}
void CreateFile (char *name, int format) {
FILE *fp;
......@@ -112,7 +118,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Draw();
FillBuffer();
create_jpeg(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1],
CTX.print.jpeg_quality);
......@@ -127,7 +133,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Draw();
FillBuffer();
create_gif(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1],
CTX.print.gif_dither,
......@@ -147,7 +153,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Draw();
FillBuffer();
create_ppm(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]);
Msg(INFO, "PPM Creation Complete '%s'", name);
......@@ -160,7 +166,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Draw();
FillBuffer();
create_yuv(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]);
Msg(INFO, "YUV Creation Complete '%s'", name);
......@@ -209,7 +215,7 @@ void CreateFile (char *name, int format) {
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_DRAW_BACKGROUND,
GL_RGBA, 0, NULL, size3d, fp);
CTX.stream = TO_FILE ;
Draw();
FillBuffer();
CTX.stream = TO_SCREEN ;
res = gl2psEndPage();
}
......
......@@ -16,7 +16,9 @@ void InitShading(void);
void InitRenderModel(void);
void InitNoShading(void);
void InitPosition(void);
void Orthogonalize(int x, int y);
void ClearOpengl(void);
void set_r(int i, double val);
void set_t(int i, double val);
......
// $Id: Opengl.cpp,v 1.4 2001-01-29 08:43:45 geuzaine Exp $
// $Id: Opengl.cpp,v 1.5 2001-02-04 12:46:09 geuzaine Exp $
#include <X11/IntrinsicP.h>
......@@ -48,13 +48,17 @@ void InitOverlay(void){
Orthogonalize(0,0);
}
void Draw(void){
InitOpengl();
void ClearOpengl(void){
glClearColor(UNPACK_RED(CTX.color.bg)/255.,
UNPACK_GREEN(CTX.color.bg)/255.,
UNPACK_BLUE(CTX.color.bg)/255.,
0.);
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
}
void Draw(void){
InitOpengl();
ClearOpengl();
if(CTX.db) glDrawBuffer(GL_BACK);
Draw3d();
Draw2d();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment