VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
vtkMatplotlibMathTextUtilities Class Reference

Access to MatPlotLib MathText rendering. More...

#include <vtkMatplotlibMathTextUtilities.h>

Inheritance diagram for vtkMatplotlibMathTextUtilities:
Inheritance graph
[legend]
Collaboration diagram for vtkMatplotlibMathTextUtilities:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkMathTextUtilities Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkMatplotlibMathTextUtilitiesNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
bool StringToPath (const char *str, vtkPath *path, vtkTextProperty *tprop)
bool GetBoundingBox (vtkTextProperty *tprop, const char *str, unsigned int dpi, int bbox[4])
bool RenderString (const char *str, vtkImageData *data, vtkTextProperty *tprop, unsigned int dpi, int textDims[2]=NULL)
virtual void SetScaleToPowerOfTwo (bool)
virtual bool GetScaleToPowerOfTwo ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static
vtkMatplotlibMathTextUtilities
SafeDownCast (vtkObjectBase *o)
static
vtkMatplotlibMathTextUtilities
New ()

Protected Types

enum  Availablity { NOT_TESTED = 0, AVAILABLE, UNAVAILABLE }

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkMatplotlibMathTextUtilities ()
virtual ~vtkMatplotlibMathTextUtilities ()
bool InitializeMaskParser ()
bool InitializePathParser ()
bool InitializeFontPropertiesClass ()
bool CheckForError ()
bool CheckForError (PyObject *object)
PyObjectGetFontProperties (vtkTextProperty *tprop)
void CleanupPythonObjects ()
void RotateCorners (double angleDeg, double corners[4][2], double bbox[4])
bool PrepareImageData (vtkImageData *data, int bbox[4])

Static Protected Member Functions

static void CheckMPLAvailability ()

Protected Attributes

vtkPythonInterpreter * Interpreter
PyObjectMaskParser
PyObjectPathParser
PyObjectFontPropertiesClass
bool ScaleToPowerOfTwo

Detailed Description

Access to MatPlotLib MathText rendering.

vtkMatplotlibMathTextUtilities provides access to the MatPlotLib MathText implementation.

This class is aware of a number of environment variables that can be used to configure and debug python initialization (all are optional):

Definition at line 43 of file vtkMatplotlibMathTextUtilities.h.


Member Typedef Documentation

Reimplemented from vtkMathTextUtilities.

Definition at line 47 of file vtkMatplotlibMathTextUtilities.h.


Member Enumeration Documentation

Used for runtime checking of matplotlib's mathtext availability.

Enumerator:
NOT_TESTED 
AVAILABLE 
UNAVAILABLE 

Definition at line 113 of file vtkMatplotlibMathTextUtilities.h.


Constructor & Destructor Documentation


Member Function Documentation

static int vtkMatplotlibMathTextUtilities::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkMathTextUtilities.

virtual int vtkMatplotlibMathTextUtilities::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkMathTextUtilities.

Reimplemented from vtkMathTextUtilities.

virtual vtkObjectBase* vtkMatplotlibMathTextUtilities::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkMathTextUtilities.

Reimplemented from vtkMathTextUtilities.

void vtkMatplotlibMathTextUtilities::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkMathTextUtilities.

This is a singleton pattern New. There will be only ONE reference to a vtkMathTextUtilities object per process. Clients that call this method must use Delete() on the object so that reference counting will work. The single instance will be unreferenced when the program exits. You should just use the static GetInstance() method anyway to get the singleton.

Reimplemented from vtkMathTextUtilities.

bool vtkMatplotlibMathTextUtilities::GetBoundingBox ( vtkTextProperty tprop,
const char *  str,
unsigned int  dpi,
int  bbox[4] 
) [virtual]

Determine the dimensions of the image that RenderString will produce for a given str, tprop, and dpi

Implements vtkMathTextUtilities.

bool vtkMatplotlibMathTextUtilities::RenderString ( const char *  str,
vtkImageData data,
vtkTextProperty tprop,
unsigned int  dpi,
int  textDims[2] = NULL 
) [virtual]

Render the given string str into the vtkImageData data with a resolution of dpi. The image is resized automatically. textDims will be overwritten by the pixel width and height of the rendered string. This is useful when ScaleToPowerOfTwo is true, and the image dimensions may not match the dimensions of the rendered text.

Implements vtkMathTextUtilities.

bool vtkMatplotlibMathTextUtilities::StringToPath ( const char *  str,
vtkPath path,
vtkTextProperty tprop 
) [virtual]

Parse the MathText expression in str and fill path with a contour of the glyphs.

Implements vtkMathTextUtilities.

virtual void vtkMatplotlibMathTextUtilities::SetScaleToPowerOfTwo ( bool  ) [virtual]

Set to true if the graphics implmentation requires texture image dimensions to be a power of two. Default is true, but this member will be set appropriately when GL is inited.

Implements vtkMathTextUtilities.

Set to true if the graphics implmentation requires texture image dimensions to be a power of two. Default is true, but this member will be set appropriately when GL is inited.

Implements vtkMathTextUtilities.

Returns a matplotlib.font_manager.FontProperties PyObject, initialized from the vtkTextProperty tprop.

Cleanup and destroy any python objects. This is called during destructor as well as when the Python interpreter is finalized. Thus this class must handle the case where the internal python objects disappear between calls.

void vtkMatplotlibMathTextUtilities::RotateCorners ( double  angleDeg,
double  corners[4][2],
double  bbox[4] 
) [protected]
bool vtkMatplotlibMathTextUtilities::PrepareImageData ( vtkImageData data,
int  bbox[4] 
) [protected]
static void vtkMatplotlibMathTextUtilities::CheckMPLAvailability ( ) [static, protected]

Member Data Documentation

vtkPythonInterpreter* vtkMatplotlibMathTextUtilities::Interpreter [protected]

Definition at line 102 of file vtkMatplotlibMathTextUtilities.h.

Definition at line 103 of file vtkMatplotlibMathTextUtilities.h.

Definition at line 104 of file vtkMatplotlibMathTextUtilities.h.

Definition at line 105 of file vtkMatplotlibMathTextUtilities.h.

Definition at line 121 of file vtkMatplotlibMathTextUtilities.h.


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