1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef GEOMTOOLSGUI_REDUCESTUDYDLG_H
21 #define GEOMTOOLSGUI_REDUCESTUDYDLG_H
24 #include "GEOM_ToolsGUI.hxx"
27 #include <GEOMUtils.hxx>
28 #include <GeometryGUI.h>
29 #include <GEOM_Displayer.h>
33 #include <QTreeWidget>
35 #include <QButtonGroup>
41 class GEOMToolsGUI_TreeWidgetItem : public QTreeWidgetItem
45 GEOMToolsGUI_TreeWidgetItem( QTreeWidget*, const QStringList&, char*, int = Type );
46 GEOMToolsGUI_TreeWidgetItem( QTreeWidgetItem*, const QStringList&, char*, int = Type );
47 ~GEOMToolsGUI_TreeWidgetItem();
50 void setVisible( bool, QIcon& );
52 char* getStudyEntry() const;
60 class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_ReduceStudyDlg : public QDialog
65 GEOMToolsGUI_ReduceStudyDlg( QWidget* );
66 ~GEOMToolsGUI_ReduceStudyDlg();
69 void onItemClicked(QTreeWidgetItem*, int );
70 void onHeaderClicked( int );
72 void selectionChanged();
80 void init( const std::set<std::string>& theObjectEntries );
81 std::set<std::string> getSelectedObjects() const;
83 void createTreeWidget( QTreeWidget* );
84 QGroupBox* createButtonGroup( QButtonGroup* );
86 void addObjectsToTree( QTreeWidget*, std::set<std::string>& );
87 GEOMToolsGUI_TreeWidgetItem* addSubObject( QTreeWidget*, std::set<std::string>&, GEOM::GEOM_Object_var );
88 GEOMToolsGUI_TreeWidgetItem* findObjectInTree( QTreeWidget*, GEOM::GEOM_Object_var );
90 void checkVisibleIcon( QTreeWidget* );
91 bool isObjectDrawable( std::string );
93 void unpublishObjects( std::set<std::string>& );
95 void removeObjects( std::set<std::string>& );
96 void removeObject( std::string& );
98 void removeEmptyFolders();
99 void getEmptyFolders( _PTR(SObject), std::set<std::string>& );
101 QTreeWidget* myTreeKeptObjects;
102 QTreeWidget* myTreeRemoveObjects;
103 std::map<QTreeWidget*,bool> myMapTreeSelectAll;
105 QButtonGroup* myGroupIntermediates;
106 QButtonGroup* myGroupSubObjects;
108 QCheckBox* myCBRemoveEmptyFolder;
109 QCheckBox* myCBSoftRemoval;
111 std::set<std::string> myMainEntries;
113 std::set<std::string> myKeptObjects;
114 std::set<std::string> myRemovedObjects;
115 std::set<std::string> myListParents;
116 std::set<std::string> myListSubObjects;
121 GEOM_Displayer myDisplayer;
122 SalomeApp_Application* myApp;