Salome HOME
Merge from V6_main 01/04/2013
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_DocumentPanel.hxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef __HEXABLOCKGUI_DOCUMENTPANEL_HXX_
20 #define __HEXABLOCKGUI_DOCUMENTPANEL_HXX_
21
22
23 #if defined WIN32
24 #  if defined HEXABLOCKGUI_DOCUMENTPANEL_EXPORT || defined HexablockGui_DocumentPanel_EXPORTS
25 #    define HEXABLOCKGUI_DOCUMENTPANEL_EXPORT __declspec( dllexport )
26 #  else
27 #    define HEXABLOCKGUI_DOCUMENTPANEL_EXPORT __declspec( dllimport )
28 #  endif
29 #else
30 #  define HEXABLOCKGUI_DOCUMENTPANEL_EXPORT
31 #endif
32
33
34 #define MAX_WIDTH 16777215
35 #define MAX_HEIGHT 16777215
36 #define MIN_WIDTH 0
37 #define MIN_HEIGHT 0
38
39 #include <QShortcut>
40 #include <QDockWidget>
41
42 #include "ui_Vertex_QTD.h"
43 #include "ui_Quad_QTD.h"
44 #include "ui_Edge_QTD.h"
45 #include "ui_Hexa_QTD.h"
46
47 #include "ui_Vector_QTD.h"
48 #include "ui_Cylinder_QTD.h"
49 #include "ui_Pipe_QTD.h"
50 #include "ui_MakeGrid_QTD.h"
51 #include "ui_MakePipe_QTD.h"
52 #include "ui_MakeCylinder_QTD.h"
53 #include "ui_MakeCylinders_QTD.h"
54 #include "ui_MakePipes_QTD.h"
55 #include "ui_RemoveHexa_QTD.h"
56 #include "ui_PrismQuad_QTD.h"
57 #include "ui_JoinQuad_QTD.h"
58 #include "ui_Merge_QTD.h"
59 #include "ui_Disconnect_QTD.h"
60 #include "ui_CutEdge_QTD.h"
61 #include "ui_Transformation_QTD.h"
62 #include "ui_Symmetry_QTD.h"
63
64 #include "ui_EdgeAssoc_QTD.h"
65 #include "ui_QuadAssoc_QTD.h"
66
67 #include "ui_Group_QTD.h"
68 #include "ui_Law_QTD.h"
69 #include "ui_Propagation_QTD.h"
70
71
72 #include "ui_QuadRevolution_QTD.h"
73 #include "ui_MakeRind_QTD.h"
74 #include "ui_ReplaceHexa_QTD.h"
75 #include "ui_MakeHemiSphere_QTD.h"
76 #include "ui_ModelInfo_QTD.h"
77 #include "ui_AddShapeDialog_QTD.h"
78
79
80 #include "MyGEOMBase_Helper.hxx"
81
82
83
84 #include "HexVertex.hxx"
85 #include "HexEdge.hxx"
86 #include "HexQuad.hxx"
87 #include "HexHexa.hxx"
88
89
90 #include "HEXABLOCKGUI_DocumentSelectionModel.hxx"
91 #include "HEXABLOCKGUI_DocumentModel.hxx"
92 #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
93 // #include "HEXABLOCKGUI_SalomeTools.hxx"
94 #include "HEXABLOCKGUI.hxx"
95
96 #include "klinkitemselectionmodel.hxx"
97
98
99 Q_DECLARE_METATYPE(QModelIndex);
100 Q_DECLARE_METATYPE(HEXABLOCK::GUI::DocumentModel::GeomObj);
101 Q_DECLARE_METATYPE(GEOM::GeomObjPtr);
102
103 // class MyBasicGUI_PointDlg;
104
105 namespace HEXABLOCK
106 {
107   namespace GUI
108   {
109     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT HexaBaseDialog : public QDialog, public MyGEOMBase_Helper
110     {
111       Q_OBJECT
112
113     public:
114       enum Mode {
115         NEW_MODE,
116         INFO_MODE,
117         UPDATE_MODE
118       };
119
120       // define input widget type => usefull for selection
121       typedef HexaTreeRole  HexaWidgetType;
122       typedef TopAbs_ShapeEnum/*int */GeomWidgetType; //CS_TODO
123
124       // TopAbs_ShapeEnum aType = TopAbs_EDGE;
125
126       // listwidget
127       enum {
128         LW_QMODELINDEX_ROLE = Qt::UserRole + 1,
129             LW_ASSOC_ROLE,
130             LW_GEOM_OBJ_ROLE,
131             LW_DATA_ROLE
132       };
133
134       HexaBaseDialog( QWidget * parent = 0, Mode editmode = NEW_MODE, Qt::WindowFlags f = 0 );
135       virtual ~HexaBaseDialog(){};
136
137       // clear all input widget
138       virtual void clear(){};
139
140       void connectDocumentGraphicView(VtkDocumentGraphicView* docGView = NULL);
141       void disconnectDocumentGraphicView(VtkDocumentGraphicView* docGView = NULL);
142
143       SVTK_ViewWindow* getCurrentVtkView() const {
144           return HEXABLOCKGUI::currentDocGView->getViewWindow();
145       }
146
147       //get model
148       DocumentModel* getDocumentModel() const {
149          return HEXABLOCKGUI::currentDocGView->getDocumentModel();
150       }
151
152       PatternDataModel* getPatternDataModel() const {
153           return HEXABLOCKGUI::currentDocGView->getPatternDataModel();
154       }
155
156       PatternGeomModel* getPatternGeomModel() const {
157           return HEXABLOCKGUI::currentDocGView->getPatternGeomModel();
158       }
159
160       PatternBuilderModel* getPatternBuilderModel() const {
161           return HEXABLOCKGUI::currentDocGView->getPatternBuilderModel();
162       }
163
164       GroupsModel* getGroupsModel() const {
165           return HEXABLOCKGUI::currentDocGView->getGroupsModel();
166       }
167
168       MeshModel* getMeshModel() const {
169           return HEXABLOCKGUI::currentDocGView->getMeshModel();
170       }
171
172       //get selection patterns from the current graphic view
173       PatternDataSelectionModel* getPatternDataSelectionModel() const {
174          return HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
175       }
176
177       PatternBuilderSelectionModel* getPatternBuilderSelectionModel() const {
178          return HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
179       }
180
181       PatternGeomSelectionModel* getPatternGeomSelectionModel() const {
182           return HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
183       }
184
185       GroupsSelectionModel* getGroupsSelectionModel() const {
186          return HEXABLOCKGUI::currentDocGView->getGroupsSelectionModel();
187       }
188
189       MeshSelectionModel* getMeshSelectionModel() const {
190          return HEXABLOCKGUI::currentDocGView->getMeshSelectionModel();
191       }
192
193       HEXABLOCKGUI::ViewType getObjectViewType(QObject* obj);
194       void modelUnregister(QWidget* widget); //unlink the widget from the model
195       void resetSizeAndShow(QDockWidget* parent);
196       void lockSizeToSizeHint();
197       void unlockSizeModification();
198       virtual QModelIndexList getAssocsVTK()
199       {
200         QModelIndexList assocs;
201         return assocs;
202       }
203       virtual QMultiMap<QString, int> getAssocsGEOM()
204       {
205         QMultiMap<QString, int> assocs;
206         return assocs;
207       }
208       virtual void setCurrentGeomObj(DocumentModel::GeomObj* geomObj) {}
209
210       bool debugEdgeAssoc; //Temporary
211       bool autoFocusSwitch;
212
213     public slots:
214     //virtual void accept();
215     virtual bool apply();
216     virtual void close();
217     virtual void onHelpRequested();
218     void highlightSelectedAssocs();
219     void refreshHighlight();
220     virtual void onWindowActivated(SUIT_ViewManager*){};
221     void clearVTKSelection();
222     void clearOCCSelection();
223     void clearCurrentObjectFocus();
224
225     protected:
226     virtual bool eventFilter(QObject *obj, QEvent *event);
227     virtual void hideEvent ( QHideEvent * event );
228     virtual void showEvent ( QShowEvent * event );
229     virtual bool apply(QModelIndex& result) = 0;
230
231     //Gives a default name to an element according to the last created
232     void updateDefaultName(QLineEdit* name_field, HEXA_NS::EnumElt type);
233     DocumentModel::GeomObj* getGeomObj(const QModelIndex& index);
234
235     virtual void _initInputWidget( Mode editmode )=0; //must be implemented on inherited dialog box
236     virtual QGroupBox*  _initButtonBox( Mode editmode );
237     void _initWidget( Mode editmode ); // call _initInputWidget() & _initButtonBox()
238     QModelIndexList getIndexList(QListWidget* itemsList);
239
240     void _initViewManager();
241
242     void _allowSelection();
243     void _disallowSelection();
244     QItemSelectionModel* _allowSelection( HexaWidgetType wtype );
245
246     bool _allowVTKSelection( QObject* obj );
247     bool _allowOCCSelection( QObject* obj );
248     QItemSelectionModel* _getSelector( QObject* obj );
249
250
251     bool _onSelectionChanged( const QItemSelection& sel, QLineEdit*   le );
252     bool _onSelectionChanged( const QItemSelection& sel, QListWidget* lw );
253
254     void _selectAndHighlight( const QModelIndex& i );
255
256     void _highlightWidget(QObject* obj, Qt::GlobalColor clr);
257
258     void setFocusToNextField();
259
260     void _updateCurrentObject(QObject*);
261
262     Mode _editMode;
263
264     QMap<QObject*, QModelIndex>   _index;
265     QObject*                      _currentObj;
266
267     int                           _expectedSelection;
268     bool                          _selectionMutex;
269
270     QMap<HexaWidgetType, QString>  _strHexaWidgetType;
271
272     //QPushButton* _applyCloseButton;
273     QPushButton* _applyButton;
274
275     QString  _helpFileName;
276
277     private:
278     bool _isLineOrListWidget(QObject*);
279
280     protected slots:
281     virtual void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel ); //from qt model/view selectionManager
282     virtual void onCurrentSelectionChanged();//from salome selectionManager
283     virtual void updateButtonBox();
284     void updateName();
285     virtual void selectElementOfModel();
286
287     };
288
289
290
291     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT VertexDialog : public HexaBaseDialog,
292     public Ui::VertexDialog
293     {
294       Q_OBJECT
295
296     public:
297       VertexDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
298       virtual ~VertexDialog();
299
300       void clear();
301
302       void setValue(HEXA_NS::Vertex* v);
303       HEXA_NS::Vertex* getValue();
304
305       void setIndex(const QModelIndex& i);
306
307     public slots:
308     virtual bool apply(QModelIndex& result);
309     //         void updateName();
310
311     protected:
312     void _initInputWidget( Mode editmode );
313
314     private:
315     HEXA_NS::Vertex     *_value;
316     QModelIndex         _ivalue;
317     };
318
319
320     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT EdgeDialog : public HexaBaseDialog,
321     public Ui::EdgeDialog
322     {
323       Q_OBJECT
324
325     public:
326       EdgeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
327       virtual ~EdgeDialog();
328
329       void clear();
330
331       void setValue(HEXA_NS::Edge* e);
332       HEXA_NS::Edge* getValue();
333
334     protected:
335       void _initInputWidget( Mode editmode );
336
337     public slots:
338     virtual bool apply(QModelIndex& result);
339     //         void updateName();
340
341     private:
342     HEXA_NS::Edge *_value;
343     QModelIndex   _ivalue;
344     };
345
346
347     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT QuadDialog : public HexaBaseDialog,
348     public Ui::QuadDialog
349     {
350       Q_OBJECT
351
352     public:
353       QuadDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
354       virtual ~QuadDialog();
355
356       void clear();
357
358       void setValue(HEXA_NS::Quad* v);
359       HEXA_NS::Quad* getValue();
360
361     public slots:
362     virtual bool apply(QModelIndex& result);
363     //         void updateName();
364
365     protected:
366     void _initInputWidget( Mode editmode );
367
368     private:
369     HEXA_NS::Quad    *_value;
370     QModelIndex      _ivalue;
371     };
372
373
374
375     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT HexaDialog : public HexaBaseDialog,
376     public Ui::HexaDialog
377     {
378       Q_OBJECT
379
380     public:
381       HexaDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
382       virtual ~HexaDialog();
383
384       void clear();
385       virtual QModelIndexList getAssocsVTK();
386
387       void setValue(HEXA_NS::Hexa* v);
388       HEXA_NS::Hexa* getValue();
389
390     public slots:
391     virtual bool apply(QModelIndex& result);
392
393     protected:
394     void _initInputWidget( Mode editmode );
395
396     protected slots:
397     void deleteQuadItem();
398     void deleteVertexItem();
399     void updateButtonBox();
400
401     private:
402     void _setValueQuads( HEXA_NS::Hexa* h );
403     void _setValueVertices( HEXA_NS::Hexa* h );
404
405     HEXA_NS::Hexa   *_value;
406     QModelIndex     _ivalue;
407     };
408
409
410     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT VectorDialog : public HexaBaseDialog,
411     public Ui::VectorDialog
412     {
413       Q_OBJECT
414
415     public:
416       VectorDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
417       virtual ~VectorDialog();
418
419       void clear();
420
421       void setValue(HEXA_NS::Vector* v);
422       HEXA_NS::Vector* getValue();
423
424     public slots:
425     virtual bool apply(QModelIndex& result);
426     //         void updateName();
427
428     protected:
429     void _initInputWidget( Mode editmode );
430
431     private:
432     HEXA_NS::Vector *_value;
433     QModelIndex     _ivalue;
434     };
435
436
437
438     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT CylinderDialog : public HexaBaseDialog,
439     public Ui::CylinderDialog
440     {
441       Q_OBJECT
442
443     public:
444       CylinderDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
445       virtual ~CylinderDialog();
446
447       void clear();
448
449       void setValue( HEXA_NS::Cylinder* v );
450       HEXA_NS::Cylinder* getValue();
451
452     public slots:
453     virtual bool apply(QModelIndex& result);
454     //         void updateName();
455
456     protected:
457     void _initInputWidget( Mode editmode );
458
459     private:
460     HEXA_NS::Cylinder   *_value;
461     QModelIndex         _ivalue;
462     };
463
464
465
466     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PipeDialog : public HexaBaseDialog,
467     public Ui::PipeDialog
468     {
469       Q_OBJECT
470
471     public:
472       PipeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
473       virtual ~PipeDialog();
474
475       void clear();
476
477       void setValue( HEXA_NS::Pipe* p );
478       HEXA_NS::Pipe* getValue();
479
480     public slots:
481     virtual bool apply(QModelIndex& result);
482     //         void updateName();
483
484     protected:
485     void _initInputWidget( Mode editmode );
486
487     private:
488     HEXA_NS::Pipe   *_value;
489     QModelIndex     _ivalue;
490
491     };
492
493
494
495     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeGridDialog : public HexaBaseDialog,
496     public Ui::MakeGridDialog
497     {
498       Q_OBJECT
499
500     public:
501       MakeGridDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
502       virtual ~MakeGridDialog();
503
504       void clear();
505
506     public slots:
507     virtual bool apply(QModelIndex& result);
508
509     protected:
510     void _initInputWidget( Mode editmode );
511
512     protected slots:
513     void addRadiusItem();
514     void delRadiusItem();
515     void addAngleItem();
516     void delAngleItem();
517     void addHeightItem();
518     void delHeightItem();
519     void updateButtonBox();
520     void updateHelpFileName();
521
522     };
523
524
525
526
527     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeCylinderDialog : public HexaBaseDialog,
528     public Ui::MakeCylinderDialog
529     {
530       Q_OBJECT
531
532     public:
533       MakeCylinderDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
534       virtual ~MakeCylinderDialog();
535
536       void clear();
537
538     protected:
539       void _initInputWidget( Mode editmode );
540
541     public slots:
542     virtual bool apply(QModelIndex& result);
543     };
544
545
546     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakePipeDialog : public HexaBaseDialog,
547     public Ui::MakePipeDialog
548     {
549       Q_OBJECT
550
551     public:
552       MakePipeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
553       virtual ~MakePipeDialog();
554
555       void clear();
556
557     public slots:
558     virtual bool apply(QModelIndex& result);
559
560     protected:
561     void _initInputWidget( Mode editmode );
562     };
563
564
565     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeCylindersDialog : public HexaBaseDialog,
566     public Ui::MakeCylindersDialog
567     {
568       Q_OBJECT
569
570     public:
571       MakeCylindersDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
572       virtual ~MakeCylindersDialog();
573
574       void clear();
575
576     public slots:
577     virtual bool apply(QModelIndex& result);
578
579     protected:
580     void _initInputWidget( Mode editmode );
581     };
582
583
584     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakePipesDialog : public HexaBaseDialog,
585     public Ui::MakePipesDialog
586     {
587       Q_OBJECT
588
589     public:
590       MakePipesDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
591       virtual ~MakePipesDialog();
592
593       void clear();
594
595     public slots:
596     virtual bool apply(QModelIndex& result);
597
598     protected:
599     void _initInputWidget( Mode editmode );
600     };
601
602
603
604     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT RemoveHexaDialog : public HexaBaseDialog,
605     public Ui::RemoveHexaDialog
606     {
607       Q_OBJECT
608
609     public:
610       RemoveHexaDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
611       virtual ~RemoveHexaDialog();
612
613       void clear();
614
615     public slots:
616     virtual bool apply(QModelIndex& result);
617
618     protected:
619     void _initInputWidget( Mode editmode );
620     };
621
622
623     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PrismQuadDialog : public HexaBaseDialog,
624     public Ui::PrismQuadDialog
625     {
626       Q_OBJECT
627
628     public:
629       PrismQuadDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
630       virtual ~PrismQuadDialog();
631       void clear();
632       virtual QModelIndexList getAssocsVTK();
633
634     public slots:
635     virtual bool apply(QModelIndex& result);
636
637     protected:
638     void _initInputWidget( Mode editmode );
639
640     protected slots:
641     void addHeightItem();
642     void delHeightItem();
643
644     private slots:
645     void addQuad();
646     void removeQuad();
647     void clearQuads();
648
649     };
650
651     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT JoinQuadDialog : public HexaBaseDialog,
652     public Ui::JoinQuadDialog
653     {
654       Q_OBJECT
655
656     public:
657       JoinQuadDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
658       virtual ~JoinQuadDialog();
659
660       void clear();
661       virtual QModelIndexList getAssocsVTK();
662
663     public slots:
664     virtual bool apply(QModelIndex& result);
665
666     protected:
667     void _initInputWidget( Mode editmode );
668
669     private slots:
670     void addQuad();
671     void removeQuad();
672     void clearQuads();
673
674     };
675
676
677     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MergeDialog : public HexaBaseDialog,
678     public Ui::MergeDialog
679     {
680       Q_OBJECT
681
682     public:
683       MergeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
684       virtual ~MergeDialog();
685
686       void clear();
687
688     public slots:
689     virtual bool apply(QModelIndex& result);
690
691     protected:
692     void _initInputWidget( Mode editmode );
693
694     protected slots:
695     void updateHelpFileName();
696
697
698     };
699
700
701
702     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT DisconnectDialog : public HexaBaseDialog,
703     public Ui::DisconnectDialog
704     {
705       Q_OBJECT
706
707     public:
708       DisconnectDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
709       virtual ~DisconnectDialog();
710
711       void clear();
712       virtual QModelIndexList getAssocsVTK();
713
714     public slots:
715     virtual bool apply(QModelIndex& result);
716
717     protected:
718     void _initInputWidget( Mode editmode );
719
720     protected slots:
721     void updateHelpFileName();
722     void deleteEdgeItem();
723     void deleteHexaItem();
724     };
725
726
727
728     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT CutEdgeDialog : public HexaBaseDialog,
729     public Ui::CutEdgeDialog
730     {
731       Q_OBJECT
732
733     public:
734       CutEdgeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
735       virtual ~CutEdgeDialog();
736
737       void clear();
738
739     public slots:
740     virtual bool apply(QModelIndex& result);
741
742     protected:
743     void _initInputWidget( Mode editmode );
744     };
745
746
747     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeTransformationDialog : public HexaBaseDialog,
748     public Ui::TransformationDialog
749     {
750       Q_OBJECT
751
752     public:
753       MakeTransformationDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
754       virtual ~MakeTransformationDialog ();
755
756       void clear();
757
758     public slots:
759     virtual bool apply(QModelIndex& result);
760
761     protected:
762     void _initInputWidget( Mode editmode );
763
764     protected slots:
765     void updateHelpFileName();
766     };
767
768
769     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeSymmetryDialog : public HexaBaseDialog,
770     public Ui::SymmetryDialog
771     {
772       Q_OBJECT
773
774     public:
775       MakeSymmetryDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
776       virtual ~MakeSymmetryDialog();
777
778       void clear();
779
780     public slots:
781     virtual bool apply(QModelIndex& result);
782
783     protected:
784     void _initInputWidget( Mode editmode );
785
786     protected slots:
787     void updateHelpFileName();
788     };
789
790
791
792
793     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PerformTransformationDialog : public HexaBaseDialog,
794     public Ui::TransformationDialog
795     {
796       Q_OBJECT
797
798     public:
799       PerformTransformationDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
800       virtual ~PerformTransformationDialog ();
801
802       void clear();
803
804     public slots:
805     virtual bool apply(QModelIndex& result);
806
807     protected:
808     void _initInputWidget( Mode editmode );
809
810     protected slots:
811     void updateHelpFileName();
812     };
813
814
815     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PerformSymmetryDialog : public HexaBaseDialog,
816     public Ui::SymmetryDialog
817     {
818       Q_OBJECT
819
820     public:
821       PerformSymmetryDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
822       virtual ~PerformSymmetryDialog();
823
824       void clear();
825
826     public slots:
827     virtual bool apply(QModelIndex& result);
828
829     protected:
830     void _initInputWidget( Mode editmode );
831
832     protected slots:
833     void updateHelpFileName();
834     };
835
836
837     //   typedef class MyBasicGUI_PointDlg VertexAssocDialog;
838
839
840
841     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT EdgeAssocDialog : public HexaBaseDialog,
842     public Ui::EdgeAssocDialog
843     {
844       Q_OBJECT
845
846     public:
847       EdgeAssocDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
848       virtual ~EdgeAssocDialog();
849       void clear();
850       virtual QModelIndexList getAssocsVTK();
851       virtual QMultiMap<QString, int> getAssocsGEOM();
852       virtual void setCurrentGeomObj(DocumentModel::GeomObj* geomObj) { myLine = geomObj; }
853       void setGeomEngine( GEOM::GEOM_Gen_var geomEngine );
854
855
856     public slots:
857     virtual bool apply(QModelIndex& result);
858     virtual void close();
859     virtual void onWindowActivated(SUIT_ViewManager*);
860
861     protected:
862     virtual void _initInputWidget( Mode editmode );
863     //         virtual void hideEvent ( QHideEvent * event );
864     //         virtual void showEvent ( QShowEvent * event );
865     virtual GEOM::GEOM_IOperations_ptr createOperation();
866     virtual bool execute( ObjectList& );
867
868     protected slots:
869     virtual void onCurrentSelectionChanged();
870     //         void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel );
871     virtual void selectElementOfGeom();
872     void updateHelpFileName();
873
874     void deleteEdgeItem();
875     void deleteLineItem();
876
877     void addLine();
878     void pstartChanged( double val );
879     void pendChanged( double val );
880
881     private:
882     //        QModelIndexList currentAssocList;
883     // Preview in GEOM
884     //         GEOM::GeomObjPtr    _firstLine;
885     //         GEOM::GeomObjPtr    _lastLine;
886     GEOM::GeomObjPtr    _currentLine;
887 //    GEOM::GeomObjPtr    myLine;
888     DocumentModel::GeomObj* myLine;
889     double              _currentParameter;
890     GEOM::GEOM_Gen_var  _geomEngine ;
891
892     };
893
894
895     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT QuadAssocDialog : public HexaBaseDialog,
896     public Ui::QuadAssocDialog
897     {
898       Q_OBJECT
899
900     public:
901       QuadAssocDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
902       virtual ~QuadAssocDialog();
903       void clear();
904       virtual QModelIndexList getAssocsVTK();
905       virtual QMultiMap<QString, int> getAssocsGEOM();
906
907     public slots:
908     virtual bool apply(QModelIndex& result);
909     virtual void close();
910     virtual void onWindowActivated(SUIT_ViewManager*);
911
912     protected:
913     virtual void _initInputWidget( Mode editmode );
914     //         virtual void hideEvent ( QHideEvent * event );
915     //         virtual void showEvent ( QShowEvent * event );
916
917     protected slots:
918     virtual void onCurrentSelectionChanged();
919     void deleteFaceItem();
920     virtual void selectElementOfGeom();
921
922     private:
923     QList<DocumentModel::GeomObj> _assocs;
924     QShortcut*                    _delFaceShortcut;
925     };
926
927
928
929     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT GroupDialog : public HexaBaseDialog,
930     public Ui::GroupDialog
931     {
932       Q_OBJECT
933
934       QMap<DocumentModel::Group, QString> strKind;
935
936     public:
937       GroupDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
938       virtual ~GroupDialog();
939       void clear();
940       virtual QModelIndexList getAssocsVTK();
941
942       void setValue(HEXA_NS::Group* v);
943       HEXA_NS::Group* getValue();
944
945     public slots:
946     virtual bool apply(QModelIndex& result);
947
948     protected:
949     void _initInputWidget( Mode editmode );
950
951     private slots:
952     //         void addEltBase();
953     void removeEltBase();
954     //         void clearEltBase();
955     void onKindChanged( int index );
956
957     private:
958     HEXA_NS::Group   *_value;
959     };
960
961
962
963     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT LawDialog : public HexaBaseDialog,
964     public Ui::LawDialog
965     {
966       Q_OBJECT
967
968       QMap<DocumentModel::KindLaw, QString> strKind;
969
970     public:
971       LawDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
972       virtual ~LawDialog();
973       void clear();
974
975       void setValue(HEXA_NS::Law* v);
976       HEXA_NS::Law* getValue();
977
978     public slots:
979     virtual bool apply(QModelIndex& result);
980
981     protected:
982     void _initInputWidget( Mode editmode );
983
984     private:
985     HEXA_NS::Law   *_value;
986     };
987
988
989
990
991     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PropagationDialog : public HexaBaseDialog,
992     public Ui::PropagationDialog
993     {
994       Q_OBJECT
995
996     public:
997       PropagationDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
998       virtual ~PropagationDialog();
999       void clear();
1000
1001       void setValue(HEXA_NS::Propagation* v);
1002       HEXA_NS::Propagation* getValue();
1003
1004     public slots:
1005     virtual bool apply(QModelIndex& result);
1006
1007     protected:
1008     void _initInputWidget( Mode editmode );
1009
1010     protected slots:
1011     void updateHelpFileName();
1012     void deletePropagationItem();
1013     virtual void selectElementOfModel();
1014
1015     private:
1016     HEXA_NS::Propagation *_value;
1017     };
1018
1019
1020
1021     // Define the compute mesh dialog box
1022     // ----------------------------------
1023
1024     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT ComputeMeshDialog : public HexaBaseDialog
1025     {
1026       Q_OBJECT
1027
1028     public:
1029       ComputeMeshDialog( QWidget* parent = 0, Mode editmode = NEW_MODE, Qt::WindowFlags f = Qt::SubWindow );
1030       virtual ~ComputeMeshDialog();
1031       void clear();
1032
1033       void setDocumentModel(DocumentModel* m);
1034
1035     public slots:
1036     virtual bool apply(QModelIndex& result);
1037     //         virtual void accept();
1038     //         virtual void reject();
1039
1040     protected:
1041     void _initInputWidget( Mode editmode );
1042
1043     private:
1044     QLineEdit* _name;
1045     QSpinBox*  _dim;
1046     QLineEdit* _fact;
1047     };
1048
1049
1050
1051     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT ReplaceHexaDialog : public HexaBaseDialog,
1052     public Ui::ReplaceHexaDialog
1053     {
1054       Q_OBJECT
1055
1056     public:
1057       ReplaceHexaDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
1058       virtual ~ReplaceHexaDialog();
1059       void clear();
1060       virtual QModelIndexList getAssocsVTK();
1061
1062
1063     public slots:
1064     virtual bool apply(QModelIndex& result);
1065
1066     protected:
1067     void _initInputWidget( Mode editmode );
1068
1069     protected slots:
1070     void deleteQuadItem();
1071     void updateButtonBox();
1072
1073     private:
1074     HEXA_NS::Elements *_value;
1075     };
1076
1077
1078
1079
1080
1081     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT QuadRevolutionDialog : public HexaBaseDialog,
1082     public Ui::QuadRevolutionDialog
1083     {
1084       Q_OBJECT
1085
1086     public:
1087       QuadRevolutionDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
1088       virtual ~QuadRevolutionDialog();
1089       void clear();
1090       virtual QModelIndexList getAssocsVTK();
1091
1092     public slots:
1093     virtual bool apply(QModelIndex& result);
1094
1095     protected:
1096     void _initInputWidget( Mode editmode );
1097
1098     protected slots:
1099     void addAngleItem();
1100     void delAngleItem();
1101     void delQuadItem();
1102     void updateButtonBox();
1103
1104     private:
1105     HEXA_NS::Elements *_value;
1106     };
1107
1108
1109
1110     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeHemiSphereDialog : public HexaBaseDialog,
1111     public Ui::MakeHemiSphereDialog
1112     {
1113       Q_OBJECT
1114
1115     public:
1116       MakeHemiSphereDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
1117       virtual ~MakeHemiSphereDialog();
1118       void clear();
1119
1120       //         void setValue(HEXA_NS::Propagation* v);
1121       //         HEXA_NS::Propagation* getValue();
1122
1123     public slots:
1124     virtual bool apply(QModelIndex& result);
1125
1126     protected:
1127     void _initInputWidget( Mode editmode );
1128
1129     private:
1130     HEXA_NS::Elements *_value;
1131     };
1132
1133     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT ModelInfoDialog : public HexaBaseDialog,
1134     public Ui::ModelInfoDialog
1135     {
1136         Q_OBJECT
1137
1138     public:
1139         ModelInfoDialog( QWidget* parent = NULL, Qt::WindowFlags wf = Qt::SubWindow );
1140         virtual ~ModelInfoDialog(){}
1141
1142     public slots:
1143         void updateInfo();
1144
1145     protected:
1146         virtual void hideEvent ( QHideEvent * event );
1147         virtual void showEvent ( QShowEvent * event );
1148         virtual bool apply(QModelIndex& result){ return true;}
1149         virtual void _initInputWidget( Mode editmode ){}
1150     };
1151
1152     class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT AddShapeDialog : public HexaBaseDialog,
1153     public Ui::AddShapeDialog
1154     {
1155         Q_OBJECT
1156
1157     public:
1158         AddShapeDialog( QWidget* parent = NULL, Mode editmode = NEW_MODE, Qt::WindowFlags wf = Qt::SubWindow );
1159         virtual ~AddShapeDialog();
1160         void clear();
1161
1162     public slots:
1163         virtual bool apply(QModelIndex& result);
1164         virtual void close();
1165         virtual void onWindowActivated(SUIT_ViewManager*);
1166
1167     protected:
1168         virtual void _initInputWidget( Mode editmode );
1169
1170     protected slots:
1171         virtual void onCurrentSelectionChanged();
1172
1173     private:
1174         GEOM::GeomObjPtr    currentGeomObj;
1175     };
1176
1177
1178     //   class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeRindDialog : public HexaBaseDialog,
1179     //                                                     public Ui::MakeRindDialog
1180     //   {
1181     //       Q_OBJECT
1182     //
1183     //       public:
1184     //         MakeRindDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
1185     //         virtual ~MakeRindDialog();
1186     //
1187     //       public slots:
1188     //         virtual bool apply(QModelIndex& result);
1189     //
1190     //       private:
1191     // //         HEXA_NS::Propagation *_value;:q
1192     //
1193     //   };
1194
1195
1196   }
1197 }
1198
1199
1200
1201 #endif