1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef VInspector_ItemSelectMgrFilter_H
17 #define VInspector_ItemSelectMgrFilter_H
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
22 #include <SelectMgr_Filter.hxx>
24 class QItemSelectionModel;
26 class VInspector_ItemSelectMgrFilter;
27 typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrFilter> VInspector_ItemSelectMgrFilterPtr;
29 //! \class VInspector_ItemSelectMgrFilter
30 //! Item presents information about SelectMgr_Filter.
31 //! Parent is item folder, children are sub filter if the filter is a composition filter.
32 class VInspector_ItemSelectMgrFilter : public VInspector_ItemBase
37 //! Creates an item wrapped by a shared pointer
38 static VInspector_ItemSelectMgrFilterPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
39 { return VInspector_ItemSelectMgrFilterPtr (new VInspector_ItemSelectMgrFilter (theParent, theRow, theColumn)); }
41 virtual ~VInspector_ItemSelectMgrFilter() Standard_OVERRIDE {};
43 //! Returns the current filter, init item if it was not initialized yet
44 //! \return filter object
45 Standard_EXPORT Handle(SelectMgr_Filter) GetFilter() const;
47 //! Inits the item, fills internal containers
48 Standard_EXPORT virtual void Init() Standard_OVERRIDE;
50 //! Resets cached values
51 Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
55 //! Initialize the current item. It is empty because Reset() is also empty.
56 virtual void initItem() const Standard_OVERRIDE;
58 //! Returns number of item selected
59 //! \return rows count
60 virtual int initRowCount() const Standard_OVERRIDE;
62 //! Returns item information for the given role. Fills internal container if it was not filled yet
63 //! \param theItemRole a value role
65 virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
67 //! Creates a child item in the given position.
68 //! \param theRow the child row position
69 //! \param theColumn the child column position
70 //! \return the created item
71 virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
75 //! Set filter into the current item
76 //! \param theFilter a filter
77 void setFilter (Handle(SelectMgr_Filter) theFilter) { myFilter = theFilter; }
82 //! param theParent a parent item
83 VInspector_ItemSelectMgrFilter (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
84 : VInspector_ItemBase (theParent, theRow, theColumn) {}
88 Handle(SelectMgr_Filter) myFilter; //!< the current filter