Exemple #1
0
    # '.dat': _vtk.vtkFLUENTReader, # TODO: not working
    # '.cube': _vtk.vtkGaussianCubeReader, # Contains `atom_types` which are note supported?
    '.res': _vtk.vtkMFIXReader, # TODO: not tested
    '.foam': _vtk.vtkOpenFOAMReader,
    # '.pdb': _vtk.vtkPDBReader, # Contains `atom_types` which are note supported?
    '.p3d': _vtk.lazy_vtkPlot3DMetaReader,
    '.pts': _vtk.vtkPTSReader,
    # '.particles': _vtk.vtkParticleReader, # TODO: not tested
    #TODO: '.pht': _vtk.vtkPhasta??????,
    #TODO: '.vpc': _vtk.vtkVPIC?????,
    # '.bin': _vtk.lazy_vtkMultiBlockPLOT3DReader,# TODO: non-default routine
    '.tri': _vtk.vtkMCubesReader,
    '.inp': _vtk.vtkAVSucdReader,
}

VTK_MAJOR = _vtk.vtkVersion().GetVTKMajorVersion()
VTK_MINOR = _vtk.vtkVersion().GetVTKMinorVersion()

if (VTK_MAJOR >= 8 and VTK_MINOR >= 2):
    try:
        READERS['.sgy'] = _vtk.lazy_vtkSegYReader
        READERS['.segy'] = _vtk.lazy_vtkSegYReader
    except AttributeError:
        pass


def _get_ext_force(filename, force_ext=None):
    if force_ext:
        return str(force_ext).lower()
    else:
        return get_ext(filename)
Exemple #2
0
# Per contract with Sphinx-Gallery, this method must be available at top level
from pyvista.utilities.sphinx_gallery import _get_sg_image_scraper

global_theme = _GlobalTheme()
rcParams = _rcParams()  # raises DeprecationError when used

# Set preferred plot theme
if 'PYVISTA_PLOT_THEME' in os.environ:
    set_plot_theme(os.environ['PYVISTA_PLOT_THEME'].lower())

# get the int type from vtk
ID_TYPE = _get_vtk_id_type()

# determine if using vtk > 5
if _vtk.vtkVersion().GetVTKMajorVersion() <= 5:
    raise RuntimeError('VTK version must be 5.0 or greater.')

# catch annoying numpy/vtk future warning:
warnings.simplefilter(action='ignore', category=FutureWarning)

# A simple flag to set when generating the documentation
OFF_SCREEN = False
try:
    if os.environ['PYVISTA_OFF_SCREEN'].lower() == 'true':
        OFF_SCREEN = True
except KeyError:
    pass

# flag for when building the sphinx_gallery
BUILDING_GALLERY = False