1. 29 Jun, 2015 1 commit
    • David C. Lonie's avatar
      Defer matplotlib initialization for text rendering. · bdf3b4c2
      David C. Lonie authored
      Rather than querying for matplotlib when
      vtkMatplotlibMathTextUtilities is constructed, check only when
      the library is needed. This saves some start up time for e.g.
      ParaView when mathtext is not used.
      Some additional changes are required due to a change in behavior:
      vtkMatplotlibMathTextUtilities::New() used to return NULL when
      matplotlib was not found to signal that mathtext was unavailable.
      The vtkMathTextUtilities::IsAvailable() virtual method has been
      added to allow querying of the availability, now that New() can
      return a valid object when matplotlib is unavailable.
  2. 14 May, 2015 1 commit
  3. 25 Mar, 2015 1 commit
    • David C. Lonie's avatar
      Improve appearance of small-sized mathtext. · f5ee8c17
      David C. Lonie authored
      The alpha mask returned by Matplotlib for mathtext renderings
      appears very dim when font size is small.
      This patch uses the same trick in MatplotlibMathTextUtilities
      as FreeTypeTools, which doesn't blend RGB values when the
      background alpha == 0. This gives a bolder appearance to the
      text, like it was before the text background color options
      were added.
      Also clamped the tprop opacity setters to [0., 1.] and updated
      a baseline that had small mathtext.
  4. 14 Jan, 2015 2 commits
  5. 16 Oct, 2014 1 commit
    • David C. Lonie's avatar
      Improve aligned and rotated text. · 125149a5
      David C. Lonie authored
      This patch fixes aligned rotated text by anchoring the rendered image
      or path to the location described by the text property's justification
      As a result, alignment options are no longer ignored by the vtkTextActor3D.
      Change-Id: I6640b6dc8d579b408ac85670b732b7c94763a5d7
  6. 07 Aug, 2014 1 commit
    • Shawn Waldon's avatar
      Add a smartpointer for PyObjects · f9a208d6
      Shawn Waldon authored
      This refactors the SmartPyObject class from a local class in
      vtkMatplotlibMathTextUtilities.cxx to be externally visible.  This class
      is duplicated several places in Paraview and this refactor will allow
      code to be shared between all places that need it.  It is added to the
      vtkWrappingPythonCore module as the vtkSmartPyObject class.
      This commit also refactors the vtkPythonAlgorithm to use the new smart
      This commit is part of a change to ParaView and thus the topic name
      reflects that change and not the change to VTK.
      Change-Id: If3f0387bb7bb24f823dbe690e64a0a8bb1e0df16
  7. 09 Jul, 2014 1 commit
  8. 18 Jun, 2014 1 commit
  9. 13 May, 2013 1 commit
    • Utkarsh Ayachit's avatar
      Added a new module, vtkPythonInterpreter. · be75a19a
      Utkarsh Ayachit authored
      VTK now includes a Utilities module, vtkPythonInterpreter that provides a Python
      interpreter. While its use it totally optional, it helps in applications with
      embedded Python interpreter, such as ParaView.
      vtkMatplotlibMathTextUtilities now uses vtkPythonInterpreter to initialize
      Python. This enables applications to setup Python environment as needed witout
      directly having to hack environment variables to setup matplotlib environment.
      Since vtkPythonInterpreter allows applications to initialize/finalize Python
      interpreter mutliple times, fixed vtkPythonCommand to cleanup
      PyObject/PyThreadState pointers when Python interpreter is exitted.
      Change-Id: I80ed56fc3f64dda2766a6aa2e6e92c3aa7290993
  10. 18 Apr, 2013 1 commit
    • David C. Lonie's avatar
      Remove the MathTextActor classes. · d978780f
      David C. Lonie authored
      * Converted tests to use regular TextActors.
      * Fixed the MathText path generator to rotate paths if needed.
      * Update the GL2PS text export code to check for mathtext
        strings, since mathtext/freetype are both handled by the same
      * Made vtkTextRenderer::DetectBackend public so we can peek at
        the backend from the export code.
      Change-Id: I52ba3c1e916c70dd80b67d59b611db1becb0846c
  11. 08 Mar, 2013 1 commit
  12. 28 Jan, 2013 1 commit
  13. 17 Jan, 2013 1 commit
  14. 15 Jan, 2013 1 commit
  15. 12 Jan, 2013 1 commit
    • Kyle Lutz's avatar
      Fix segfault in vtkMatplotlibMathTextUtilities destructor · 169c9bf5
      Kyle Lutz authored
      Several of the ParaView Python tests fail with a segfault in the
      destructor of the vtkMatplotlibMathTextUtilities when it calls
      Py_Finalize(). This changes the destructor to only call Py_Finalize()
      if vtkMatplotlibMathTextUtilities itself called Py_Initialize().
      Change-Id: I7fab0273a65c6e6784f1acf4266dfc53594d5fca
  16. 04 Jan, 2013 1 commit
  17. 03 Jan, 2013 1 commit
    • David C. Lonie's avatar
      Work around API changes in python. · c0b56815
      David C. Lonie authored
      Rather than disabling matplotlib, define the missing typedef when
      python is older than 2.6.
      Note: Matplotlib still isn't supported on these
      versions, this change just allows the module to build. A runtime check
      will still fail when importing matplotlib.
      Change-Id: Id5cd18cf9ea07e115104cecc16b7d1c83c46d6f1
  18. 02 Jan, 2013 1 commit
  19. 31 Dec, 2012 1 commit
    • David C. Lonie's avatar
      Make MPL rendering less verbose. · 8fc892b8
      David C. Lonie authored
      Only print rendering errors and python exceptions in
      vtkMatplotlibMathTextUtilities when debugging is turned on. Also set
      vtkMatplotlibMathTextUtilities::Debug to true when the
      VTK_MATPLOTLIB_DEBUG env var is defined.
      Change-Id: Iabe1295c9c72cc820c76b8df615d2b97fb9a6a1e
  20. 30 Dec, 2012 1 commit
  21. 21 Dec, 2012 1 commit
    • David C. Lonie's avatar
      Add more environment variables to configure/debug matplotlib. · 10ff04a8
      David C. Lonie authored
      This class is aware of a number of enviroment variables that can be used to
      configure and debug python initialization (all are optional):
      - VTK_MATPLOTLIB_DEBUG: Enable verbose debugging output during initialization
        of the python environment.
      - VTK_MATPLOTLIB_PYTHONINTERP: Path to the python interpreter. This will be
        passed to Py_SetProgramName prior to calling Py_Initialize.
      - VTK_MATPLOTLIB_PYTHONHOME: See the Python documentation on the PYTHONHOME
        environment variable. This will be passed to Py_SetPythonHome prior to
        calling Py_Initialize.
      - VTK_MATPLOTLIB_PYTHONPATH: A list of additional python module paths to be
        prepended to the sys.path object after initialization. Use ';' on windows and
        ':' on apple/linux to separate multiple paths.
      Change-Id: I00613c3254750d26de350514a426fe24ce26f732
  22. 19 Dec, 2012 2 commits
  23. 13 Dec, 2012 2 commits
    • David C. Lonie's avatar
      Add multiline, justification, and shadows to vtkFreeTypeTools. · 6dd7b574
      David C. Lonie authored
      Also, explicitly return text dimensions from text rasterization
      functions. Older hardware requires texture image dimensions to be
      powers of 2. Since the text will only be rendered into a portion of
      the image in these cases, the text dimensions are needed to calculate
      the texture coordinates during rendering.
      Some classes were hiding the text dimensions in the image metadata, e.g.
      texture coordinates and text dimensions were stored in Spacing and Origin.
      This undocumented behavior was confusing and unintuitive.
      Now functions that rendering scaled images explicitly return the text
      Change-Id: Ic74b0dd9573d336427038985c671a8b724c92429
    • David C. Lonie's avatar
      Add GetConstrainedFontSize to FTTools and MTUtilities. · 5c14d896
      David C. Lonie authored
      Add a method to compute the font size needed to make text rendered
      by FreeTypeTools or MathTextUtilities fill a specified rectangle.
      The documentation of vtkTextMapper::GetConstrainedFontSize is
      clarified, too.
      Change-Id: I39de26b5173153eaec9e8f5f2857fe9964bad768
      s constrained -- add note about updated docs for tmapper
      Change-Id: Ib8c042285aabc719fe57825c05d85b6ab2b59c4b
  24. 28 Nov, 2012 1 commit
  25. 27 Nov, 2012 1 commit
  26. 05 Nov, 2012 1 commit
    • David C. Lonie's avatar
      Check for matplotlib at runtime. · e1a03c70
      David C. Lonie authored
      This change allows the RenderingMatplotlib module to be built without
      finding matplotlib at configure time.
      Change-Id: Iee352157d533cdf0bd7a23fcd0807b4dd6547c89
  27. 01 Oct, 2012 2 commits
    • Dave DeMarle's avatar
      Fix may be used uninitialized warnings. · 85752e97
      Dave DeMarle authored
      We get:
      /home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx: In member function virtual bool vtkMatplotlibMathTextUtilities::StringToPath(const char*, vtkPath*, vtkTextProperty*):
      /home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx:728:74: warning: origin[0] may be used uninitialized in this function [-Wmaybe-uninitialized]
      /home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx:728:74: warning: origin[1] may be used uninitialized in this function [-Wmaybe-uninitialized]
      /home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx:727:9: warning: hasOrigin may be used uninitialized in this function [-Wmaybe-uninitialized]
      From the case: pathClosePoly code path.
      I think the correct solution is to initialize the hasOrigin flag to no but I could be wrong.
      Change-Id: Ia3fbc63bb0bb2898aca173ea63801e05ae8937a5
    • Dave DeMarle's avatar
      Fix -Wnarrowing compilation warnings. · d9ab6e3f
      Dave DeMarle authored
      Change-Id: I0ed7c091a7fe50c5afde9e5c70b5aa71144917fd
      warning: narrowing conversion of 'cols' from 'long int' to 'double' inside { } is ill-formed in C++11
  28. 10 Sep, 2012 1 commit
  29. 30 Aug, 2012 1 commit
  30. 28 Aug, 2012 1 commit
    • David C. Lonie's avatar
      Add GetBoundingBox and use rotations in MathTextUtils. · ee51878e
      David C. Lonie authored
      This patch adds a GetBoundingBox function to vtkMathTextUtilities
      and applies rotations from the supplied vtkTextProperty.
      The matplotlib MathText interface doesn't have an entry point to
      just get the bounding box, so the image is rendered by python as normal,
      and then the dimensions are returned.
      The MathText library doesn't support rendering rotated text directly,
      so a vtkImageReslice filter is used to rotate the image.
      Change-Id: I65be970af47c7f8de65f6279c922b6b001f62780
  31. 14 Aug, 2012 1 commit
  32. 31 Jul, 2012 1 commit
    • David C. Lonie's avatar
      Add a vtkMatplotlib module. · c2f54b97
      David C. Lonie authored
      * Isolates python dependency away from MathText
      * Adds tests for MathText functionality.
      Change-Id: Ib0f87248e7f73ead5d1904b72e7053537907bfd1