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_ItemBase_H
17 #define VInspector_ItemBase_H
19 #include <AIS_InteractiveContext.hxx>
20 #include <Standard.hxx>
21 #include <TreeModel_ItemBase.hxx>
23 class VInspector_ItemBase;
24 typedef QExplicitlySharedDataPointer<VInspector_ItemBase> VInspector_ItemBasePtr;
26 //! \class VInspector_ItemBase
27 //! Parent item for all ShapeView items
28 class VInspector_ItemBase : public TreeModel_ItemBase
31 //! Resets cached values
32 virtual void Reset() Standard_OVERRIDE { TreeModel_ItemBase::Reset(); }
35 //! \param theLabel an object where the child items structure is found
36 void SetContext (const Handle(AIS_InteractiveContext)& theContext) { myContext = theContext; }
38 //! Returns true if the current context is not null
39 //! \return a boolean value
40 bool HasContext() const { return !GetContext().IsNull(); }
42 //! Returns the current contex. It iterates up by list of parents to found context item and return context
44 Standard_EXPORT const Handle(AIS_InteractiveContext)& GetContext() const;
48 //! Initialize the current item. It creates a backup of the specific item information
49 virtual void initItem() const {};// = 0;
54 //! param theParent a parent item
55 //! \param theRow the item row positition in the parent item
56 //! \param theColumn the item column positition in the parent item
57 VInspector_ItemBase (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
58 : TreeModel_ItemBase (theParent, theRow, theColumn), myContext (0) {}
62 Handle(AIS_InteractiveContext) myContext; //!< the current context