1 // Created on: 2011-10-20
2 // Created by: Roman KOZLOV
3 // Copyright (c) 2011-2014 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 __IVTKOCC_SELECTABLEOBJECT_H__
17 #define __IVTKOCC_SELECTABLEOBJECT_H__
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>
25 // -----------------------------------------------------------------------------
26 //! @class IVtkOCC_SelectableObject
27 //! @brief Class with selection primitives used by OCCT selection algorithm.
28 class IVtkOCC_SelectableObject : public SelectMgr_SelectableObject
32 //! Constructs a selectable object initialized by the given shape
33 //! @param [in] theShape Selectable shape
34 IVtkOCC_SelectableObject (const IVtkOCC_Shape::Handle& theShape);
36 //! Constructs uninitialized selectable object.
37 //! setShape() should be called later.
38 IVtkOCC_SelectableObject();
40 //! Sets the selectable shape
41 //! @param [in] theShape Selectable shape
42 void SetShape (const IVtkOCC_Shape::Handle& theShape);
44 const IVtkOCC_Shape::Handle& GetShape() const { return myShape; };
46 //! Returns bounding box of object
47 Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE;
49 DEFINE_STANDARD_RTTIEXT(IVtkOCC_SelectableObject,SelectMgr_SelectableObject)
53 //! Internal method, computes selection data for viewer selector
54 //! Inspired by AIS_Shape::ComputeSelection() from OCCT 6.5.1
55 //! @param [in] selection container for sensitive primitives
56 //! @param [in] mode Selection mode
57 void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
58 const Standard_Integer theMode) Standard_OVERRIDE;
60 const Bnd_Box& BoundingBox();
62 IVtkOCC_Shape::Handle myShape;
64 Handle(Prs3d_Drawer) myOCCTDrawer;
67 DEFINE_STANDARD_HANDLE( IVtkOCC_SelectableObject, SelectMgr_SelectableObject )
69 #endif // __IVTKOCC_SELECTABLEOBJECT_H__