NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CPhyloPdfGrabber Class Reference

Search Toolkit Book for CPhyloPdfGrabber

#include <gui/widgets/phylo_tree/phylo_pdf_grabber.hpp>

+ Inheritance diagram for CPhyloPdfGrabber:
+ Collaboration diagram for CPhyloPdfGrabber:

Public Member Functions

 CPhyloPdfGrabber (CPhyloTreePane &pane)
virtual ~CPhyloPdfGrabber ()
virtual eCaptureResult GrabImages (int tex_size, IImageGrabberProgress *p=NULL)
 Grab the requested images. More...
void SaveTooltips (bool b)
- Public Member Functions inherited from IImageGrabber
 IImageGrabber ()
virtual ~IImageGrabber ()
eCaptureResult GrabImage (int tex_size, CVect2< int > img_idx, IImageGrabberProgress *p=NULL)
 Grab a single image for preview purposes. More...
eCaptureResult PreviewImages (int tex_size, int ref_img_width, int ref_img_height, IImageGrabberProgress *p=NULL)
 Grab images to update the on-screen image to approximate final output. More...
void SetPartitions (const CVect2< int > &p)
 Set number of desired image partitions. More...
void SetOutputInfo (const std::string &dir, const std::string &base_name, const std::string &img_format)
 Set file output information. More...
void SetNumberingFormat (eImageNumberingFormat fmt)
 Set the numbering format for sequential image names. More...
void SetTileAspectRatio (float ar)
 Set aspect ratio tiles captured. More...
void SetImageAspectRatio (float ar)
 Set aspect ratio for image as a whole. More...
void SetOutputFormat (const string &f)
 Set output format on which image aspect is based, e.g. A4, US Letter.. More...
void SetPrintingGuidesEnabled (bool b)
 Set to true to put cutting/printing guides on output images. More...
void DisableGouraudShading (bool b)
 Set to true force all triangles to be printed flat (no shadingtype 4) This makes the file compatible with Adobe Illustrator. More...
void SetTitleHeight (TModelUnit h)
 Set size for optional pdf title. More...
virtual void SetOutputStream (CNcbiOstream *ostr)

Protected Member Functions

void x_BeginCaptures (int buffer_size)
 Called to setup values before image capturing starts. More...
void x_EndCaptures ()
 Called to restore values (in pane) when capturing stops. More...
- Protected Member Functions inherited from IImageGrabber
void x_RenderGuides (CVect2< size_t > capture_size, const std::string &image_name, std::string image_bottom, std::string image_right, std::string image_top, std::string image_left)
 Render guides around image edge (cut marks + adjacent image names) More...
std::string x_GetImageName (int x, int y)
 Return image filename for a tile index based on the numbering scheme. More...
virtual eCaptureResult x_CaptureImage (CVect2< int > partitions, CVect2< int > index, CVect2< size_t > &capture_size)
 Must be subclassed to capture an individual image. More...

Protected Attributes

 Pane display canvas for the tree we are saving. More...
CGlPane m_PreviousGlPane
 We change some rendering options. More...
CPhyloTreeScheme::TLabelTruncation m_LabelsTruncated
double m_MarginLeft
double m_MarginTop
double m_MarginRight
double m_MarginBottom
CRef< CPdfm_Pdf
CVect2< float > m_ModelViewScaler
 Ratio scalers for the drawing area that maps to the images. More...
bool m_SaveTooltips
 If true, tooltips will be generated for the pdf as well. More...
- Protected Attributes inherited from IImageGrabber
CVect2< intm_ImagePartitions
 Number of partitions (tilings) in x and 1. More...
std::string m_Directory
 Target directory for saved images. More...
std::string m_BaseImageName
 Image name without its appended number (e.g. img for img1, img2...) More...
std::string m_ImageFormat
 Image output format (e.g. jpeg, png...) More...
eImageNumberingFormat m_NumberingFormat
 Numbering format, such as sequential or tiled (x and y) More...
bool m_GuidesEnabled
 If true, printing guides (like where to cut paper) will be added to image edges. More...
int m_GuideWidthX
 If we are making space for printing guides (margins) on the sides, those margins may have different sizes (in x and y) if we are forcing a proportional output size. More...
int m_GuideWidthY
float m_TileAspectRatio
 Ratio of width to height (w/h) in captured images. More...
string m_OutputFormat
 Name of output format, e.g. A4, US Letter.. More...
float m_ImageAspectRatio
 Aspect ratio of image from which we are generating tiles. More...
bool m_DisableGouraudShaded
 If true, disable gouraud-shaded polys (shadingtype 4) More...
TModelUnit m_TitleHeight = TModelUnit(0)
 Allow space at the top for a title. More...
