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 // VISU VISUGUI : GUI of VISU component 00024 // File : VisuGUI_CutPlanesDlg.h 00025 // Author : Laurent CORNABE & Hubert ROLLAND 00026 // Module : VISU 00027 // $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_CutPlanesDlg.h,v 1.15.2.1.6.1.8.1 2011-06-02 06:00:21 vsr Exp $ 00028 // 00029 #ifndef VISUGUI_CUTPLANESDLG_H 00030 #define VISUGUI_CUTPLANESDLG_H 00031 00032 #include "VisuGUI_Prs3dDlg.h" 00033 00034 #include <SALOME_Actor.h> 00035 #include <SalomeApp_IntSpinBox.h> 00036 #include <SalomeApp_DoubleSpinBox.h> 00037 00038 #include <QFrame> 00039 00040 class QRadioButton; 00041 class QTabWidget; 00042 class QTableWidget; 00043 class QCheckBox; 00044 class QComboBox; 00045 00046 #include "SALOMEconfig.h" 00047 #include CORBA_CLIENT_HEADER(VISU_Gen) 00048 00049 #include <map> 00050 #include <vector> 00051 00052 namespace VISU 00053 { 00054 class CutPlanes_i; 00055 class Result_i; 00056 }; 00057 00058 class SUIT_ViewWindow; 00059 class SUIT_ViewManager; 00060 class SalomeApp_Module; 00061 class VisuGUI_InputPane; 00062 00063 class VisuGUI_CutPlanesPane : public QFrame 00064 { 00065 Q_OBJECT 00066 00067 public: 00068 VisuGUI_CutPlanesPane (QWidget* parent); 00069 ~VisuGUI_CutPlanesPane(); 00070 00071 void setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );} 00072 int getNbPlanes() {return nbPlan->value();} 00073 void setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */); 00074 VISU::CutPlanes::Orientation getOrientaion(); 00075 void setRotation( const double r1, const double r2 ); 00076 double getRotation1() {return Rot1->value();} 00077 double getRotation2() {return Rot2->value();} 00078 00079 double getScaleFactor(); 00080 void setScaleFactor(double factor); 00081 00082 void initFromPrsObject(VISU::CutPlanes_i* thePrs); 00083 int storeToPrsObject(VISU::CutPlanes_i* thePrs); 00084 00085 private: 00086 typedef std::vector<QString> TVectorialFieldsList; 00087 typedef std::map<VISU::Entity, TVectorialFieldsList> TEntity2VectorialFields; 00088 typedef std::pair<VISU::Entity,TVectorialFieldsList> TEntVectPair; 00089 TEntity2VectorialFields myEntity2VectorialFields; 00090 00091 void createPlanes(); 00092 void deletePlanes(); 00093 00094 void InitEntity2VectorialFieldsMap(VISU::ColoredPrs3d_i* thePrs); 00095 void InsertAllVectorialFields(); 00096 void InitVectorialField(); 00097 00098 QLabel* LabelRot1; 00099 QLabel* LabelRot2; 00100 QGroupBox* GDeformation; 00101 SalomeApp_IntSpinBox* nbPlan; 00102 SalomeApp_DoubleSpinBox* Rot1; 00103 SalomeApp_DoubleSpinBox* Rot2; 00104 QRadioButton* RBzx; 00105 QRadioButton* RByz; 00106 QRadioButton* RBxy; 00107 SalomeApp_DoubleSpinBox* myPosSpn; 00108 QTableWidget* myPosTable; 00109 SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes; 00110 QCheckBox* myPreviewCheck; 00111 QComboBox* myVectorialFieldCombo; 00112 SalomeApp_DoubleSpinBox* myScaleSpn; 00113 double X1, X2; 00114 double Y1, Y2; 00115 double Z1, Z2; 00116 bool hasInit; 00117 00118 SALOME_Actor* myPreviewActor; 00119 00120 private slots: 00121 void orientationChanged( int ); 00122 void DrawTable(); 00123 void setDefault( int all = -1); 00124 void onValueChanged(int theRow, int theCol); 00125 void onRotation(double theValue); 00126 void onPreviewCheck(bool thePreview); 00127 void onScaleFactorChanged(double); 00128 void onDeformationCheck(bool); 00129 void onVectorialFieldChanged(int); 00130 }; 00131 00132 00133 class VisuGUI_CutPlanesDlg : public VisuGUI_ScalarBarBaseDlg 00134 { 00135 Q_OBJECT 00136 00137 public: 00138 VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule); 00139 ~VisuGUI_CutPlanesDlg(); 00140 00141 virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, 00142 bool theInit ); 00143 00144 virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); 00145 00146 protected: 00147 virtual QString GetContextHelpFilePath(); 00148 00149 protected slots: 00150 void accept(); 00151 void reject(); 00152 00153 private: 00154 QTabWidget* myTabBox; 00155 VisuGUI_CutPlanesPane* myCutPane; 00156 VisuGUI_InputPane* myInputPane; 00157 SALOME::GenericObjPtr<VISU::CutPlanes_i> myPrsCopy; 00158 }; 00159 00160 00161 /*class VisuGUI_NumEditItem: public QTableItem 00162 { 00163 public: 00164 VisuGUI_NumEditItem(QTableWidget* table, const QString& text ): 00165 QTableItem(table, et, text) {}; 00166 ~VisuGUI_NumEditItem() {}; 00167 00168 QWidget* createEditor() const; 00169 };*/ 00170 00171 #endif // VISUGUI_CUTPLANESDLG_H