diff --git a/tools/Paraview macros/gprMax_info.py b/tools/Paraview macros/gprMax_info.py new file mode 100644 index 00000000..74063bc6 --- /dev/null +++ b/tools/Paraview macros/gprMax_info.py @@ -0,0 +1,91 @@ +# Copyright (C) 2015-2016: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +from paraview.simple import * +from xml.etree import ElementTree as ET + +# Disable automatic camera reset on 'Show' +paraview.simple._DisableFirstRenderCameraReset() + +# Get whatever source is loaded (should be model) +model = GetActiveSource() + +# Get display properties +dp = GetDisplayProperties(model) + +# Get active view +renderview = GetActiveView() + +# Show data in view +Show(model, renderview) + +# Reset view to fit data +renderview.ResetCamera() + +# Lists to hold material and sources/receiver identifiers written in VTK file in tags and +materials = [] +srcsrxs = [] +with open(model.FileName[0], 'r') as f: + for line in f: + if line.startswith('