1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
23 #ifndef OPERATIONGUI_EXTRACTIONDLG_H
24 #define OPERATIONGUI_EXTRACTIONDLG_H
26 #include <GEOMBase_Skeleton.h>
28 #include <TopTools_IndexedMapOfShape.hxx>
29 #include <TColStd_MapOfInteger.hxx>
34 class QTreeWidgetItem;
37 //=================================================================================
38 // class : OperationGUI_ExtractionDlg
40 //=================================================================================
41 class OperationGUI_ExtractionDlg : public GEOMBase_Skeleton
48 OperationGUI_ExtractionDlg( GeometryGUI*, QWidget* );
49 ~OperationGUI_ExtractionDlg();
53 // redefined from GEOMBase_Helper and MeasureGUI_Skeleton
54 virtual GEOM::GEOM_IOperations_ptr createOperation();
55 virtual bool execute(ObjectList &);
56 virtual void activateSelection();
57 virtual bool isValid( QString& );
61 void SelectionIntoArgument();
64 void onShapeTypeChanged();
65 void onAddExtracted();
66 void onRemoveExtracted();
67 void onListSelectionChanged();
68 void showOnlySelected();
70 void showAllSelected();
72 void ActivateThisDialog();
73 void SetEditCurrentArgument();
78 bool updateSubShTypeCompo();
79 void updateFilteredList();
80 void resetBuildData(const bool isEnableBuild);
81 bool isEmptyExtracted();
82 void selectMainShape();
83 void selectSubShapes();
84 void enterEvent(QEvent *);
86 (GEOM::GEOM_Object_ptr &theResult,
87 GEOM::GEOM_IShapesOperations::ExtractionStats &theStats);
88 QString getSubShapeEntry(const int theId);
89 Handle_SALOME_InteractiveObject createIO(const char *theEntry);
90 void displaySubShape(const int theId);
91 void eraseSubShape(const int theId);
97 GEOM::GEOM_Object_var myObj;
98 QPushButton *mySelBtn;
99 QLineEdit *myMainShapeEdit;
100 QComboBox *mySubShTypeCompo;
101 QListWidget *myFilteredList;
102 QTreeWidget *myExtractedTree;
103 QListWidget *myRemovedList;
104 QListWidget *myModifiedList;
105 QListWidget *myAddedList;
106 QTreeWidgetItem *myTopItems[8];
107 QPushButton *myRebuildBtn;
108 TColStd_MapOfInteger myMapExtractedIDs;
110 TColStd_MapOfInteger myMapDisplayedIDs;
111 TopTools_IndexedMapOfShape myIndices;
115 #endif // OPERATIONGUI_EXTRACTIONDLG_H