1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU VISUGUI : GUI of VISU component
23 // File : VisuGUI_CutPlanesDlg.h
24 // Author : Laurent CORNABE & Hubert ROLLAND
28 #ifndef VISUGUI_CUTPLANESDLG_H
29 #define VISUGUI_CUTPLANESDLG_H
31 #include "VisuGUI_Prs3dDlg.h"
33 #include <SALOME_Actor.h>
35 #include <QtxDoubleSpinBox.h>
46 #include "SALOMEconfig.h"
47 #include CORBA_CLIENT_HEADER(VISU_Gen)
58 class SUIT_ViewWindow;
59 class SUIT_ViewManager;
60 class SalomeApp_Module;
61 class VisuGUI_InputPane;
63 class VisuGUI_CutPlanesPane : public QFrame
68 VisuGUI_CutPlanesPane (QWidget* parent);
69 ~VisuGUI_CutPlanesPane();
71 void setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );}
72 int getNbPlanes() {return nbPlan->value();}
73 void setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */);
74 VISU::CutPlanes::Orientation getOrientaion();
75 void setRotation( const double r1, const double r2 );
76 double getRotation1() {return Rot1->value();}
77 double getRotation2() {return Rot2->value();}
79 double getScaleFactor();
80 void setScaleFactor(double factor);
82 void initFromPrsObject(VISU::CutPlanes_i* thePrs);
83 int storeToPrsObject(VISU::CutPlanes_i* thePrs);
86 typedef std::vector<QString> TVectorialFieldsList;
87 typedef std::map<VISU::Entity, TVectorialFieldsList> TEntity2VectorialFields;
88 typedef std::pair<VISU::Entity,TVectorialFieldsList> TEntVectPair;
89 TEntity2VectorialFields myEntity2VectorialFields;
94 void InitEntity2VectorialFieldsMap(VISU::ColoredPrs3d_i* thePrs);
95 void InsertAllVectorialFields();
96 void InitVectorialField();
100 QGroupBox* GDeformation;
102 QtxDoubleSpinBox* Rot1;
103 QtxDoubleSpinBox* Rot2;
107 QtxDoubleSpinBox* myPosSpn;
108 QTableWidget* myPosTable;
109 SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes;
110 QCheckBox* myPreviewCheck;
111 QComboBox* myVectorialFieldCombo;
112 QtxDoubleSpinBox* myScaleSpn;
118 SALOME_Actor* myPreviewActor;
121 void orientationChanged( int );
123 void setDefault( int all = -1);
124 void onValueChanged(int theRow, int theCol);
125 void onRotation(double theValue);
126 void onPreviewCheck(bool thePreview);
127 void onScaleFactorChanged(double);
128 void onDeformationCheck(bool);
129 void onVectorialFieldChanged(int);
133 class VisuGUI_CutPlanesDlg : public VisuGUI_ScalarBarBaseDlg
138 VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule);
139 ~VisuGUI_CutPlanesDlg();
141 virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
144 virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
147 virtual QString GetContextHelpFilePath();
154 QTabWidget* myTabBox;
155 VisuGUI_CutPlanesPane* myCutPane;
156 VisuGUI_InputPane* myInputPane;
157 SALOME::GenericObjPtr<VISU::CutPlanes_i> myPrsCopy;
161 /*class VisuGUI_NumEditItem: public QTableItem
164 VisuGUI_NumEditItem(QTableWidget* table, const QString& text ):
165 QTableItem(table, et, text) {};
166 ~VisuGUI_NumEditItem() {};
168 QWidget* createEditor() const;
171 #endif // VISUGUI_CUTPLANESDLG_H