0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IVtkOCC / IVtkOCC_SelectableObject.hxx
CommitLineData
913a4c4a 1// Created on: 2011-10-20
2// Created by: Roman KOZLOV
3// Copyright (c) 2011-2014 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 __IVTKOCC_SELECTABLEOBJECT_H__
17#define __IVTKOCC_SELECTABLEOBJECT_H__
18
19#include <Bnd_Box.hxx>
20#include <IVtkOCC_Shape.hxx>
21#include <Prs3d_Drawer.hxx>
22#include <SelectMgr_SelectableObject.hxx>
23#include <SelectMgr_Selection.hxx>
24
a2f76b15 25class IVtkOCC_SelectableObject;
26DEFINE_STANDARD_HANDLE(IVtkOCC_SelectableObject, SelectMgr_SelectableObject)
913a4c4a 27// -----------------------------------------------------------------------------
28//! @class IVtkOCC_SelectableObject
29//! @brief Class with selection primitives used by OCCT selection algorithm.
30class IVtkOCC_SelectableObject : public SelectMgr_SelectableObject
31{
32public:
33
a2f76b15 34 typedef Handle(IVtkOCC_SelectableObject) Handle;
35
913a4c4a 36 //! Constructs a selectable object initialized by the given shape
37 //! @param [in] theShape Selectable shape
38 IVtkOCC_SelectableObject (const IVtkOCC_Shape::Handle& theShape);
39
40 //! Constructs uninitialized selectable object.
41 //! setShape() should be called later.
42 IVtkOCC_SelectableObject();
43
a2f76b15 44 virtual ~IVtkOCC_SelectableObject();
45
913a4c4a 46 //! Sets the selectable shape
47 //! @param [in] theShape Selectable shape
a2f76b15 48 Standard_EXPORT void SetShape (const IVtkOCC_Shape::Handle& theShape);
913a4c4a 49
50 const IVtkOCC_Shape::Handle& GetShape() const { return myShape; };
51
f751596e 52 //! Returns bounding box of object
53 Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE;
54
92efcf78 55 DEFINE_STANDARD_RTTIEXT(IVtkOCC_SelectableObject,SelectMgr_SelectableObject)
913a4c4a 56
57private:
58
59 //! Internal method, computes selection data for viewer selector
60 //! Inspired by AIS_Shape::ComputeSelection() from OCCT 6.5.1
61 //! @param [in] selection container for sensitive primitives
62 //! @param [in] mode Selection mode
2b886265 63 virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
64 const Standard_Integer theMode) Standard_OVERRIDE;
65
66 //! Dummy.
67 virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& ,
68 const Handle(Prs3d_Presentation)& ,
69 const Standard_Integer ) Standard_OVERRIDE {}
913a4c4a 70
71 const Bnd_Box& BoundingBox();
72
2b886265 73private:
913a4c4a 74 IVtkOCC_Shape::Handle myShape;
75 Bnd_Box myBndBox;
76 Handle(Prs3d_Drawer) myOCCTDrawer;
77};
78
913a4c4a 79#endif // __IVTKOCC_SELECTABLEOBJECT_H__