# This is the default pyFormex config file. DO NOT CHANGE IT!  -*- Python -*-
##
##  This file is part of pyFormex 2.3  (Mon Feb 22 15:38:03 CET 2021)
##  pyFormex is a tool for generating, manipulating and transforming 3D
##  geometrical models by sequences of mathematical operations.
##  Home page: http://pyformex.org
##  Project page:  http://savannah.nongnu.org/projects/pyformex/
##  Copyright 2004-2020 (C) Benedict Verhegghe (benedict.verhegghe@ugent.be)
##  Distributed under the GNU General Public License version 3 or later.
##
##  This program 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.
##
##  This program 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 this program.  If not, see http://www.gnu.org/licenses/.
##

"""pyformexrc

This is the global configuration file for pyFormex. It should always
be present in the installation path and never be changed from the
installed defaults.

Changes should go to /etc/pyformex.conf (for site-wide changes)
or to ~/.config/pyformex/pyformex.conf (for personal settings).
If your are missing these files, you can safely copy (parts of) this file
as a start.
Many of these settings can also be changed from the pyFormex GUI, using the
Settings->Settings Dialog.

Config settings are read from the following files in order:
this file, /etc/pyformex.conf, ~/.config/pyformex/pyformex.conf.
The last settings override previous ones.

The config files are read by the :class:`config.Config`.
This means that the syntax is a subset of Python.
Two config variables are already set on entry: `pyformexdir`, `homedir`
"""

import os

# files and directories
homedir = Path.home()
workdir = Path('.')
icondir = pyformexdir / 'icons'
fontsdir = pyformexdir / 'fonts'
examplesdir = pyformexdir / 'examples'
scriptsdir = pyformexdir / 'scripts'
appsdir = pyformexdir / 'appsdir'       # can not be apps !!!
datadir = pyformexdir / 'data'
shaderdir = pyformexdir / 'glsl'
bindir = pyformexdir / 'bin'
testdir = pyformexdir / 'test'
userconfdir = homedir / '.config' / 'pyformex'
downloaddir = homedir / 'Downloads'
siteprefs = Path('/etc/pyformex.conf')
localprefs = Path('pyformex.conf')
autorun = userconfdir / 'startup.py'
scripttemplate = datadir / 'template.py'
logfile = userconfdir / 'pyformex.log'
curfile = ''
curproj = ''

# extra paths to append tot sys.path
syspath = []

# commands
### THESE MAY BE CHANGED BY THE INSTALLATION PROCEDURE
editor = os.environ.get('VISUAL', '')
viewer = 'firefox'   # html viewer
browser = 'firefox'  # web browser
fortune = 'fortune -s'  # command to generate a fortune cookie

# scriptdirs is a list of (title,dir) tuples
# for 'examples', the directory will be filled in automagically
scriptdirs = [('Examples', ''), ('Scripts', '')]
appdirs = [('Examples', ''), ('Apps', '')]
# subdirectories to search for source files (for --search option)
sourcedirs = ['gui', 'menus', 'plugins', 'apps', 'scripts', 'examples', 'lib', 'opengl']
# searchdirs are the paths outside pyformex also searched with --search option
searchdirs = []

autoglobals = True
showapploaderrors = False
openlastproj = False
uselib = True
check_print = True

# prefered system for creating 2d plots
plot2d = 'matplotlib'


[warnings]
nice = True    # Show nicely formatted warnings when possible
popup = True   # Show warnings in a popup window (in gui version)
reset = False   # Reset warning filters to Python defaults before loading ours
# Warnings to be filtered out: a set of tuples (message,module,category,action)
# category and action are 1 character strings (see utils)
# module, category and action have defaults
# Example: filters = {('warn_viewport_switching',)}
# The message should match the START of the message. Add a $ for full string.
# Warnings from upstream packages can be filtered out here
# Beware! continuation characters are required if multiline
filters = { \
#    ("'U' mode is deprecated", 'docutils'), \
    (".*return_index", 'numpy'), \
#    ("the matrix subclass is not the recommended way", 'numpy', 'P'), \
}

[fonts]
ignore = ['NotoColorEmoji.ttf']

[gui]
bindings = 'any'   # allows any binding
# Available bindings (in order of preference)
# 'pyside2', 'pyside', 'pyqt5', 'pyqt4'

fortune = False  # show a fortune cookie on startup
redirect = False
history = []
scripthistory = []
apphistory = []
history_max = 20

# icondirs: list of paths to search for icons, first match wins
icondirs = [icondir/'64x64', icondir]
# icontypes: list of icon types, first match wins
icontypes = ['.png', '.xpm', '.gif']
# splash image
splash = icondir / 'pyformex-splash.png'

plugins = ['geometry_menu']
style = "Plastique"
fontfamily = "Sans"
fontsize = 9
spacing = 2         # defines spacing between items in input dialogs
size=(800, 600)
bdsize=size
pos=(0, 0)
maximized = False
fullscreen = False
boxmargins = (0, 0, 0, 0)
exitconfirm = 'smart'  # other options: 'never', 'always'
dooze = 0.0
rst2html = True      # rst text is converted to html for nice display

