Salome HOME
Updated copyright comment
[modules/gui.git] / tools / CurvePlot / src / python / controller / __init__.py
1 # Copyright (C) 2016-2024  CEA, EDF
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 """
21 CurvePlot Python package.
22 """
23 try:
24   # Some unicode chars are improperly rendered with the default 'tkagg' backend (delta for ex)
25   # and the Bitstream font which is the first one by default. Try to use DejaVu which is more 
26   # comprehensive.
27   ## !!Order of the sequence below is highly sensitive!!
28   import pyqtside   # will trigger the PySide/PyQt switch
29   import matplotlib
30   matplotlib.use('Qt5Agg')
31   import matplotlib.pyplot as plt  # must come after the PySide/PyQt switch!
32   plt.rcParams['font.sans-serif'].insert(0, "DejaVu Sans")
33 except:
34   print("Warning: could not switch matplotlib to 'Qt5agg' backend. Some characters might be displayed improperly!")
35
36 from .PlotController import PlotController
37 from .TableModel import TableModel
38 from .CurveModel import CurveModel
39 from .PlotManager import PlotManager
40 from .XYPlotSetModel import XYPlotSetModel
41
42 ## The static API of PlotController is the main interface of the package and is hence exposed at package level:
43 AddCurve = PlotController.AddCurve
44 AddPlotSet = PlotController.AddPlotSet
45 ExtendCurve = PlotController.ExtendCurve
46 ResetCurve = PlotController.ResetCurve
47 CopyCurve = PlotController.CopyCurve
48 DeleteCurve = PlotController.DeleteCurve
49 DeletePlotSet = PlotController.DeletePlotSet
50 ClearPlotSet = PlotController.ClearPlotSet
51 SetXLabel = PlotController.SetXLabel
52 SetYLabel = PlotController.SetYLabel
53 GetPlotSetID = PlotController.GetPlotSetID
54 GetPlotSetIDByName = PlotController.GetPlotSetIDByName
55 GetAllPlotSets = PlotController.GetAllPlotSets
56 GetCurrentCurveID = PlotController.GetCurrentCurveID
57 GetCurrentPlotSetID = PlotController.GetCurrentPlotSetID
58 SetCurrentCurve = PlotController.SetCurrentCurve
59 SetCurrentPlotSet = PlotController.SetCurrentPlotSet
60 DeleteCurrentItem = PlotController.DeleteCurrentItem
61 SetCurveMarker = PlotController.SetCurveMarker
62 SetCurveLabel = PlotController.SetCurveLabel
63 SetXLog = PlotController.SetXLog
64 SetYLog = PlotController.SetYLog
65 SetXSciNotation = PlotController.SetXSciNotation
66 SetYSciNotation = PlotController.SetYSciNotation
67 RegisterCallback = PlotController.RegisterCallback
68 ClearCallbacks = PlotController.ClearCallbacks
69 GetSalomeViewID = PlotController.GetSalomeViewID
70 SetLegendVisible = PlotController.SetLegendVisible
71 SetPlotSetTitle = PlotController.SetPlotSetTitle
72
73 # For advanced usage only:
74 GetInstance = PlotController.GetInstance
75 LockRepaint = PlotController.LockRepaint
76 UnlockRepaint = PlotController.UnlockRepaint
77