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_VIEWERSELECTOR_H__ |
17 | #define __IVTKOCC_VIEWERSELECTOR_H__ |
18 | |
19 | #include <IVtk_IView.hxx> |
913a4c4a |
20 | #include <SelectMgr_Selection.hxx> |
21 | #include <SelectMgr_ViewerSelector.hxx> |
22 | |
23 | // ----------------------------------------------------------------------------- |
24 | //! @class IVtkOCC_ViewerSelector |
25 | //! @brief Class that implements OCCT selection algorithm. |
26 | //! |
27 | //! Inspired by StdSelect_ViewerSelector3d class from OCCT 6.5.1 |
28 | |
29 | class IVtkOCC_ViewerSelector : public SelectMgr_ViewerSelector |
30 | { |
31 | public: |
32 | IVtkOCC_ViewerSelector(); |
33 | |
a2f76b15 |
34 | virtual ~IVtkOCC_ViewerSelector(); |
35 | |
913a4c4a |
36 | //! Implements point picking |
37 | //! @param [in] theXPix, theYPix Display coordinates of the point |
38 | //! @param [in] theView ICamera interface to update the projection parameters. |
39 | void Pick (const Standard_Integer theXPix, |
40 | const Standard_Integer theYPix, |
41 | const IVtk_IView::Handle& theView); |
42 | |
43 | //! Picking by rectangle |
44 | //! @param [in] theXMin, theYMin, theXMax, theYMax Rectangle coords |
45 | //! @param [in] theView ICamera interface to calculate projections |
46 | void Pick (const Standard_Integer theXMin, |
47 | const Standard_Integer theYMin, |
48 | const Standard_Integer theXMax, |
49 | const Standard_Integer theYMax, |
50 | const IVtk_IView::Handle& theView); |
51 | |
52 | //! Implements point picking |
53 | void Pick (double** thePoly, const int theNbPoints, const IVtk_IView::Handle& theView); |
54 | |
55 | //! Activates the given selection |
f751596e |
56 | void Activate (const Handle(SelectMgr_Selection)& theSelection); |
913a4c4a |
57 | |
58 | //! Deactivate the given selection |
59 | void Deactivate (const Handle(SelectMgr_Selection)& theSelection); |
60 | |
92efcf78 |
61 | DEFINE_STANDARD_RTTIEXT(IVtkOCC_ViewerSelector,SelectMgr_ViewerSelector) |
913a4c4a |
62 | |
63 | private: |
913a4c4a |
64 | Standard_Integer myPixTol; |
913a4c4a |
65 | Standard_Boolean myToUpdateTol; |
66 | }; |
67 | |
68 | DEFINE_STANDARD_HANDLE( IVtkOCC_ViewerSelector, SelectMgr_ViewerSelector ) |
69 | #endif // __IVTKOCC_VIEWERSELECTOR_H__ |