interpreter = ''     # set to 'Python' or 'IPython' to add interactive console
console = 'b'        # 'b' is board, 'c' is console, 'bc' is both

menu = ['File', 'Settings', 'Viewport', 'Camera', 'Actions', 'Globals', 'Help']

prefsmenu = True     # add settings menu menu
viewportmenu = True  # add viewport menu
cameramenu = True    # add camera menu
viewmenu = True      # add views menu
examplesmenu = True  # add examples menu

camerabar = 'top'     # add camera toolbar to top toolbar space
modebar = 'top'       # add rendemode toolbar to top toolbar space
viewbar = 'left'      # add views toolbar to left toolbar space

# Default action buttons for current app
all_actionbuttons = ['play', 'rerun', 'step', 'continue', 'stop', 'edit', 'info' ]
actionbuttons = ['play', 'rerun', 'continue', 'edit', 'info']

wirebutton = True    # add wire button to toolbar
transbutton = True   # add transparency button to toolbar
normalsbutton = True  # add normals button to toolbar
lightbutton = True    # add light button to toolbar
shrinkbutton = False  # add shrink button to toolbar
timeoutbutton = False  # add timeout button to toolbar
timeoutvalue = 2      # timeout after this number of seconds
coordsbox = False     # add coords display widget to toolbar

frontview = 'xy'       # If 'xy' or 'xz', standard views are set automatically
# defviews = [('front','view-xr-yu'),('back','view-xl-yu'),\
#             ('right','view-zl-yu'),('left','view-zr-yu'),\
#             ('top','view-xr-zd'),('bottom','view-xr-zu'),\
#             ('iso','view-iso1'),\
#             ]
zoomfactor = 1.05      # zooming factor for zoom buttons
rotfactor = 7.5        # rotation angle for rotation buttons
panfactor = 0.05       # translation factor for pan buttons
autozoomfactor = 1.732  # enlargement factor for the autozoom (sqrt(3))
wheelzoomfactor = -0.25  # enlargement factor for the wheelzoom
dynazoom = ['area', 'dolly']     # preferred zoom technique ('area', 'dolly', 'lens' or 'none')
wheelzoom = 'area'    # action performed by the wheel ('area', 'dolly', 'lens')

# Which modifier keys are to be used during picking to
# - move (pan, rotate, zoom)
# - set selection
# - add to selection
# - remove from selection
# Available modifier names are 'NONE', 'SHIFT', 'CTRL', 'ALT', 'META'
mouse_mod_move = ['NONE', 'ALT', 'META']
mouse_mod_set = 'SHIFT'
mouse_mod_add = 'NONE'
mouse_mod_remove = 'CTRL'

# Put buttons at the top in dialogs
buttonsattop = True
allow_old_dialog_items = False
showfocus = True
easter_egg = True
startup_warning = 'warn_default_gl'

layout = 1

wireframe_mode = 'smart'    # set to 'gl' for old behavior

# These files will be displayed in FileSelection sidebar
sidebarfiles = [ \
    Path.home(), \
    pyformexdir, \
    datadir, \
    examplesdir, \
    '/', \
    ]

##########################
# Default canvas settings
##########################
# This should only contain the keys that are also in CanvasSettings
# Other canvas related settings can be added to the [draw] section
[canvas]
bgmode = 'solid'        # one of 'solid', 'vert', 'hor', 'full'
bgcolor = 'grey90'      # background color (single color or list of 2 or 4)
bgimage = ''            # background image, filename
fgcolor = 'black'       # default drawing color
bkcolor = ''            # if defined, backsides of planes have this color
slcolor = 'orange'      # highlighting color
colormap = ['darkgrey', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'white', \
    'black', 'darkred', 'darkgreen', 'darkblue', 'darkcyan', 'darkmagenta', 'darkyellow', 'lightgrey']
bkcolormap = colormap
smooth = False              # smooth shading off
fill = False                # polygon filling off
lighting = False            # default lights off
alphablend = False          # alphablend (transparency) off
culling = False             # culling off
avgnormals = False
transparency = 0.5          # default transparency value
pointsize = 4.0             # size of points
linewidth = 1.0             # width of lines
linestipple = (0, 1)         # line stipple (factor,pattern)
marksize = 0.4              # size of 3D marks
marktype = 'sphere'         # type of 3D mark
wiremode = -1               # which edges to display


# Separate section because canvas is under stricter control
[canvasgrid]
showgrid = False     # show grid by default
size = 0             # 0 means size of current canvas ! does not resize !
spacing = 100        # spacing between lines
linewidth = 1        # line thickness
color = 'black'      # line color
twocolor = False     # use two colors alternately
color2 = 'grey80'    # second line color
ontop = True         # show the lines above the rendering

[draw]
rendermode = 'smooth'    # default rendering mode
numbersontop = True
wait = 0.0  # time(sec.) to wait between draw operations
flywait = 0.3  # time(sec.) to wait between subsequent views in auto flying
localaxes = True     # by default, buttons rotate/pan in local axes
quadline = ['line3']
quadsurf = []  # [ 'quad8', 'quad9', 'hex20' ]
avgnormalsize = '_auto_'
picksize=(12, 12)  # size of the pick window
disable_depth_test = False

