Version: 6.3.1

src/VISUGUI/VisuGUI_SetupPlot2dDlg.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : VisuGUI_SetupPlot2dDlg.h
00024 //  Author : Vadim SANDLER
00025 //  Module : SALOME
00026 //
00027 #ifndef VISUGUI_SetupPlot2dDlg_H
00028 #define VISUGUI_SetupPlot2dDlg_H
00029 
00030 #include "Plot2d_Curve.h"
00031 
00032 #include <SALOMEDSClient_SObject.hxx>
00033 
00034 #include <QDialog>
00035 #include <QList>
00036 
00037 //=================================================================================
00038 // class    : VisuGUI_SetupPlot2dDlg
00039 // purpose  : Dialog box for setup Plot2d view
00040 //=================================================================================
00041 
00042 class QScrollArea;
00043 class QPushButton;
00044 class QLabel;
00045 class QCheckBox;
00046 class QComboBox;
00047 class SalomeApp_IntSpinBox;
00048 class QToolButton;
00049 class VisuGUI_ItemContainer;
00050 class QtxColorButton;
00051 
00052 class VisuGUI_SetupPlot2dDlg : public QDialog
00053 { 
00054   Q_OBJECT
00055 
00056 public:
00057   VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent = 0 );
00058   ~VisuGUI_SetupPlot2dDlg();
00059 
00060   void getCurves( QList<Plot2d_Curve*>& container );
00061   void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& ver2Indexes, QList<int>& zIndexes );
00062   bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
00063 
00064 private:
00065   void keyPressEvent( QKeyEvent* e );
00066 
00067 private slots:
00068   void onHBtnToggled( bool );
00069   void onVBtnToggled( bool );
00070   void onV2BtnToggled( bool );
00071   void onHelp();
00072   void enableControls();
00073 
00074 private:
00075   QScrollArea*                myView;
00076   QPushButton*                myOkBtn;
00077   QPushButton*                myCancelBtn;
00078   QPushButton*                myHelpBtn;
00079   QList<VisuGUI_ItemContainer*> myItems;
00080 
00081   _PTR(SObject)               myObject;
00082 };
00083 
00084 class VisuGUI_ItemContainer : public QObject
00085 {
00086   Q_OBJECT
00087 
00088 public:
00089   VisuGUI_ItemContainer( QObject* parent = 0 );
00090   
00091   void   createWidgets( QWidget* parentWidget, const QStringList& );
00092   void   enableWidgets( bool enable );
00093 
00094   void   setHorizontalOn( bool on );
00095   bool   isHorizontalOn() const;
00096   void   setVerticalOn( bool on );
00097   bool   isVerticalOn() const;
00098   void   setVertical2On( bool on );
00099   bool   isVertical2On() const;
00100   bool   isAutoAssign() const;
00101   void   setAutoAssign( bool on );
00102   void   setLine( const int line, const int width );
00103   int    getLine() const;
00104   int    getLineWidth() const;
00105   void   setMarker( const int marker );
00106   int    getMarker() const;
00107   void   setColor( const QColor& color );
00108   QColor getColor() const;
00109   int    assigned() const;
00110 
00111 protected:
00112   void   updateState();
00113 
00114 signals:
00115   void   autoClicked();
00116   void   horToggled( bool );
00117   void   verToggled( bool );
00118   void   ver2Toggled( bool );
00119 
00120 public slots:
00121   void   onAutoChanged();
00122 //void   onColorChanged();
00123   void   onHVToggled( bool );
00124 
00125 public:
00126   bool                  myEnabled;
00127   QToolButton*          myHBtn;
00128   QToolButton*          myVBtn;
00129   QToolButton*          myV2Btn;
00130   QLabel*               myTitleLab;
00131   QLabel*               myUnitLab;
00132   QCheckBox*            myAutoCheck;
00133   QComboBox*            myLineCombo;
00134   SalomeApp_IntSpinBox* myLineSpin;
00135   QComboBox*            myMarkerCombo, *myAssigned;
00136   QtxColorButton*       myColorBtn;
00137 };
00138 
00139 #endif // VISUGUI_SetupPlot2dDlg_H
00140 
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS