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

Go to the SVN repository for this file.

1 #if !defined(GUI_WIDGETS_WX__SVG_GRABBER__HPP)
2 #define GUI_WIDGETS_WX__SVG_GRABBER__HPP
3 
4 /*
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: Vladislav Evgeniev
30  *
31  * File Description:
32  *
33  * This is the subclass of IImageGrabber specialized to work with the
34  * sequence graphic view for the purpose of saving it as a vector image.
35  */
36 
37 #include <corelib/ncbistd.hpp>
38 #include <gui/gui_export.h>
39 
41 
42 #include <util/image/image.hpp>
43 #include <gui/utils/vect2.hpp>
44 #include <gui/opengl/glrect.hpp>
45 #include <gui/opengl/glpane.hpp>
46 
48 
49 #include <corelib/ncbiobj.hpp>
50 
52 
53 class CImage;
54 
56 {
57 public:
59 
60  virtual ~CSVGGrabber() {}
61 
62  virtual eCaptureResult GrabImages(int tex_size, IImageGrabberProgress* p = NULL);
63 
64  void SetOutputStream(CNcbiOstream* ostr);
65 
66 protected:
67  /// Called to setup values before image capturing starts.
68  void x_BeginCaptures(int buffer_size);
69  /// Called to restore values (in pane) when capturing stops.
70  void x_EndCaptures();
71 
72  /// Instantiates the PDF renderer
73  void x_InitRenderer();
74 
75  /// Pane display canvas for the tree we are saving
77 
78  /// We change some rendering options. These are the previous
79  /// values used in m_Pane so we can set them back when were done.
81 
82  /// Ratio scalers for the drawing area that maps to the images.
83  /// These are both 1.0 unless we are forcing the individual images
84  /// to a fixed proportion in which case the scale the underlying
85  /// image extent accordingly.
87 
89 
90  unique_ptr<CPrintOptions> m_PrintOptions;
92 };
93 
94 
96 
97 #endif // GUI_WIDGETS_WX__G2PS_GRABBER__HPP
class CGlPane
Definition: glpane.hpp:62
CImage –.
Definition: Image.hpp:66
unique_ptr< CPrintOptions > m_PrintOptions
Definition: svg_grabber.hpp:90
IVectorGraphicsRenderer & m_Pane
Pane display canvas for the tree we are saving.
Definition: svg_grabber.hpp:76
virtual ~CSVGGrabber()
Definition: svg_grabber.hpp:60
CRef< CSVGRenderer > m_SVGRenderer
Definition: svg_grabber.hpp:91
CGlPane m_PreviousGlPane
We change some rendering options.
Definition: svg_grabber.hpp:80
CNcbiOstream * m_OutputStream
Definition: svg_grabber.hpp:88
CVect2< float > m_ModelViewScaler
Ratio scalers for the drawing area that maps to the images.
Definition: svg_grabber.hpp:86
virtual eCaptureResult GrabImages(int tex_size, IImageGrabberProgress *p=NULL)
Grab the requested images.
virtual void x_EndCaptures()
Called after last image captured.
virtual void x_BeginCaptures(int)
Called before first image captured.
virtual void SetOutputStream(CNcbiOstream *ostr)
Interface class for the pdf renderer.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define NCBI_GUIWIDGETS_WX_EXPORT
Definition: gui_export.h:543
Defines to provide correct exporting from DLLs in Windows.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Sep 20 14:58:00 2024 by modify_doxy.py rev. 669887