X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_Service.h;h=1d9a5576c6b5c9005006def9214220f409b70380;hb=ea7f29f75031ca13b9454f5e9ac73730f1f584eb;hp=3857650afb939004549009218148e27ae1a0fbaa;hpb=d2ea75950816c9bb41f70a80a8c4339d3d0ff9a5;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_Service.h b/src/SUPERVGUI/SUPERVGUI_Service.h index 3857650..1d9a557 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.h +++ b/src/SUPERVGUI/SUPERVGUI_Service.h @@ -1,9 +1,29 @@ -// File : SUPERVGUI_Service.h -// Created : 7 / 11 / 2001 -// Author : Francis KLOSS -// Project : SALOME -// Module : SUPERVGUI -// Copyright : CEA +// SUPERV SUPERVGUI : GUI for Supervisor component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SUPERVGUI_Service.h +// Author : Francis KLOSS +// Module : SUPERV #ifndef SUPERVGUI_Service_H #define SUPERVGUI_Service_H @@ -14,15 +34,17 @@ using namespace std; #include #include +class QListBox; -//***************************************************** -// Pane for Python script editing -//***************************************************** +/*! + * Pane for Python script editing + */ class SUPERVGUI_PythonEditPane: public QFrame { + Q_OBJECT - public: - SUPERVGUI_PythonEditPane(QWidget* theParent); +public: + SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY ); ~SUPERVGUI_PythonEditPane() {}; QString getFuncName(); @@ -33,51 +55,75 @@ class SUPERVGUI_PythonEditPane: public QFrame { SUPERV_Strings getFunction(); void setFunction(SUPERV_Strings theStr); - public slots: +public slots: + // load all functions from an XML file into internal structures void loadFile(); - void readFunction(); - private: + // when user presses "Enter" - automatically set indentation of next line + void autoIndentLine(); - //QLineEdit* myNameEdt; - //QLineEdit* myParamEdt; - QTextEdit* myText; - //QLineEdit* myOutParamEdt; - QPushButton* myNextBtn; + // when user select another function name in combo box - fill myText with its body + void readFunction( int i ); - QTextStream* myIStream; - QFile* myFile; -}; + // when user presses "Library" button - open a "Create node from Library" dialog + void library(); + +private: + bool myIsWithLibrary; + QTextEdit* myText; + QComboBox* myFunctionsCombo; + + // fills myPyFunctions list. called from loadFile() after user selects a file. + void initPyFunctions( QTextStream& ); + + // list of Python functions. filled in loadFile(), strings (functions) retrieved + // in readFunction() + QStringList myPyFunctions; + int& myX; // comes from SUPERVGUI_Service + int& myY; // comes from SUPERVGUI_Service -//***************************************************** -// Dialog box for node creation -//***************************************************** +}; +/*! + * Dialog box for node creation + */ class SUPERVGUI_Service: public QDialog { + Q_OBJECT - public: +public: SUPERVGUI_Service(SALOME_NamingService* ns); ~SUPERVGUI_Service(); void choose(); - protected: + /*! + * Do the following actions for newly created Engine's CNode: + * 1. Create a presentation for it (CanvasNode) + * 2. Place the CanvasNode to the current top-left corner or the current viewport + * 3. Increment the coordinates of the next CanvasNode (new nodes are "cascaded" when several of them are created at once) + * PS theEndNode is passed only for Loop and Switch nodes (EndLoop and EndSwitch) + */ + static void addNode( SUPERV::CNode_var theNode, SUPERV::INode_var theEndNode, int& theX, int& theY ); + +protected: void showEvent(QShowEvent* theEvent); - private: +private: void initialise(); - private slots: +private slots: void tabChanged(QWidget *); void addComputeNode(); void addFactoryNode(); void addInlineNode(); + void addMacroNode(); void typeNodeSelected(int theRow); + void loadGraph(); - private: - QListView* components; +private: + QListView* components; SALOME_NamingService* naming; int myX, myY; QWidgetStack* myStackWidget; @@ -90,6 +136,9 @@ class SUPERVGUI_Service: public QDialog { SUPERVGUI_PythonEditPane* myMorePane; SUPERVGUI_PythonEditPane* myNextPane; + QListView* myMacroPane; + QFile* myMFile; + QTabWidget* myTabPane; bool myIsInline; @@ -100,9 +149,10 @@ class SUPERVGUI_Service: public QDialog { * Edit Python dialog */ class SUPERVGUI_EditPythonDlg: public QDialog { + Q_OBJECT - public: +public: SUPERVGUI_EditPythonDlg(bool isLoop = false); ~SUPERVGUI_EditPythonDlg() {}; @@ -149,7 +199,7 @@ class SUPERVGUI_EditPythonDlg: public QDialog { void setNextFunction(SUPERV_Strings theStr) { myNextPane->setFunction(theStr); } - private: +private: SUPERVGUI_PythonEditPane* myEditPane; SUPERVGUI_PythonEditPane* myInitPane; SUPERVGUI_PythonEditPane* myMorePane;