43 #ifndef vtkTextRenderer_h 44 #define vtkTextRenderer_h 46 #include "vtkRenderingCoreModule.h" 58 class RegularExpression;
82 TopLeft(0), TopRight(0), BottomLeft(0), BottomRight(0),
156 vtkGetMacro(DefaultBackend,
int)
182 int bbox[4],
int dpi,
int backend = Default)
184 return this->GetBoundingBoxInternal(tprop, str, bbox, dpi, backend);
187 int bbox[4],
int dpi,
int backend = Default)
189 return this->GetBoundingBoxInternal(tprop, str, bbox, dpi, backend);
201 Metrics &metrics,
int dpi,
int backend = Default)
203 return this->GetMetricsInternal(tprop, str, metrics, dpi, backend);
206 Metrics &metrics,
int dpi,
int backend = Default)
208 return this->GetMetricsInternal(tprop, str, metrics, dpi, backend);
229 int backend = Default)
231 return this->RenderStringInternal(tprop, str,
data, textDims, dpi, backend);
235 int backend = Default)
237 return this->RenderStringInternal(tprop, str,
data, textDims, dpi, backend);
249 int targetWidth,
int targetHeight,
int dpi,
250 int backend = Default)
252 return this->GetConstrainedFontSizeInternal(str, tprop, targetWidth,
253 targetHeight, dpi, backend);
256 int targetWidth,
int targetHeight,
int dpi,
257 int backend = Default)
259 return this->GetConstrainedFontSizeInternal(str, tprop, targetWidth,
260 targetHeight, dpi, backend);
273 vtkPath *path,
int dpi,
int backend = Default)
275 return this->StringToPathInternal(tprop, str, path, dpi, backend);
278 vtkPath *path,
int dpi,
int backend = Default)
280 return this->StringToPathInternal(tprop, str, path, dpi, backend);
292 this->SetScaleToPowerOfTwoInternal(
scale);
307 int bbox[4],
int dpi,
int backend) = 0;
310 int bbox[4],
int dpi,
int backend) = 0;
313 Metrics &metrics,
int dpi,
int backend) = 0;
316 Metrics &metrics,
int dpi,
int backend) = 0;
320 int dpi,
int backend) = 0;
324 int dpi,
int backend) = 0;
325 virtual
int GetConstrainedFontSizeInternal(const
vtkStdString &str,
327 int targetWidth,
int targetHeight,
328 int dpi,
int backend) = 0;
331 int targetWidth,
int targetHeight,
332 int dpi,
int backend) = 0;
335 int dpi,
int backend) = 0;
338 int dpi,
int backend) = 0;
339 virtual
void SetScaleToPowerOfTwoInternal(
bool scale) = 0;
356 vtksys::RegularExpression *MathTextRegExp;
357 vtksys::RegularExpression *MathTextRegExp2;
377 #endif //vtkTextRenderer_h
bool StringToPath(vtkTextProperty *tprop, const vtkUnicodeString &str, vtkPath *path, int dpi, int backend=Default)
Given a text property and a string, this function populates the vtkPath path with the outline of the ...
Wrapper around std::string to keep symbols short.
bool GetBoundingBox(vtkTextProperty *tprop, const vtkStdString &str, int bbox[4], int dpi, int backend=Default)
Given a text property and a string, get the bounding box {xmin, xmax, ymin, ymax} of the rendered str...
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
concrete dataset representing a path defined by Bezier curves.
vtkVector2i TopRight
The corners of the rendered text (or background, if applicable), in pixels.
Backend
Available backends.
vtkVector2i Descent
Vectors representing the rotated ascent and descent of the text.
bool StringToPath(vtkTextProperty *tprop, const vtkStdString &str, vtkPath *path, int dpi, int backend=Default)
Given a text property and a string, this function populates the vtkPath path with the outline of the ...
vtkVector2i TopLeft
The corners of the rendered text (or background, if applicable), in pixels.
bool GetMetrics(vtkTextProperty *tprop, const vtkUnicodeString &str, Metrics &metrics, int dpi, int backend=Default)
Given a text property and a string, get some metrics for the rendered string.
void SetScaleToPowerOfTwo(bool scale)
Set to true if the graphics implmentation requires texture image dimensions to be a power of two...
bool RenderString(vtkTextProperty *tprop, const vtkStdString &str, vtkImageData *data, int textDims[2], int dpi, int backend=Default)
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
vtkTuple< int, 4 > BoundingBox
The axis-aligned bounding box of the rendered text and background, in pixels.
bool RenderString(vtkTextProperty *tprop, const vtkUnicodeString &str, vtkImageData *data, int textDims[2], int dpi, int backend=Default)
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
a simple class to control print indentation
virtual bool MathTextIsSupported()
topologically and geometrically regular array of data
Some derived classes for the different vectors commonly used.
represent text properties.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual bool FreeTypeIsSupported()
Test for availability of various backends.
Metrics()
Construct a Metrics object with all members initialized to 0.
Interface for generating images and path data from string data, using multiple backends.
vtkVector2i Ascent
Vectors representing the rotated ascent and descent of the text.
bool GetMetrics(vtkTextProperty *tprop, const vtkStdString &str, Metrics &metrics, int dpi, int backend=Default)
Given a text property and a string, get some metrics for the rendered string.
int GetConstrainedFontSize(const vtkUnicodeString &str, vtkTextProperty *tprop, int targetWidth, int targetHeight, int dpi, int backend=Default)
This function returns the font size (in points) and sets the size in tprop that is required to fit th...
vtkVector2i BottomLeft
The corners of the rendered text (or background, if applicable), in pixels.
bool GetBoundingBox(vtkTextProperty *tprop, const vtkUnicodeString &str, int bbox[4], int dpi, int backend=Default)
Given a text property and a string, get the bounding box {xmin, xmax, ymin, ymax} of the rendered str...
int GetConstrainedFontSize(const vtkStdString &str, vtkTextProperty *tprop, int targetWidth, int targetHeight, int dpi, int backend=Default)
This function returns the font size (in points) and sets the size in tprop that is required to fit th...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkVector2i BottomRight
The corners of the rendered text (or background, if applicable), in pixels.
String class that stores Unicode text.