tbx  0.7.5
Public Member Functions | List of all members
tbx::DrawFile Class Reference

Class to render a draw file to the screen. More...

#include <drawfile.h>

Inheritance diagram for tbx::DrawFile:
tbx::Image

Public Member Functions

 DrawFile ()
 Construct an unloaded draw file.
 
 DrawFile (const DrawFile &other)
 Construct a copy of another drawfile.
 
virtual ~DrawFile ()
 Destructor deletes loaded drawfile.
 
DrawFileoperator= (const DrawFile &other)
 Make into a copy of another draw file.
 
bool load (const std::string &file_name)
 Load JPEG from file. More...
 
bool is_valid () const
 Check if a draw file has been loaded.
 
virtual void plot (int x, int y) const
 Plot draw file at given location. More...
 
virtual void plot (const tbx::Point &pt) const
 Plot draw file at given location. More...
 
void render (DrawTransform *dt=0, BBox *clip=0, int flatness=-1) const
 Render a draw file to screen. More...
 
void bounds (BBox &bounds, DrawTransform *dt=0) const
 Return the bounding box for a drawfile with the given transform. More...
 
void declare_fonts (bool download_fonts=true) const
 Declare all the fonts in the drawfile for printing using PDriver_DeclareFonts.
 

Detailed Description

Class to render a draw file to the screen.

This class uses the DrawFile module to render the drawfile.

Member Function Documentation

◆ bounds()

void tbx::DrawFile::bounds ( BBox bounds,
DrawTransform dt = 0 
) const

Return the bounding box for a drawfile with the given transform.

Note: bounds will not be updated if a valid draw file has not been loaded.

Parameters
boundsbounds to return - note the coordinates return are in 256ths of an os unit
dtTransformation applied to the drawing.

◆ load()

bool tbx::DrawFile::load ( const std::string &  file_name)

Load JPEG from file.

Parameters
file_namename of file to load from
Returns
true if load succeeded

◆ plot() [1/2]

void tbx::DrawFile::plot ( int  x,
int  y 
) const
virtual

Plot draw file at given location.

Parameters
xx coordinate for plot in os units
yy coordinate for plot in os units

Implements tbx::Image.

◆ plot() [2/2]

void tbx::DrawFile::plot ( const tbx::Point pt) const
virtual

Plot draw file at given location.

Parameters
ptlocation for plot in os units

Reimplemented from tbx::Image.

◆ render()

void tbx::DrawFile::render ( DrawTransform dt = 0,
BBox clip = 0,
int  flatness = -1 
) const

Render a draw file to screen.

Parameters
dtDrawTransform to position, rotate and translate drawing or 0 for identity transform.
clippoint to box to clip the drawing or 0 for no clip
flatnessfor curves or -1 if not specified.

The documentation for this class was generated from the following files: