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 #ifndef VIEWERTOOLS_CUBEAXESDLGBASE_H 00024 #define VIEWERTOOLS_CUBEAXESDLGBASE_H 00025 00026 #include "ViewerTools_DialogBase.h" 00027 00028 #include <QFrame> 00029 00030 class QWidget; 00031 class QPushButton; 00032 class QTabWidget; 00033 class QCheckBox; 00034 class QGroupBox; 00035 class QLineEdit; 00036 00037 class QtxAction; 00038 class QtxIntSpinBox; 00039 00040 class ViewerTools_FontWidgetBase; 00041 00046 class VIEWERTOOLS_EXPORT ViewerTools_AxisWidgetBase : public QFrame 00047 { 00048 public: 00049 ViewerTools_AxisWidgetBase( QWidget* ); 00050 ~ViewerTools_AxisWidgetBase(); 00051 00052 void UseName( const bool ); 00053 void SetName( const QString& ); 00054 void SetNameFont( const QColor&, const int, const bool, const bool, const bool ); 00055 00056 public: 00057 virtual void initialize(); 00058 00059 protected: 00060 virtual ViewerTools_FontWidgetBase* createFontWidget( QWidget* ) = 0; 00061 00062 protected: 00063 // name 00064 QGroupBox* myNameGrp; 00065 QLineEdit* myAxisName; 00066 ViewerTools_FontWidgetBase* myNameFont; 00067 00068 // labels 00069 QGroupBox* myLabelsGrp; 00070 QtxIntSpinBox* myLabelNumber; 00071 QtxIntSpinBox* myLabelOffset; 00072 ViewerTools_FontWidgetBase* myLabelsFont; 00073 00074 // tick marks 00075 QGroupBox* myTicksGrp; 00076 QtxIntSpinBox* myTickLength; 00077 }; 00078 00083 class VIEWERTOOLS_EXPORT ViewerTools_CubeAxesDlgBase : public ViewerTools_DialogBase 00084 { 00085 Q_OBJECT 00086 00087 public: 00088 ViewerTools_CubeAxesDlgBase(QtxAction* theAction, 00089 QWidget* theParent, 00090 const char* theName); 00091 virtual ~ViewerTools_CubeAxesDlgBase(); 00092 00093 virtual void initialize(); 00094 00095 virtual void Update(); 00096 00097 protected slots: 00098 virtual void onOk(); 00099 virtual bool onApply(); 00100 virtual void onClose(); 00101 00102 protected: 00103 virtual QWidget* createButtonFrame( QWidget* ); 00104 virtual QWidget* createMainFrame ( QWidget* ); 00105 virtual bool isValid() const; 00106 00107 virtual ViewerTools_AxisWidgetBase* createAxisWidget( QWidget* ) = 0; 00108 00109 protected: 00110 QTabWidget* myTabWg; 00111 QCheckBox* myIsVisible; 00112 00113 QPushButton* myOkBtn; 00114 QPushButton* myApplyBtn; 00115 QPushButton* myCloseBtn; 00116 ViewerTools_AxisWidgetBase* myAxes[ 3 ]; 00117 }; 00118 00119 #endif