__init__.py 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. r"""
  2. Currently, this package is experimental and may change in the future.
  3. """
  4. from __future__ import absolute_import
  5. import sys
  6. def _windows_dll_path():
  7. import os
  8. _vtk_python_path = 'bin/Lib/site-packages/vtkmodules'
  9. _vtk_dll_path = 'bin'
  10. # Compute the DLL path based on the location of the file and traversing up
  11. # the installation prefix to append the DLL path.
  12. _vtk_dll_directory = os.path.dirname(os.path.abspath(__file__))
  13. # Loop while we have components to remove.
  14. while _vtk_python_path not in ('', '.', '/'):
  15. # Strip a directory away.
  16. _vtk_python_path = os.path.dirname(_vtk_python_path)
  17. _vtk_dll_directory = os.path.dirname(_vtk_dll_directory)
  18. _vtk_dll_directory = os.path.join(_vtk_dll_directory, _vtk_dll_path)
  19. if os.path.exists(_vtk_dll_directory):
  20. # We never remove this path; it is required for VTK to work and there's
  21. # no scope where we can easily remove the directory again.
  22. _ = os.add_dll_directory(_vtk_dll_directory)
  23. # Build tree support.
  24. try:
  25. from . import _build_paths
  26. # Add any paths needed for the build tree.
  27. for path in _build_paths.paths:
  28. if os.path.exists(path):
  29. _ = os.add_dll_directory(path)
  30. except ImportError:
  31. # Relocatable install tree (or non-Windows).
  32. pass
  33. # CPython 3.8 added behaviors which modified the DLL search path on Windows to
  34. # only search "blessed" paths. When importing SMTK, ensure that SMTK's DLLs are
  35. # in this set of "blessed" paths.
  36. if sys.version_info >= (3, 8) and sys.platform == 'win32':
  37. _windows_dll_path()
  38. #------------------------------------------------------------------------------
  39. # this little trick is for static builds of VTK. In such builds, if
  40. # the user imports this Python package in a non-statically linked Python
  41. # interpreter i.e. not of the of the VTK-python executables, then we import the
  42. # static components importer module.
  43. def _load_vtkmodules_static():
  44. if 'vtkmodules_vtkCommonCore' not in sys.builtin_module_names:
  45. import _vtkmodules_static
  46. #_load_vtkmodules_static()
  47. #------------------------------------------------------------------------------
  48. # list the contents
  49. __all__ = [
  50. 'vtkCommonCore',
  51. 'vtkWebCore',
  52. 'vtkCommonMath',
  53. 'vtkCommonTransforms',
  54. 'vtkCommonDataModel',
  55. 'vtkCommonExecutionModel',
  56. 'vtkIOCore',
  57. 'vtkImagingCore',
  58. 'vtkIOImage',
  59. 'vtkIOXMLParser',
  60. 'vtkIOXML',
  61. 'vtkCommonMisc',
  62. 'vtkFiltersCore',
  63. 'vtkRenderingCore',
  64. 'vtkRenderingContext2D',
  65. 'vtkRenderingFreeType',
  66. 'vtkRenderingSceneGraph',
  67. 'vtkRenderingVtkJS',
  68. 'vtkIOExport',
  69. 'vtkWebGLExporter',
  70. 'vtkFiltersGeneral',
  71. 'vtkFiltersSources',
  72. 'vtkInteractionWidgets',
  73. 'vtkViewsCore',
  74. 'vtkViewsContext2D',
  75. 'vtkTestingRendering',
  76. 'vtkIOLegacy',
  77. 'vtkDomainsChemistry',
  78. 'vtkRenderingHyperTreeGrid',
  79. 'vtkRenderingUI',
  80. 'vtkRenderingOpenGL2',
  81. 'vtkRenderingVolume',
  82. 'vtkRenderingRayTracing',
  83. 'vtkImagingMath',
  84. 'vtkRenderingVolumeOpenGL2',
  85. 'vtkRenderingVolumeAMR',
  86. 'vtkRenderingParallel',
  87. 'vtkInteractionStyle',
  88. 'vtkRenderingVR',
  89. 'vtkRenderingOpenXR',
  90. 'vtkRenderingOpenVR',
  91. 'vtkRenderingMatplotlib',
  92. 'vtkRenderingLabel',
  93. 'vtkRenderingLICOpenGL2',
  94. 'vtkRenderingContextOpenGL2',
  95. 'vtkRenderingLookingGlass',
  96. 'vtkImagingFourier',
  97. 'vtkIOXdmf2',
  98. 'vtkIOVeraOut',
  99. 'vtkIOVPIC',
  100. 'vtkIOTecplotTable',
  101. 'vtkIOTRUCHAS',
  102. 'vtkIOSegY',
  103. 'vtkIOXdmf3',
  104. 'vtkIOParallelXML',
  105. 'vtkIOLSDyna',
  106. 'vtkIOParallelLSDyna',
  107. 'vtkIOExodus',
  108. 'vtkIOParallelExodus',
  109. 'vtkIOGeometry',
  110. 'vtkIOParallel',
  111. 'vtkIOPLY',
  112. 'vtkIOPIO',
  113. 'vtkIOOpenVDB',
  114. 'vtkIOMovie',
  115. 'vtkIOOggTheora',
  116. 'vtkIOOMF',
  117. 'vtkIONetCDF',
  118. 'vtkIOMotionFX',
  119. 'vtkIOInfovis',
  120. 'vtkCommonColor',
  121. 'vtkImagingSources',
  122. 'vtkInfovisCore',
  123. 'vtkIOImport',
  124. 'vtkParallelCore',
  125. 'vtkIOIOSS',
  126. 'vtkIOH5part',
  127. 'vtkIOH5Rage',
  128. 'vtkRenderingGL2PSOpenGL2',
  129. 'vtkIOExportGL2PS',
  130. 'vtkIOEnSight',
  131. 'vtkIOCityGML',
  132. 'vtkIOChemistry',
  133. 'vtkIOCONVERGECFD',
  134. 'vtkIOHDF',
  135. 'vtkIOCGNSReader',
  136. 'vtkIOAsynchronous',
  137. 'vtkIOAMR',
  138. 'vtkIOADIOS2',
  139. 'vtkIOGDAL',
  140. 'vtkImagingColor',
  141. 'vtkRenderingAnnotation',
  142. 'vtkImagingHybrid',
  143. 'vtkFiltersPython',
  144. 'vtkFiltersProgrammable',
  145. 'vtkFiltersModeling',
  146. 'vtkFiltersPoints',
  147. 'vtkFiltersVerdict',
  148. 'vtkFiltersParallelVerdict',
  149. 'vtkFiltersStatistics',
  150. 'vtkFiltersParallelStatistics',
  151. 'vtkFiltersExtraction',
  152. 'vtkFiltersGeometry',
  153. 'vtkFiltersHybrid',
  154. 'vtkFiltersHyperTree',
  155. 'vtkFiltersTexture',
  156. 'vtkFiltersParallel',
  157. 'vtkCommonSystem',
  158. 'vtkFiltersParallelDIY2',
  159. 'vtkFiltersImaging',
  160. 'vtkImagingGeneral',
  161. 'vtkFiltersGeneric',
  162. 'vtkCommonComputationalGeometry',
  163. 'vtkFiltersFlowPaths',
  164. 'vtkFiltersAMR',
  165. 'vtkDomainsChemistryOpenGL2',
  166. 'vtkChartsCore',
  167. 'vtkAcceleratorsVTKmCore',
  168. 'vtkAcceleratorsVTKmDataModel',
  169. 'vtkAcceleratorsVTKmFilters',
  170. 'all',
  171. 'gtk',
  172. 'numpy_interface',
  173. 'qt',
  174. 'test',
  175. 'tk',
  176. 'util',
  177. 'wx',
  178. ]
  179. #------------------------------------------------------------------------------
  180. # get the version
  181. __version__ = "9.2.20220823"