NCBI C++ ToolKit
|
Search Toolkit Book for CPhyloPdfGrabber
#include <gui/widgets/phylo_tree/phylo_pdf_grabber.hpp>
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 | |
CPhyloTreePane & | m_Pane |
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< CPdf > | m_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< int > | m_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< IRender > | m_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... | |
Definition at line 57 of file phylo_pdf_grabber.hpp.
CPhyloPdfGrabber::CPhyloPdfGrabber | ( | CPhyloTreePane & | pane | ) |
Definition at line 48 of file phylo_pdf_grabber.cpp.
References CPhyloTreePane::GetPane(), m_Pane, and m_PreviousGlPane.
|
inlinevirtual |
Definition at line 62 of file phylo_pdf_grabber.hpp.
|
virtual |
Grab the requested images.
Reimplemented from IImageGrabber.
Definition at line 57 of file phylo_pdf_grabber.cpp.
References CPdf::BeginDocument(), CPdf::BeginPage(), CDirEntry::ConcatPath(), CPdf::EndDocument(), CPdf::EndPage(), IImageGrabber::eSuccess, IImageGrabberProgress::ImageSaved(), IImageGrabber::m_BaseImageName, IImageGrabber::m_Directory, IImageGrabber::m_ImageFormat, m_Pane, m_Pdf, m_SaveTooltips, NULL, out(), CRef< C, Locker >::ReleaseOrNull(), CPhyloTreePane::RenderPdf(), CPhyloTreePane::SetContext(), IImageGrabberProgress::SetGLContext(), CPdf::SetOutputStream(), x_BeginCaptures(), and x_EndCaptures().
Referenced by CSaveTreePdfDlg::x_SavePdf().
|
inline |
Definition at line 67 of file phylo_pdf_grabber.hpp.
References b, and m_SaveTooltips.
Referenced by CSaveTreePdfDlg::x_SavePdf().
|
protectedvirtual |
Called to setup values before image capturing starts.
Reimplemented from IImageGrabber.
Definition at line 92 of file phylo_pdf_grabber.cpp.
References CDirEntry::ConcatPath(), CPhyloTreeScheme::eLabelsFull, CPrintOptions::ePdf, CUnit::ePdfUnit, CPrintOptions::ePortrait, CPhyloTreePane::GetCurrRenderer(), CPhyloTreeScheme::GetLabelTruncation(), CGlPane::GetModelLimitsRect(), CPhyloTreePane::GetPane(), IPhyloTreeRender::GetScheme(), CGlPane::GetViewport(), CGlPane::GetVisibleRect(), CGlRect< T >::Height(), IImageGrabber::m_BaseImageName, IImageGrabber::m_Directory, IImageGrabber::m_ImageFormat, m_LabelsTruncated, IImageGrabber::m_OutputFormat, m_Pane, m_Pdf, max(), CRef< C, Locker >::Reset(), CPrintOptions::SetFilename(), CPhyloTreeScheme::SetLabelTruncation(), CPrintOptions::SetMarginBottom(), CPrintOptions::SetMarginLeft(), CPrintOptions::SetMarginRight(), CPrintOptions::SetMarginTop(), CPrintOptions::SetMedia(), CPdf::SetOptions(), CPrintOptions::SetOutputFormat(), CGlPane::SetOutputUnitScaler(), CPrintOptions::SetPageOrientation(), CPrintOptions::SetPagesTall(), CPrintOptions::SetPagesWide(), CPhyloTreePane::SetupHardcopyRender(), CPrintOptions::SetUserUnit(), CGlPane::SetViewport(), and CGlRect< T >::Width().
Referenced by GrabImages().
|
protectedvirtual |
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().
|
protected |
Definition at line 81 of file phylo_pdf_grabber.hpp.
Referenced by x_BeginCaptures(), and x_EndCaptures().
|
protected |
Definition at line 82 of file phylo_pdf_grabber.hpp.
|
protected |
Definition at line 82 of file phylo_pdf_grabber.hpp.
|
protected |
Definition at line 82 of file phylo_pdf_grabber.hpp.
|
protected |
Definition at line 82 of file phylo_pdf_grabber.hpp.
|
protected |
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.
|
protected |
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().
Definition at line 84 of file phylo_pdf_grabber.hpp.
Referenced by GrabImages(), and x_BeginCaptures().
|
protected |
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().
|
protected |
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().