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_ItemHistoryElement_H
17 #define VInspector_ItemHistoryElement_H
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
22 class VInspector_ItemHistoryElement;
23 typedef QExplicitlySharedDataPointer<VInspector_ItemHistoryElement> VInspector_ItemHistoryElementPtr;
25 //! \class VInspector_ItemHistoryElement
26 //! Item shows name, pointer and shape type values of item history type information
27 //! Parent is item history type, there are no children.
28 class VInspector_ItemHistoryElement : public VInspector_ItemBase
33 //! Creates an item wrapped by a shared pointer
34 static VInspector_ItemHistoryElementPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
35 { return VInspector_ItemHistoryElementPtr (new VInspector_ItemHistoryElement (theParent, theRow, theColumn)); }
38 virtual ~VInspector_ItemHistoryElement() Standard_OVERRIDE {};
40 //! Inits the item, fills internal containers
41 Standard_EXPORT virtual void Init() Standard_OVERRIDE;
43 //! Resets cached values
44 virtual void Reset() Standard_OVERRIDE { TreeModel_ItemBase::Reset(); }
46 //! Returns pointer string value
47 QString PointerInfo() const { return myPointerInfo; }
49 //! \return number of children.
50 virtual int initRowCount() const Standard_OVERRIDE { return 0; }
52 //! Returns item information for the given role. Fills internal container if it was not filled yet
53 //! \param theItemRole a value role
55 Standard_EXPORT virtual QVariant initValue(const int theItemRole) const Standard_OVERRIDE;
59 //! Initialize the current item. It is empty because Reset() is also empty.
60 virtual void initItem() const Standard_OVERRIDE;
62 //! Creates a child item in the given position.
63 //! \param theRow the child row position
64 //! \param theColumn the child column position
65 //! \return the created item
66 virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE
67 { (void)theRow; (void)theColumn; return TreeModel_ItemBasePtr(); }
69 //! Returns the item text value, initialize item if it has not been initialized yet
70 QString getName() const;
72 //! Returns the item pointer value, initialize item if it has not been initialized yet
73 QString GetPointerInfo() const;
75 //! Returns the shape type text value, initialize item if it has not been initialized yet
76 QString GetShapeTypeInfo() const;
81 //! param theParent a parent item
82 VInspector_ItemHistoryElement(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
83 : VInspector_ItemBase(theParent, theRow, theColumn) {}
87 QString myName; //!< cached text value
88 QString myPointerInfo; //!< cached pointer text value
89 QString myShapeTypeInfo; //!<cached shape type text value