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

%g->%.3g + use format also for 2d graphs
parent 03825ecd
No related branches found
No related tags found
No related merge requests found
...@@ -365,12 +365,12 @@ StringXString PostProcessingOptions_String[] = { ...@@ -365,12 +365,12 @@ StringXString PostProcessingOptions_String[] = {
StringXString ViewOptions_String[] = { StringXString ViewOptions_String[] = {
{ F|O, "AbscissaName" , opt_view_abscissa_name , "" , { F|O, "AbscissaName" , opt_view_abscissa_name , "" ,
"Abscissa name for 2D graphs" }, "Abscissa name for 2D graphs" },
{ F|O, "AbscissaFormat" , opt_view_abscissa_format , "%g" , { F|O, "AbscissaFormat" , opt_view_abscissa_format , "%.3g" ,
"Abscissa number format for 2D graphs (in standard C form)" }, "Abscissa number format for 2D graphs (in standard C form)" },
{ F, "FileName" , opt_view_filename , "" , { F, "FileName" , opt_view_filename , "" ,
"Default post-processing view file name" }, "Default post-processing view file name" },
{ F|O, "Format" , opt_view_format , "%g" , { F|O, "Format" , opt_view_format , "%.3g" ,
"Number format (in standard C form)" }, "Number format (in standard C form)" },
{ F|O, "GeneralizedRaiseX" , opt_view_gen_raise0 , "v0" , { F|O, "GeneralizedRaiseX" , opt_view_gen_raise0 , "v0" ,
......
// $Id: Graph2D.cpp,v 1.44 2005-01-09 21:36:47 geuzaine Exp $ // $Id: Graph2D.cpp,v 1.45 2005-01-18 06:22:03 geuzaine Exp $
// //
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
// //
...@@ -199,8 +199,11 @@ static void Draw_Graph2D(Post_View * v, ...@@ -199,8 +199,11 @@ static void Draw_Graph2D(Post_View * v,
glColor4ubv((GLubyte *) & CTX.color.text); glColor4ubv((GLubyte *) & CTX.color.text);
if(v->Type == DRAW_POST_2D_SPACE && if(v->Type == DRAW_POST_2D_SPACE &&
((v->ShowTime == 1 && List_Nbr(v->Time) > 1) || ((v->ShowTime == 1 && List_Nbr(v->Time) > 1) ||
(v->ShowTime == 2 && List_Nbr(v->Time) > 0))) (v->ShowTime == 2 && List_Nbr(v->Time) > 0))){
sprintf(label, "%s (%g)", v->Name, *(double *)List_Pointer(v->Time, v->TimeStep)); char tmp[256];
sprintf(tmp, v->Format, *(double *)List_Pointer(v->Time, v->TimeStep));
sprintf(label, "%s (%s)", v->Name, tmp);
}
else else
sprintf(label, "%s", v->Name); sprintf(label, "%s", v->Name);
glRasterPos2d(xtop, ytop + font_h + tic); glRasterPos2d(xtop, ytop + font_h + tic);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment