Back to index

salome-geom  6.5.0
GroupGUI_GroupDlg.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 //  GEOM GEOMGUI : GUI for Geometry component
00024 //  File   : GroupGUI_GroupDlg.h
00025 //  Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
00026 
00027 #ifndef GROUPGUI_GROUPDLG_H
00028 #define GROUPGUI_GROUPDLG_H
00029 
00030 #include <GEOMBase_Skeleton.h>
00031 
00032 #include <TopAbs_ShapeEnum.hxx>
00033 #include <TColStd_DataMapOfIntegerInteger.hxx>
00034 #include <TColStd_IndexedMapOfInteger.hxx>
00035 
00036 class QGroupBox;
00037 class QLineEdit;
00038 class QListWidget;
00039 class QButtonGroup;
00040 
00041 //=================================================================================
00042 // class    : GroupGUI_GroupDlg
00043 // purpose  :
00044 //=================================================================================
00045 class GroupGUI_GroupDlg : public GEOMBase_Skeleton
00046 {
00047   Q_OBJECT
00048 
00049 public:
00050   typedef enum {
00051     CreateGroup,
00052     EditGroup
00053   } Mode;
00054 
00055   GroupGUI_GroupDlg (Mode mode, GeometryGUI*, QWidget* parent = 0);
00056   ~GroupGUI_GroupDlg();
00057 
00058 protected:
00059   // redefined from GEOMBase_Helper
00060   virtual GEOM::GEOM_IOperations_ptr  createOperation();
00061   virtual bool                        isValid (QString&);
00062   virtual bool                        execute (ObjectList&);
00063   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
00064 
00065   void                                closeEvent (QCloseEvent*);
00066 
00067 private slots:
00068   void                                ClickOnOk();
00069   bool                                ClickOnApply();
00070   void                                ActivateThisDialog();
00071   void                                SelectionIntoArgument();
00072   void                                SetEditCurrentArgument();
00073   void                                ConstructorsClicked(int);
00074 
00075   void                                selectAllSubShapes();
00076   void                                add();
00077   void                                remove();
00078   void                                showOnlySelected();
00079   void                                selectionChanged();
00080 
00081 private:
00082   void                                Init();
00083   void                                enterEvent (QEvent*);
00084 
00085   int                                 subSelectionWay() const;
00086   TopAbs_ShapeEnum                    getShapeType() const;
00087   void                                setShapeType (const TopAbs_ShapeEnum);
00088   void                                activateSelection();
00089   void                                updateState (bool isAdd = false);
00090   void                                highlightSubShapes();
00091   void                                onGetInPlace();
00092   void                                setInPlaceObj (GEOM::GEOM_Object_var, const bool isVisible=1);
00093   int                                 getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMapIndex);
00094 
00095 private:
00096   Mode                                myMode;
00097   bool                                myBusy;
00098   bool                                myIsShapeType;
00099   bool                                myIsHiddenMain;
00100   GEOM::GEOM_Object_var               myMainObj;
00101   GEOM::GEOM_Object_var               myGroup;
00102   GEOM::GEOM_Object_var               myInPlaceObj;
00103   int                                 myInPlaceObjSelectState;
00104   TColStd_DataMapOfIntegerInteger     myMain2InPlaceIndices;
00105 
00106   QPushButton*                        mySelBtn;
00107   QLineEdit*                          myMainName;
00108   QPushButton*                        mySelBtn2;
00109   QLineEdit*                          myShape2Name;
00110   QGroupBox*                          myRestrictGroupBox;
00111   QButtonGroup*                       myRestrictGroup;
00112   QPushButton*                        mySelAllBtn;
00113   QPushButton*                        myAddBtn;
00114   QPushButton*                        myRemBtn;
00115   QPushButton*                        myShowOnlyBtn;
00116   QPushButton*                        myHideSelBtn;
00117   QPushButton*                        myShowAllBtn;
00118   QListWidget*                        myIdList;
00119 };
00120 
00121 #endif