NCBI C++ ToolKit
preview_setup_widget.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: preview_setup_widget.cpp 47479 2023-05-02 13:24:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Bob Falk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
35 
38 
39 #include <gui/opengl/gltexture.hpp>
41 
42 #include <util/image/image.hpp>
43 
44 #include <gui/utils/command.hpp>
45 #include <gui/utils/vect2.hpp>
46 #include <gui/opengl/glutils.hpp>
47 
48 
49 #include <wx/event.h>
50 #include <wx/sizer.h>
51 #include <wx/menu.h>
52 
53 
55 
56 BEGIN_EVENT_TABLE( CGlPreviewSetupWidget, CGLCanvas )
60 
61 
63  wxWindow* parent,
64  wxWindowID id,
65  const wxPoint& pos,
66  const wxSize& size,
67  long style,
68  int* attriblist)
69  : CGLCanvas(parent, id, pos, size, style)
70  , m_ReferenceImage(new CGlTexture(img.GetNCPointer()) )
71  , m_ReferenceSubImage(NULL)
72  , m_Rotated(false)
73  , m_AspectRatio(-1.0f)
74  , m_PartitionsX(0)
75  , m_PartitionsY(0)
76  , m_RectWidth(0.0f)
77  , m_RectHeight(0.0f)
78  , m_SavedX(-1)
79  , m_SavedY(-1)
80  , m_ZoomX(true)
81  , m_ZoomY(true)
82 {
83  m_ReferenceImage->SetTexEnv(GL_REPLACE);
84 
85  m_RefImageSize = CVect2<int>(static_cast<int>(img->GetWidth()), static_cast<int>(img->GetHeight()));
86 }
87 
88 
90 {
92 
93  if (m_ReferenceImage) {
95  delete m_ReferenceImage;
96  }
97 
98  if (m_ReferenceSubImage) {
100  delete m_ReferenceSubImage;
101  }
102 }
103 
105 {
106  return (int)m_RefImageSize.X();
107 }
108 
110 {
111  return (int)m_RefImageSize.Y();
112 }
113 
115 {
116  // Remove reference tile (may be brought up by double-clicking)
117  // when ever the partitions change.
118  delete m_ReferenceSubImage;
120 
121  float image_width = (float)m_RefImageSize.X();
122  float image_height = (float)m_RefImageSize.Y();
123 
124  float w = image_width;
125  float h = image_height;
126 
127  float r = w/h;
128  // 1 page implies no partitions, so start with p-1:
129  int s = p-1;
130 
131  int prevx = m_PartitionsX;
132  int prevy = m_PartitionsY;
133 
134  m_PartitionsX = 0;
135  m_PartitionsY = 0;
136 
137  // If desired aspect ratio is not defined (<0.0f) we assign a desired
138  // aspect ratio of 1.0f. Don't worry about aspect ratio here if
139  // user is zooming in x or y only.
140  float aspect_ratio = (m_AspectRatio > 0) ? m_AspectRatio : 1.0f;
141 
142  if (m_ZoomY && !m_ZoomX) {
143  m_PartitionsY = s;
144  }
145  else if (m_ZoomX && !m_ZoomY) {
146  m_PartitionsX = s;
147  }
148  else {
149  while (s>0) {
150  if (aspect_ratio > r) {
151  ++m_PartitionsY;
152  h = image_height/(((float)m_PartitionsY) + 1.0f);
153  }
154  else {
155  ++m_PartitionsX;
156  w = image_width/(((float)m_PartitionsX) + 1.0f);
157  }
158 
159  r = w/h;
160  --s;
161  }
162  }
163 
164  // With a new subdivision, saves no longer can be shown
165  if (m_PartitionsX != prevx || m_PartitionsY != prevy) {
166  m_SavedX = -1;
167  m_SavedY = -1;
168  }
169 }
170 
172 {
173  m_AspectRatio = r;
174 }
175 
177 {
178  m_NumberingFormat = fmt;
179 }
180 
182 {
184 }
185 
186 void CGlPreviewSetupWidget::SetZoomBehavior(bool zoomx, bool zoomy)
187 {
188  m_ZoomX = zoomx;
189  m_ZoomY = zoomy;
190 }
191 
193  int y_idx)
194 {
195  m_SavedX = x_idx;
196  m_SavedY = y_idx;
197 
198  Refresh();
199 }
200 
202  int y_idx)
203 {
204  RefreshImage(x_idx, y_idx);
205 
206  // Force immediate redraw so user can see progress.
207  // (We could also use the Update() function, but that doesn't work on Linux
208  // and on Windows it causes the hourglass cursor to flash - the hourglass
209  // cursor animation seems to restart everytime update is called).
210  x_Render();
211  SwapBuffers();
212 }
213 
215 {
217 
218  if (m_ReferenceSubImage) {
220  delete m_ReferenceSubImage;
221  m_ReferenceSubImage = nullptr;
222  }
223 
225  m_ReferenceSubImage->SetFilterMag(GL_LINEAR);
226  m_ReferenceSubImage->SetFilterMin(GL_LINEAR_MIPMAP_NEAREST);
228 
229  x_Render();
230  SwapBuffers();
231 }
232 
234 {
236 
237  if (m_ReferenceImage) {
239  delete m_ReferenceImage;
240  m_ReferenceImage = nullptr;
241  }
242 
243  m_ReferenceImage = refimg;
244 
245  x_Render();
246  SwapBuffers();
247 }
248 
249 void CGlPreviewSetupWidget::OnMouseDown(wxMouseEvent& event)
250 {
251  if (m_ReferenceSubImage != NULL) {
252  delete m_ReferenceSubImage;
254 
255  x_Render();
256  SwapBuffers();
257  }
258  else {
259  wxCommandEvent evt(wxEVT_TILE_PREVIEW);
260 
261  float x = (float)event.GetPosition().x;
262  float y = (float)(this->GetSize().GetY()-event.GetPosition().y);
263 
264  for (size_t i=0; i<m_TileOrigins.size(); ++i) {
265  if (x >= m_TileOrigins[i].m_PixelOrigin.X() &&
266  x <= m_TileOrigins[i].m_PixelOrigin.X() + m_RectWidth &&
267  y >= m_TileOrigins[i].m_PixelOrigin.Y() &&
268  y <= m_TileOrigins[i].m_PixelOrigin.Y() + m_RectHeight) {
269 
270  evt.SetInt(m_TileOrigins[i].m_TileIndex.X());
271  evt.SetExtraLong(m_TileOrigins[i].m_TileIndex.Y());
272 
273  this->GetParent()->GetEventHandler()->ProcessEvent(evt);
274  }
275  }
276  }
277 }
278 
280 {
281  /// Double click can bring up a reference image, but will not dismiss one.
282  if (m_ReferenceSubImage == NULL) {
283  wxCommandEvent evt(wxEVT_TILE_PREVIEW);
284 
285  float x = (float)event.GetPosition().x;
286  float y = (float)(this->GetSize().GetY()-event.GetPosition().y);
287 
288  for (size_t i=0; i<m_TileOrigins.size(); ++i) {
289  if (x >= m_TileOrigins[i].m_PixelOrigin.X() &&
290  x <= m_TileOrigins[i].m_PixelOrigin.X() + m_RectWidth &&
291  y >= m_TileOrigins[i].m_PixelOrigin.Y() &&
292  y <= m_TileOrigins[i].m_PixelOrigin.Y() + m_RectHeight) {
293 
294  evt.SetInt(m_TileOrigins[i].m_TileIndex.X());
295  evt.SetExtraLong(m_TileOrigins[i].m_TileIndex.Y());
296 
297  this->GetParent()->GetEventHandler()->ProcessEvent(evt);
298  }
299  }
300  }
301 }
302 
304 {
305  int w,h;
306 
307  // Update tile position information when we draw. This info is needed in case
308  // user clicks on the widget - we can then tell what tile they clicked on.
309  m_TileOrigins.clear();
310 
311  SetGLContext();
313 
314  GetSize(&w, &h);
315 
316  glEnable(GL_TEXTURE_2D);
317  glDisable(GL_LIGHTING);
318  glDisable(GL_BLEND);
319 
320  glViewport(0, 0, w, h);
321  float image_aspect = ((float)w)/(float)h;
322 
323  glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
324  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
325  glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
326 
327  glMatrixMode(GL_MODELVIEW);
328  glPushMatrix();
329  glLoadIdentity();
330 
331  glMatrixMode(GL_PROJECTION);
332  glPushMatrix();
333  glLoadIdentity();
334  gluOrtho2D(0.0, (GLdouble)w, 0.0, (GLdouble)h);
335 
337 
338  float scale = 1.0f;
339  float tiled_w = w;
340  float tiled_h = h;
341 
342  // If the aspect ratio is fixed (m_AspectRatio > 0), then the image tiles
343  // on the right side and bottom of the display area may have to be
344  // padded with white space in order to force the correct aspect
345  // (width/height).
346  if (m_AspectRatio > 0.0f) {
347  float partition_ratio = ((float)(m_PartitionsX+1))/(float)(m_PartitionsY+1);
348  float partitioned_aspect = m_AspectRatio*partition_ratio;
349 
350  // Compute here both the scale size for the displayed image,
351  // and the amount of image tiled in x and y. The tiled area will
352  // generally extend past the image area when we are using a fixed aspect
353  // ratio for output.
354  if (partitioned_aspect > image_aspect) {
355  // Get scaling:
356  float single_tile_height = ((float)h)/(float)(m_PartitionsY + 1);
357  float single_tile_width = m_AspectRatio*single_tile_height;
358  scale = ((float)w)/(single_tile_width*(float)(m_PartitionsX+1));
359 
360  // compute tiled area (area that will be saved as images)
361  tiled_h = scale*(float)h;
362  tiled_w = tiled_h*partitioned_aspect;
363  }
364  else
365  {
366  // Get scaling:
367  float single_tile_width = ((float)w)/(float)(m_PartitionsX + 1);
368  float single_tile_height = (1.0f/m_AspectRatio)*single_tile_width;
369  scale = ((float)h)/(single_tile_height*(float)(m_PartitionsY+1));
370 
371  // compute tiled area (area that will be saved as images)
372  tiled_w = scale*(float)w;
373  tiled_h = tiled_w*(1.0f/partitioned_aspect);
374  }
375  }
376  else {
377  // Special (simpliefied) cases where we only zoom (tile) in X or Y:
378  if (!m_ZoomX) {
379  tiled_w = std::min(h, w)/(float)(m_PartitionsY + 1);
380  }
381  else if (!m_ZoomY) {
382  tiled_w = w;
383  tiled_h = std::min(h, w)/(float)(m_PartitionsX + 1);
384  }
385  }
386 
387  int image_w = tiled_w;
388  int image_h = tiled_h;
389  float bottom_offset = h-(float)image_h;
390 
391  // Draw the image. Scale it if needed for fixed-proportion aspect ratios
392  // which may force us to include empty space on the top or bottom of the
393  // image.
394  if (!m_Rotated) {
395  glBegin(GL_QUADS);
396  glTexCoord2f(0.0f, 0.0f);
397  glVertex3f(0.0f, bottom_offset, 0.0f);
398 
399  glTexCoord2f(1.0f, 0.0f);
400  glVertex3f((float)image_w, bottom_offset, 0.0f);
401 
402  glTexCoord2f(1.0f, 1.0f);
403  glVertex3f((float)image_w, bottom_offset + (float)image_h, 0.0f);
404 
405  glTexCoord2f(0.0f, 1.0f);
406  glVertex3f(0.0f, bottom_offset + (float)image_h, 0.0f);
407  glEnd();
408  }
409  else {
410  glBegin(GL_QUADS);
411  glTexCoord2f(1.0f, 0.0f);
412  glVertex3f(0.0f, bottom_offset, 0.0f);
413 
414  glTexCoord2f(1.0f, 1.0f);
415  glVertex3f((float)image_w, bottom_offset, 0.0f);
416 
417  glTexCoord2f(0.0f, 1.0f);
418  glVertex3f((float)image_w, bottom_offset + (float)image_h, 0.0f);
419 
420  glTexCoord2f(0.0f, 0.0f);
421  glVertex3f(0.0f, bottom_offset + (float)image_h, 0.0f);
422  glEnd();
423  }
424 
425  glDisable(GL_TEXTURE_2D);
426 
427  glColor3f(1.0f, 0.0f, 0.0f);
428  glLineWidth(2.0f);
429 
430  // Get the width and height for an individual image tile
431  // on screen
432  m_RectWidth = ((float)tiled_w)/(float)(m_PartitionsX+1);
433  m_RectHeight = ((float)tiled_h)/(float)(m_PartitionsY+1);
434 
435  // Concatenate the name of an image with the longest (highest)
436  // numerical value (last image) so that we can pick a font
437  // size that lets it fit in the tiled area.
438  std::string img_name;
441  "_" +
443  }
444  else {
446  (m_PartitionsX+1));
447  }
448 
449  CVect2<float> pos(0.0f, 0.0f);
450 
451  // pick a font for the file name based on sub-image display area,
452  // and find the offset from the base of the sub-rectangle. Do this
453  // by iterating over font sizes for the chosen font starting at
454  // the smallest reasonable size (8pt) to a large reasonable stopping
455  // point (36) or when the length exceeds 85% of the available space.
456  CGlTextureFont name_font;
458 
459  name_font.SetFontSize(8);
460  float font_width = (float)name_font.TextWidth(img_name.c_str());
461  float font_height;
462  unsigned int fsize;
463 
464  if (font_width < (m_RectWidth*0.75f)) {
465  for (fsize=10; fsize<36; fsize+=2) {
466  name_font.SetFontSize(fsize);
467  font_width = (float)name_font.TextWidth(img_name.c_str());
468 
469  if (font_width > (m_RectWidth*0.75f)) {
470  name_font.SetFontSize(fsize-2);
471  break;
472  }
473  }
474  }
475 
476  // Get the position, relative to an image tile, of the image name text.
477  font_width = (float)name_font.TextWidth(img_name.c_str());
478  font_height = (float)name_font.TextHeight();
479  pos.X() = m_RectWidth/2.0f - font_width/2.0f;
480  pos.Y() = ((float)h) - m_RectHeight/2.0f - font_height/2.0f;
481 
482 
483  //
484  // pick a font for the "Saved" text the same way as for the image name text.
485  CGlTextureFont saved_font;
487 
488  saved_font.SetFontSize(8);
489  font_width = (float)name_font.TextWidth("Saved");
490 
491  if (font_width < m_RectWidth*0.75f) {
492  for (fsize=10; fsize<36; fsize+=2) {
493  saved_font.SetFontSize(fsize);
494  font_width = (float)saved_font.TextWidth("Saved");
495 
496  if (font_width > m_RectWidth*0.75f) {
497  saved_font.SetFontSize(fsize-2);
498  break;
499  }
500  }
501  }
502 
503  // Get the position, relative to an image tile, of the 'saved' text.
504  float saved_font_xpos = m_RectWidth/2.0f - ((float)saved_font.TextWidth("Saved"))/2.0f;
505  float saved_font_xdelta = saved_font_xpos - pos.X();
506 
507  glEnable(GL_BLEND);
508  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
509 
510  //
511  // Draw the image name, 'saved' text and image tile boxes from upper
512  // left to lower right of image.
513  for (int y=0; y<m_PartitionsY+1; ++y) {
514  for (int x=0; x<m_PartitionsX+1; ++x) {
515  std::string img_name = m_BaseImageName;
516 
517  // Get the image name based on the numbering scheme.
519  if (m_PartitionsY > 0) {
520  // the y index will count from 0 starting at the top.
521  img_name += NStr::IntToString(y + 1);
522  if (m_PartitionsX > 0)
523  img_name += "_";
524  }
525  if (m_PartitionsX > 0)
526  img_name += NStr::IntToString(x+1);
527  }
528  else {
529  img_name += NStr::IntToString(x + y*(m_PartitionsX+1) + 1);
530  }
531 
532  // text class currently queries the current GL_CURRENT_RASTER_COLOR which
533  // is the color set as the result of lighting calculations when glRasterPos
534  // is called.
535  if (font_width < (int)m_RectWidth && font_height < (int)m_RectHeight) {
536  glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
537  name_font.TextOut(pos.X(), pos.Y(), img_name.c_str());
538  }
539 
540  // Draw red lines around current sub-image (this causes the image
541  // to be tiled by red squares representing the images to be rendered).
542  glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
543  CVect2<float> rect_pos(x*m_RectWidth, h-((y+1)*m_RectHeight) );
544  m_TileOrigins.push_back(CTileOrigin(rect_pos, CVect2<int>(x,y)));
545  glBegin(GL_LINE_LOOP);
546  glVertex2f(rect_pos.X(), rect_pos.Y());
547  glVertex2f(rect_pos.X() + m_RectWidth, rect_pos.Y());
548  glVertex2f(rect_pos.X() + m_RectWidth, rect_pos.Y() + m_RectHeight);
549  glVertex2f(rect_pos.X(), rect_pos.Y() + m_RectHeight);
550  glEnd();
551 
552  // If the current tile is to be marked as 'saved', decrease the light level
553  // and write the word 'saved'.
554  if ( m_SavedY > y ||
555  (m_SavedX >= x && m_SavedY == y) ) {
556  // set color and use glRasterPos to set GL_CURRENT_RASTER_COLOR...
557  glColor4f(1.0f, 0.1f, 0.1f, 1.0f);
558  float posy = pos.Y() - (saved_font.TextHeight() + 3);
559  float posx = pos.X() + saved_font_xdelta;
560  saved_font.TextOut(posx, posy, "Saved");
561  glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
562 
563  glColor4f(0.1f, 0.1f, 0.1f, 0.2f);
564  glBegin(GL_QUADS);
565  glVertex2f(rect_pos.X(), rect_pos.Y());
566  glVertex2f(rect_pos.X() + m_RectWidth, rect_pos.Y());
567  glVertex2f(rect_pos.X() + m_RectWidth, rect_pos.Y() + m_RectHeight);
568  glVertex2f(rect_pos.X(), rect_pos.Y() + m_RectHeight);
569  glEnd();
570 
571  glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
572  }
573 
574  pos.X() += m_RectWidth;
575  }
576 
577  // Increment the position for the (next) image name text.
578  pos.X() = m_RectWidth/2 - ((float)font_width)/2.0f;
579  pos.Y() -= m_RectHeight;
580  }
581 
582  glDisable(GL_BLEND);
583 
584  if (m_ReferenceSubImage != NULL) {
585  float rw = (float)m_ReferenceSubImage->GetImage()->GetWidth();
586  float rh = (float)m_ReferenceSubImage->GetImage()->GetHeight();
587 
588  float rwidth, rheight;
589  float ref_image_aspect = rw/rh;
590 
591  if (ref_image_aspect > image_aspect) {
592  rwidth = (float)w;
593  rheight = rh*(w/rw);
594  }
595  else {
596  rheight = (float)h;
597  rwidth = rw*(h/rh);
598  }
599 
600  rheight *= 0.8f;
601  rwidth *= 0.8f;
602 
603  float originx = (((float)w)-rwidth)/2.0f;
604  float originy = (((float)h)-rheight)/2.0f;
605 
606  glEnable(GL_TEXTURE_2D);
608  glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
609 
610  glBegin(GL_QUADS);
611  glTexCoord2f(0.0f, 0.0f);
612  glVertex3f(originx, originy, 0);
613 
614  glTexCoord2f(1.0f, 0.0f);
615  glVertex3f(originx+rwidth, originy, 0);
616 
617  glTexCoord2f(1.0f, 1.0f);
618  glVertex3f(originx+rwidth, originy+rheight, 0);
619 
620  glTexCoord2f(0.0f, 1.0f);
621  glVertex3f(originx, originy+rheight, 0);
622  glEnd();
623 
624  glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
625  glLineWidth(2.0f);
626  glDisable(GL_TEXTURE_2D);
627 
628  glBegin(GL_LINE_LOOP);
629  glVertex3f(originx, originy, 0);
630  glVertex3f(originx+rwidth, originy, 0);
631  glVertex3f(originx+rwidth, originy+rheight, 0);
632  glVertex3f(originx, originy+rheight, 0);
633  glEnd();
634 
635  glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
636  }
637 
638 
639  glMatrixMode(GL_PROJECTION);
640  glPopMatrix();
641 
642  glMatrixMode(GL_MODELVIEW);
643  glPopMatrix();
644 
645  glDisable(GL_TEXTURE_2D);
646 }
647 
648 
CGLCanvas.
Definition: glcanvas.hpp:55
void x_SetupGLContext()
Definition: glcanvas.cpp:264
void RefreshImage(int x_idx, int y_idx)
Updated number of images saved and refresh the image.
void SetZoomBehavior(bool zoomx, bool zoomy)
Enable/disable zoom in x && y.
virtual void SetReferenceImage(CGlTexture *refimg)
Update reference image (allows image to reflect level of zoom based on curreint tiling).
virtual void ImageSaved(int x_idx, int y_idx)
Implement interface for IImageGrabberProgress which shows user interactive progress in saving (forces...
float m_AspectRatio
When subdividing image, the desired ratio of width to height (w/h)
bool m_ZoomX
We may only allow zoom in X or Y so these are true if zoom applies to that direction.
virtual void OnMouseDown(wxMouseEvent &event)
void x_Render()
Draw the image, its overlapping tiling, and text (image named, saved status) for those tiles.
int GetImageWidth() const
Get width and height of image.
float m_RectWidth
The width and height of the current tiles (as displayed on this widget)
CVect2< int > m_RefImageSize
Size of reference image initially passed to widget.
bool m_Rotated
If true, show the image rotated by 90 degrees.
void SetNumberingFormat(IImageGrabber::eImageNumberingFormat fmt)
Set numbering format for image names, e.g. img{x_y} vs img{1..n}.
int m_SavedX
The number of images saved so far, indexed by row and column.
void SetPartitions(int p)
Set the number of partitions for display on the widget.
CGlTexture * m_ReferenceImage
Image to display in setup widget.
std::string m_BaseImageName
Base name of image for display in (sub)image windows.
void SetAspectRatio(float r)
Set/Get desired width/height ratio for image when it is subdivided.
virtual void OnMouseDoubleClick(wxMouseEvent &event)
IImageGrabber::eImageNumberingFormat m_NumberingFormat
Numbering format for saved images.
vector< CTileOrigin > m_TileOrigins
The current lower-left hand corners of all the tiles (as of last draw)
CGlTexture * m_ReferenceSubImage
Expanded image of a single tile of the composite image.
virtual void SetPreviewSubImage(CRef< CImage > img)
Set an image to be displayed in the upper-left of the window.
int m_PartitionsX
The number of subdivisions of the image along the x and y axes.
CImage –.
Definition: Image.hpp:66
size_t GetWidth(void) const
Definition: image.hpp:98
size_t GetHeight(void) const
Definition: image.hpp:99
CRef –.
Definition: ncbiobj.hpp:618
GUI command routing and handling framework.
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
T & X()
Definition: vect2.hpp:107
T & Y()
Definition: vect2.hpp:109
virtual void MakeCurrent()
Definition: gltexture.cpp:169
virtual void SetFilterMag(GLenum f)
Definition: gltexture.hpp:221
void SetFontFace(EFontFace face, bool use_bitmap_overrides=true)
const CImage * GetImage(void) const
Definition: gltexture.hpp:186
static bool CheckGlError()
Check if there are any OpenGL errors.
Definition: glutils.cpp:166
void Clear()
Definition: gltexture.cpp:137
virtual TModelUnit TextWidth(const char *text) const
Compute and return font metrics.
virtual TModelUnit TextHeight(void) const
virtual void SetFilterMin(GLenum f)
Definition: gltexture.hpp:214
virtual void TextOut(const char *text) const
TextOut interface Write the specified text and set up state and transformation as needed.
void SetFontSize(unsigned int size)
Set/get font size in points.
void Swallow(CImage *image)
Definition: gltexture.cpp:147
TObjectType * GetNCPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1174
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5086
END_EVENT_TABLE()
int i
const struct ncbi::grid::netcache::search::fields::SIZE size
T min(T x_, T y_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
#define const
Definition: zconf.h:232
Modified on Wed Sep 04 15:01:04 2024 by modify_doxy.py rev. 669887