Salome HOME
0022565: [CEA 1145] Missing WT_NoteBook in python:
[modules/gui.git] / src / SALOME_PYQT / SalomePyQt / SalomePyQt.h
index f413631ccfb8bde7897a68c08caac17663fb7813..6d3a0122a2b0e291ca99e2dab7db4c373292df5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include <QColor>
 
 #include <LightApp_Application.h>
+#ifndef GUI_DISABLE_CORBA
+#include <SalomeApp_Application.h>
+#endif
 #include <LightApp_Preferences.h>
+#include <Plot2d_ViewFrame.h>
 
 class LightApp_SelectionMgr;
 class QMenuBar;
@@ -42,6 +46,7 @@ class QWidget;
 class QAction;
 class QTreeView;
 class QtxActionGroup;
+class Plot2d_Curve;
 
 class SALOME_Selection : public QObject
 {
@@ -78,6 +83,9 @@ enum MenuName {
 
 enum {
   WT_ObjectBrowser = LightApp_Application::WT_ObjectBrowser,
+#ifndef GUI_DISABLE_CORBA
+  WT_NoteBook      = SalomeApp_Application::WT_NoteBook,
+#endif
   WT_PyConsole     = LightApp_Application::WT_PyConsole,
   WT_LogWindow     = LightApp_Application::WT_LogWindow,
   WT_User          = LightApp_Application::WT_User
@@ -115,6 +123,32 @@ enum Action {
   SplitAt      = 2  //!< the view area is splitted in such a way, that specified view and all views which follow it, are moved to the new area
 };
 
+//! Type of titles in Plot3d View
+enum ObjectType
+{
+  MainTitle = Plot2d_ViewFrame::MainTitle,
+  XTitle = Plot2d_ViewFrame::XTitle,
+  YTitle = Plot2d_ViewFrame::YTitle,
+  Y2Title = Plot2d_ViewFrame::Y2Title,
+  XAxis = Plot2d_ViewFrame::XAxis,
+  YAxis = Plot2d_ViewFrame::YAxis,
+  Y2Axis = Plot2d_ViewFrame::Y2Axis
+};
+
+enum VisibilityState 
+{
+  ShownState,             //!< Object is shown in viewer
+  HiddenState,            //!< Object is hidden in viewer
+  UnpresentableState      //!< Unpresentable object    
+};
+
+enum Axis {
+  yLeft    = QwtPlot::yLeft,
+  yRight   = QwtPlot::yRight,
+  xBottom  = QwtPlot::xBottom,
+  xTop     = QwtPlot::xTop,
+};     
+
 class SalomePyQt
 {
 public:
@@ -151,6 +185,13 @@ public:
   static QString           getName( const QString& );
   static QString           getToolTip( const QString& );
 
+  static void              setVisibilityState( const QString&, VisibilityState );
+  static VisibilityState   getVisibilityState( const QString& );
+
+  static void              setObjectPosition( const QString&, int );
+  static int               getObjectPosition( const QString& );
+
+
   static void              setColor( const QString&, const QColor& );
   static QColor            getColor( const QString& );
 
@@ -161,7 +202,7 @@ public:
 
   static void              helpContext( const QString&, const QString& );
 
-  static bool              dumpView( const QString& );
+  static bool              dumpView( const QString&, const int = 0 );
 
   static int               defaultMenuGroup();
 
@@ -228,10 +269,11 @@ public:
   static QString           getViewTitle( const int );
   static QList<int>        findViews( const QString& );
   static bool              activateView( const int );
-  static int               createView( const QString& );
+  static int               createView( const QString&, bool visible = true, const int width = 0, const int height = 0 );
   static int               createView( const QString&, QWidget* );
   static bool              closeView( const int );
   static int               cloneView( const int );
+  static void              setViewVisible( const int id, bool visible = true );
   static bool              isViewVisible( const int );
   static void              setViewClosable( const int, const bool );
   static bool              isViewClosable( const int );
@@ -241,6 +283,16 @@ public:
   static bool              moveView( const int, const int, const bool );
   static QList<int>        neighbourViews( const int );
 
+  static void              displayCurve(const int, Plot2d_Curve*);
+  static void              eraseCurve(const int, Plot2d_Curve*);
+  static void              eraseCurve(Plot2d_Curve*);
+  static void              updateCurves( const int );
+  static QString           getPlot2dTitle(const int, ObjectType = MainTitle);
+  static void              setPlot2dTitle(const int, const QString&, ObjectType = MainTitle, bool = true);
+  static QList<double>     getPlot2dFitRangeByCurves(const int);
+  static QList<double>     getPlot2dFitRangeCurrent(const int);
+  static void              setPlot2dFitRange(const int, const double XMin, const double XMax, const double YMin, const double YMax);
+
   // the following methods are obsolete
   static void              addStringSetting( const QString&, const QString&, bool = true );
   static void              addIntSetting   ( const QString&, const int,      bool = true );