[material]
# The material coefficients define how much of the respective light types
# is re-emitted (not absorbed) by the material
# All values are in the range 0..1, except shininess, which is
# currently 1..100
# It is good to keep the ambient value to 1.0, and to set ambient
# by the global ambient lighting (plus light ambient) only
matte = dict(ambient=1.0, diffuse=0.8, specular=0.2, emission=0.0, shininess=1.0)
default = dict(ambient=0.6, diffuse=0.4, specular=0.2, emission=0.1, shininess=2.0)
plastic = dict(ambient=1.0, diffuse=0.9, specular=0.7, emission=0.0, shininess=4.0)
metal = dict(ambient=1.0, diffuse=0.1, specular=0.9, emission=0.0, shininess=8.0)

[light]
# Light sources add extra light above the global ambient light (see [render])
# pyFormex currently has a maximum of 4 lights.
# Each light can emit 3 types of light: ambient, diffuse and specular.
# The values are (RGB) tuples, though a single float may be specified
# to just give the intensity of a white light source.
# The light position is (XYZW), though currently all lights are assumed
# to be at infinite distance (W=0)

light0 = {'enabled': True, 'ambient': 0.2, 'diffuse': 0.6, 'specular': 0.4, 'position': (1., 1., 2.)}
light1 = {'enabled': True, 'ambient': 0.2, 'diffuse': 0.6, 'specular': 0.2, 'position': (0., 1., 2.)}
light2 = {'enabled': True, 'ambient': 0.2, 'diffuse': 0.4, 'specular': 0.4, 'position': (0., 0., 1.)}
light3 = {'enabled': False, 'ambient': 0.2, 'diffuse': 0.8, 'specular': 0.0, 'position': (1., -1., 1.)}

[render]
mode = 'wireframe'
lightmodel = 'ambient and diffuse'  # currently only model supported
ambient = 0.6     # global ambient lighting: a tuple (RGB) or white intensity
material = 'default'  # the name of a material defined above
lights = ['light0', 'light1', 'light2']  # a list of enabled lights
avgnormaltreshold = 0.5
line = '2'  # '1' or '2'; if '1', quadratic lines are shown as linear
surface = '1'  # '1' or '2'; if '1', quadratic surfaces are shown as linear
volume = True  # if False, volumes are shown as their border surface
# Experimental features: only use if you know what you are doing
experimental = False
alphablend = 'trad'  # One of 'trad', 'mult', 'add', 'sort', 'door'
textblend = 'oneminus'
transp_nocull = False

[help]
htmldir = pyformexdir / 'doc' / 'html'
localdoc = htmldir / 'index.html'
refman = htmldir / 'refman.html'
tutorial = htmldir / 'tutorial.html'
index = htmldir / 'genindex.html'
modindex = htmldir / 'py-modindex.html'
running = htmldir / 'running.html'
readme = pyformexdir / 'doc' / 'README.rst'
notes = pyformexdir / 'doc' / 'ReleaseNotes'
license = pyformexdir / 'doc' / 'LICENSE'
style = pyformexdir / 'doc' / 'STYLE'
website = "http://pyformex.org"
webdoc = website+"/doc-2.0"
projpage = "http://savannah.nongnu.org/projects/pyformex/"
support = "http://savannah.nongnu.org/support/?func=additem&group=pyformex"
bugs = "http://savannah.nongnu.org/bugs/?func=additem&group=pyformex"
links = [('pyFormex', 'pyformex.org'), ('pyFormex-dev', projpage), ('Python', 'www.python.org'), ('IBiTech-bioMMeda', 'www.biommeda.ugent.be'), ('FEops', 'www.feops.com'), ]
docs = [('&Online documentation', webdoc), ('&Local documentation', localdoc), ('&Reference Manual', refman), ('Tutorial', tutorial), ('&Running pyFormex', running), ('&Module Index', modindex), ('&Index', index), ]
docs2 = [('&Readme', readme), ('&ReleaseNotes', notes), ('&License', license)]


[keys]
save = 'F2'


[surface]
stlread = '.off'


[mail]
sender = ''
server = 'localhost'

[jobs]
hosts = ['localhost']
host = 'localhost'
inputdir = '~'
outputdir = '~'
cmd_abaqus = 'abaqus job=$F cpus=$C'
cmd_calculix = 'ccx -i $F'
abqver = ['6.11', '6.12']


[prop]
matdb = datadir / 'materials.db'
secdb = datadir / 'sections.db'


[webgl]
script = "https://net.feops.com/public/webgl/fewgl-0.2.js"
guiscript = "https://net.feops.com/public/webgl/xtk_xdat.gui.js"
autogui = True
devel = False
devpath = pyformexdir / 'opengl'
logo = 'http://pyformex.org/images/pyformex_createdby.png'
logo_link = 'http://pyformex.org'
avoid_fewgl_read_pgf_bug = True


#End
