0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tools / VInspector / VInspector_ItemHistoryType.hxx
1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement. 
15
16 #ifndef VInspector_ItemHistoryType_H
17 #define VInspector_ItemHistoryType_H
18
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
21
22 class VInspector_ItemHistoryType;
23 typedef QExplicitlySharedDataPointer<VInspector_ItemHistoryType> VInspector_ItemHistoryTypePtr;
24
25 //! \class VInspector_ItemHistoryType
26 //! Item to show history type. Also it shows the element information of the first sub-item
27 //! Parent is item history root item, children are item history elements
28 class VInspector_ItemHistoryType : public VInspector_ItemBase
29 {
30
31 public:
32
33   //! Creates an item wrapped by a shared pointer
34   static VInspector_ItemHistoryTypePtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
35   { return VInspector_ItemHistoryTypePtr (new VInspector_ItemHistoryType (theParent, theRow, theColumn)); }
36
37   //! Destructor
38   virtual ~VInspector_ItemHistoryType() Standard_OVERRIDE {};
39
40   //! Returns the pointer info of the first child item, initialize item if it has not been initialized yet.
41   Standard_EXPORT QString PointerInfo() const;
42
43   //! Returns the owner info of the first child item, initialize item if it has not been initialized yet.
44   Standard_EXPORT QString OwnerInfo() const;
45
46 protected:
47
48   //! Return data value for the role.
49   //! \param theRole a value role
50   //! \return the value
51   virtual QVariant initValue(const int theRole) const;
52
53   //! \return number of children.
54   virtual int initRowCount() const Standard_OVERRIDE;
55
56     //! Initialize the current item. It is empty because Reset() is also empty.
57   virtual void initItem() const Standard_OVERRIDE;
58
59 protected:
60
61   //! Creates a child item in the given position.
62   //! \param theRow the child row position
63   //! \param theColumn the child column position
64   //! \return the created item
65   virtual TreeModel_ItemBasePtr createChild(int theRow, int theColumn) Standard_OVERRIDE;
66
67 private:
68
69   //! Constructor
70   //! param theParent a parent item
71   VInspector_ItemHistoryType(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
72     : VInspector_ItemBase(theParent, theRow, theColumn) {}
73
74 };
75
76 #endif