CIRef< IRenderm_SavedRender

Additional Inherited Members

- Public Types inherited from IImageGrabber
enum  eCaptureResult { eSuccess =0 , eOpenGLError , eFileError , eError }
enum  eImageNumberingFormat { eSequentialFormat , eCartesionFormat }
- Static Protected Attributes inherited from IImageGrabber
static const int m_GuideWidth = 24
 Width of printing guides, if enabled. More...

Detailed Description

Definition at line 57 of file phylo_pdf_grabber.hpp.

Constructor & Destructor Documentation

◆ CPhyloPdfGrabber()

CPhyloPdfGrabber::CPhyloPdfGrabber ( CPhyloTreePane pane)

Definition at line 48 of file phylo_pdf_grabber.cpp.

References CPhyloTreePane::GetPane(), m_Pane, and m_PreviousGlPane.

◆ ~CPhyloPdfGrabber()

virtual CPhyloPdfGrabber::~CPhyloPdfGrabber ( )

Definition at line 62 of file phylo_pdf_grabber.hpp.

Member Function Documentation

◆ GrabImages()

IImageGrabber::eCaptureResult CPhyloPdfGrabber::GrabImages ( int  tex_size,
IImageGrabberProgress p = NULL 

◆ SaveTooltips()

void CPhyloPdfGrabber::SaveTooltips ( bool  b)

Definition at line 67 of file phylo_pdf_grabber.hpp.

References b, and m_SaveTooltips.

Referenced by CSaveTreePdfDlg::x_SavePdf().

◆ x_BeginCaptures()

void CPhyloPdfGrabber::x_BeginCaptures ( int  buffer_size)

◆ x_EndCaptures()

void CPhyloPdfGrabber::x_EndCaptures ( )

Called to restore values (in pane) when capturing stops.

Reimplemented from IImageGrabber.

Definition at line 157 of file phylo_pdf_grabber.cpp.

References CPhyloTreePane::GetCurrRenderer(), CPhyloTreePane::GetPane(), IPhyloTreeRender::GetScheme(), m_LabelsTruncated, m_Pane, m_PreviousGlPane, and CPhyloTreeScheme::SetLabelTruncation().

Referenced by GrabImages().

Member Data Documentation

◆ m_LabelsTruncated

CPhyloTreeScheme::TLabelTruncation CPhyloPdfGrabber::m_LabelsTruncated

Definition at line 81 of file phylo_pdf_grabber.hpp.

Referenced by x_BeginCaptures(), and x_EndCaptures().

◆ m_MarginBottom

double CPhyloPdfGrabber::m_MarginBottom

Definition at line 82 of file phylo_pdf_grabber.hpp.

◆ m_MarginLeft

double CPhyloPdfGrabber::m_MarginLeft

Definition at line 82 of file phylo_pdf_grabber.hpp.

◆ m_MarginRight

double CPhyloPdfGrabber::m_MarginRight

Definition at line 82 of file phylo_pdf_grabber.hpp.

◆ m_MarginTop

double CPhyloPdfGrabber::m_MarginTop

Definition at line 82 of file phylo_pdf_grabber.hpp.

◆ m_ModelViewScaler

CVect2<float> CPhyloPdfGrabber::m_ModelViewScaler

Ratio scalers for the drawing area that maps to the images.

These are both 1.0 unless we are forcing the individual images to a fixed proportion in which case the scale the underlying image extent accordingly.

Definition at line 90 of file phylo_pdf_grabber.hpp.

◆ m_Pane

CPhyloTreePane& CPhyloPdfGrabber::m_Pane

Pane display canvas for the tree we are saving.

Definition at line 76 of file phylo_pdf_grabber.hpp.

Referenced by CPhyloPdfGrabber(), GrabImages(), x_BeginCaptures(), and x_EndCaptures().

◆ m_Pdf

CRef<CPdf> CPhyloPdfGrabber::m_Pdf

Definition at line 84 of file phylo_pdf_grabber.hpp.

Referenced by GrabImages(), and x_BeginCaptures().

◆ m_PreviousGlPane

CGlPane CPhyloPdfGrabber::m_PreviousGlPane

We change some rendering options.

These are the previous values used in m_Pane so we can set them back when were done.

Definition at line 80 of file phylo_pdf_grabber.hpp.

Referenced by CPhyloPdfGrabber(), and x_EndCaptures().

◆ m_SaveTooltips

bool CPhyloPdfGrabber::m_SaveTooltips

If true, tooltips will be generated for the pdf as well.

Definition at line 93 of file phylo_pdf_grabber.hpp.

Referenced by GrabImages(), and SaveTooltips().

The documentation for this class was generated from the following files:
Modified on Mon Jun 17 05:04:55 2024 by rev. 669887