comparison src/gl2ps-renderer.cc @ 10315:57a59eae83cc

untabify src C++ source files
author John W. Eaton <jwe@octave.org>
date Thu, 11 Feb 2010 12:41:46 -0500
parents cd96d29c5efa
children 2da43cfcd414
comparison
equal deleted inserted replaced
10314:07ebe522dac2 10315:57a59eae83cc
48 GLint viewport[4]; 48 GLint viewport[4];
49 49
50 glGetIntegerv (GL_VIEWPORT, viewport); 50 glGetIntegerv (GL_VIEWPORT, viewport);
51 51
52 while (state == GL2PS_OVERFLOW) 52 while (state == GL2PS_OVERFLOW)
53 { 53 {
54 buffsize += 1024*1024; 54 buffsize += 1024*1024;
55 gl2psBeginPage ("glps_renderer figure", "Octave", viewport, 55 gl2psBeginPage ("glps_renderer figure", "Octave", viewport,
56 GL2PS_EPS, GL2PS_BSP_SORT, 56 GL2PS_EPS, GL2PS_BSP_SORT,
57 (GL2PS_SILENT | GL2PS_SIMPLE_LINE_OFFSET 57 (GL2PS_SILENT | GL2PS_SIMPLE_LINE_OFFSET
58 | GL2PS_NO_BLENDING | GL2PS_OCCLUSION_CULL 58 | GL2PS_NO_BLENDING | GL2PS_OCCLUSION_CULL
59 | GL2PS_BEST_ROOT), GL_RGBA, 0, NULL, 0, 0, 0, 59 | GL2PS_BEST_ROOT), GL_RGBA, 0, NULL, 0, 0, 0,
60 buffsize, fp, filename.c_str () ); 60 buffsize, fp, filename.c_str () );
61 61
62 opengl_renderer::draw (go); 62 opengl_renderer::draw (go);
63 state = gl2psEndPage (); 63 state = gl2psEndPage ();
64 } 64 }
65 65
66 fclose (fp); 66 fclose (fp);
67 67
68 in_draw = 0; 68 in_draw = 0;
69 } 69 }
71 opengl_renderer::draw (go); 71 opengl_renderer::draw (go);
72 } 72 }
73 73
74 Matrix 74 Matrix
75 glps_renderer::render_text (const std::string& txt, 75 glps_renderer::render_text (const std::string& txt,
76 double x, double y, double z, 76 double x, double y, double z,
77 int ha, int va, double rotation) 77 int ha, int va, double rotation)
78 { 78 {
79 if (txt.empty ()) 79 if (txt.empty ())
80 return Matrix (1, 4, 0.0); 80 return Matrix (1, 4, 0.0);
81 81
82 int gl2psa=GL2PS_TEXT_BL; 82 int gl2psa=GL2PS_TEXT_BL;
83 if (ha == 0) 83 if (ha == 0)
84 { 84 {
85 if (va == 0 || va == 3) 85 if (va == 0 || va == 3)
86 gl2psa=GL2PS_TEXT_BL; 86 gl2psa=GL2PS_TEXT_BL;
87 else if (va == 2) 87 else if (va == 2)
88 gl2psa=GL2PS_TEXT_TL; 88 gl2psa=GL2PS_TEXT_TL;
89 else if (va == 1) 89 else if (va == 1)
90 gl2psa=GL2PS_TEXT_CL; 90 gl2psa=GL2PS_TEXT_CL;
91 } 91 }
92 else if (ha == 2) 92 else if (ha == 2)
93 { 93 {
94 if (va == 0 || va == 3) 94 if (va == 0 || va == 3)
95 gl2psa=GL2PS_TEXT_BR; 95 gl2psa=GL2PS_TEXT_BR;
96 else if (va == 2) 96 else if (va == 2)
97 gl2psa=GL2PS_TEXT_TR; 97 gl2psa=GL2PS_TEXT_TR;
98 else if (va == 1) 98 else if (va == 1)
99 gl2psa=GL2PS_TEXT_CR; 99 gl2psa=GL2PS_TEXT_CR;
100 } 100 }
101 else if (ha == 1) 101 else if (ha == 1)
102 { 102 {
103 if (va == 0 || va == 3) 103 if (va == 0 || va == 3)
104 gl2psa=GL2PS_TEXT_B; 104 gl2psa=GL2PS_TEXT_B;
105 else if (va == 2) 105 else if (va == 2)
106 gl2psa=GL2PS_TEXT_T; 106 gl2psa=GL2PS_TEXT_T;
107 else if (va == 1) 107 else if (va == 1)
108 gl2psa=GL2PS_TEXT_C; 108 gl2psa=GL2PS_TEXT_C;
109 } 109 }
110 110
111 glRasterPos3d (x, y, z); 111 glRasterPos3d (x, y, z);
112 112
113 gl2psTextOpt (txt.c_str (), fontname.c_str (), fontsize, gl2psa, rotation); 113 gl2psTextOpt (txt.c_str (), fontname.c_str (), fontsize, gl2psa, rotation);