NCBI C++ ToolKit
phylo_image_grabber.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_PHYLO_TREE__PHYLO_IMAGE_GRABBER__HPP
2 #define GUI_WIDGETS_PHYLO_TREE__PHYLO_IMAGE_GRABBER__HPP
3 
4 /* $Id: phylo_image_grabber.hpp 27010 2012-12-07 16:37:16Z falkrb $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Bob Falk
30  *
31  * File Description:
32  *
33  * This is the subclass of IImageGrabber specialized to work with phylogenetic
34  * tree objects. It requires the drawing canvas (CPhyloTreePane) for the
35  * tree whose images are to be captured since it uses the pane's drawing
36  * function to capture the image. This class sets up the layout and sizing
37  * of the captured image with respect to the viewport (which is matched
38  * to the output image size) and the 'world coordinates' which tile the
39  * coordinates of the graph and associated labels.
40  *
41  * When drawing, it is a assumed the caller (base class) has set the target
42  * framebuffer to the target image.
43  */
44 
45 #include <corelib/ncbistd.hpp>
46 #include <gui/gui_export.h>
47 
49 
50 #include <util/image/image.hpp>
51 #include <gui/utils/vect2.hpp>
52 #include <gui/opengl/glrect.hpp>
53 #include <gui/opengl/glpane.hpp>
54 
56 
58 
59 class CImage;
60 class CPhyloTreePane;
61 
63 {
64 public:
66 
67  virtual ~CPhyloImageGrabber() {}
68 
69 protected:
70  /// Called to setup values before image capturing starts.
71  void x_BeginCaptures(int buffer_size);
72  /// Called to restore values (in pane) when capturing stops.
73  void x_EndCaptures();
74  /// Capture the image at tile position 'index'
76  CVect2<int> index,
77  CVect2<size_t>& capture_size);
78 
79  /// Pane display canvas for the tree we are saving
81 
82  /// We change some rendering options. These are the previous
83  /// values used in m_Pane so we can set them back when were done.
87 
88  /// Width and height of individual images being saved
91 
92  /// Ratio scalers for the drawing area that maps to the images.
93  /// These are both 1.0 unless we are forcing the individual images
94  /// to a fixed proportion in which case the scale the underlying
95  /// image extent accordingly.
97 };
98 
99 
101 
102 #endif // GUI_WIDGETS_PHYLO_TREE__PHYLO_IMAGE_GRABBER__HPP
class CGlPane
Definition: glpane.hpp:62
CImage –.
Definition: Image.hpp:66
int m_TileViewportWidth
Width and height of individual images being saved.
CPhyloTreePane & m_Pane
Pane display canvas for the tree we are saving.
CPhyloTreeScheme::TLabelTruncation m_LabelsTruncated
eCaptureResult x_CaptureImage(CVect2< int > partitions, CVect2< int > index, CVect2< size_t > &capture_size)
Capture the image at tile position 'index'.
CPhyloImageGrabber(CPhyloTreePane &pane)
void x_BeginCaptures(int buffer_size)
Called to setup values before image capturing starts.
CGlPane m_PreviousGlPane
We change some rendering options.
void x_EndCaptures()
Called to restore values (in pane) when capturing stops.
CVect2< float > m_ModelViewScaler
Ratio scalers for the drawing area that maps to the images.
class CPhyloTreePane
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Defines to provide correct exporting from DLLs in Windows.
static int buffer_size
Definition: pcretest.c:1050
Modified on Thu May 30 12:23:17 2024 by modify_doxy.py rev. 669887