0032429: Coding - Warnings during compilation on macosx arm64 with option BUILD_Inspe...
[occt.git] / tools / VInspector / VInspector_ItemV3dViewer.hxx
1 // Created on: 2020-02-10
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2020 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_ItemV3dViewer_H
17 #define VInspector_ItemV3dViewer_H
18
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
21
22 #include <V3d_Viewer.hxx>
23
24 class VInspector_ItemV3dViewer;
25 typedef QExplicitlySharedDataPointer<VInspector_ItemV3dViewer> VInspector_ItemV3dViewerPtr;
26
27 //! \class VInspector_ItemV3dViewer
28 //! Parent item is context properties, that corresponds to AIS_InteractiveContext
29 class VInspector_ItemV3dViewer : public VInspector_ItemBase
30 {
31 public:
32
33   //! Creates an item wrapped by a shared pointer
34   static VInspector_ItemV3dViewerPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
35   { return VInspector_ItemV3dViewerPtr (new VInspector_ItemV3dViewer (theParent, theRow, theColumn)); }
36
37   //! Destructor
38   virtual ~VInspector_ItemV3dViewer() Standard_OVERRIDE {};
39
40   //! Inits the item, fills internal containers
41   Standard_EXPORT virtual void Init() Standard_OVERRIDE;
42
43   //! Resets cached values
44   Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
45
46   //! Returns data object of the item.
47   //! \return object
48   virtual const Handle(Standard_Transient)& Object() const Standard_OVERRIDE { initItem(); return myViewer; }
49
50   //! Returns the current viewer, init item if it was not initialized yet
51   //! \return interactive object
52   Handle(V3d_Viewer) GetViewer() const { return Handle(V3d_Viewer)::DownCast (Object()); }
53
54 protected:
55   //! Initializes the current item. It is empty because Reset() is also empty.
56   virtual void initItem() const Standard_OVERRIDE;
57
58   //! Returns number of displayed presentations
59   //! \return rows count
60   Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
61
62   //! Returns item information for the given role. Fills internal container if it was not filled yet
63   //! \param theItemRole a value role
64   //! \return the value
65   Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
66
67   //! Returns stream value of the item to fulfill property panel.
68   //! \return stream value or dummy
69   Standard_EXPORT virtual void initStream (Standard_OStream& theOStream) const Standard_OVERRIDE;
70
71 private:
72
73   //! Constructor
74   //! param theParent a parent item
75   //! \param theRow the item row positition in the parent item
76   //! \param theColumn the item column positition in the parent item
77   VInspector_ItemV3dViewer(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
78     : VInspector_ItemBase(theParent, theRow, theColumn) {}
79
80 protected:
81
82   Handle(V3d_Viewer) myViewer; //!< the current viewer
83 };
84
85 #endif