// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef GEOMTOOLSGUI_REDUCESTUDYDLG_H #define GEOMTOOLSGUI_REDUCESTUDYDLG_H #include "GEOM_ToolsGUI.hxx" #include #include #include #include #include #include #include class GEOMToolsGUI_TreeWidgetItem : public QTreeWidgetItem { public: GEOMToolsGUI_TreeWidgetItem( QTreeWidget*, const QStringList&, char*, bool, int = Type ); GEOMToolsGUI_TreeWidgetItem( QTreeWidgetItem*, const QStringList&, char*, bool, int = Type ); ~GEOMToolsGUI_TreeWidgetItem(); bool isVisible(); void setVisible( bool, QIcon& ); char* getStudyEntry() const; private: char* myStudyEntry; bool myVisible; }; class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_ReduceStudyDlg : public QDialog { Q_OBJECT public: GEOMToolsGUI_ReduceStudyDlg( const GEOM::string_array&, QWidget* ); ~GEOMToolsGUI_ReduceStudyDlg(); private slots: void onUnpublishIntermediate( bool ); void onRemoveIntermediate( bool ); void onKeepSubObjects( bool ); void onRemoveEmptyFolder( bool ); void onSoftRemoval( bool ); void clickOnOk(); void clickOnCancel(); void clickOnHelp(); void onSelectionChanged(); void onItemClicked(QTreeWidgetItem*, int ); void onHeaderClicked( int ); void update(); private: void onShowOnlySelected(); void checkVisibleIcon( QTreeWidget* ); void sortObjects( QTreeWidget*, std::set& ); GEOMToolsGUI_TreeWidgetItem* addSubObject( QTreeWidget*, std::set&, GEOM::GEOM_Object_var ); GEOMToolsGUI_TreeWidgetItem* findObjectInTree( QTreeWidget*, GEOM::GEOM_Object_var ); QTreeWidget* myTreeKeptObjects; QTreeWidget* myTreeRemoveObjects; QCheckBox* myCBUnpublishIntermediate; QCheckBox* myCBRemoveIntermediate; QCheckBox* myCBKeepSubObjects; QCheckBox* myCBRemoveEmptyFolder; QCheckBox* myCBSoftRemoval; std::set myMainEntries; QIcon myVisible; QIcon myInvisible; bool mySelectAll; GEOM_Displayer myDisplayer; std::set myParents; std::set mySubObjects; std::set myOthers; std::map myMapTreeSelectAll; }; #endif