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 | |
913a4c4a |
34 | //! Implements point picking |
35 | //! @param [in] theXPix, theYPix Display coordinates of the point |
36 | //! @param [in] theView ICamera interface to update the projection parameters. |
37 | void Pick (const Standard_Integer theXPix, |
38 | const Standard_Integer theYPix, |
39 | const IVtk_IView::Handle& theView); |
40 | |
41 | //! Picking by rectangle |
42 | //! @param [in] theXMin, theYMin, theXMax, theYMax Rectangle coords |
43 | //! @param [in] theView ICamera interface to calculate projections |
44 | void Pick (const Standard_Integer theXMin, |
45 | const Standard_Integer theYMin, |
46 | const Standard_Integer theXMax, |
47 | const Standard_Integer theYMax, |
48 | const IVtk_IView::Handle& theView); |
49 | |
50 | //! Implements point picking |
51 | void Pick (double** thePoly, const int theNbPoints, const IVtk_IView::Handle& theView); |
52 | |
53 | //! Activates the given selection |
f751596e |
54 | void Activate (const Handle(SelectMgr_Selection)& theSelection); |
913a4c4a |
55 | |
56 | //! Deactivate the given selection |
57 | void Deactivate (const Handle(SelectMgr_Selection)& theSelection); |
58 | |
ec357c5c |
59 | DEFINE_STANDARD_RTTI(IVtkOCC_ViewerSelector, SelectMgr_ViewerSelector) |
913a4c4a |
60 | |
61 | private: |
913a4c4a |
62 | Standard_Integer myPixTol; |
913a4c4a |
63 | Standard_Boolean myToUpdateTol; |
64 | }; |
65 | |
66 | DEFINE_STANDARD_HANDLE( IVtkOCC_ViewerSelector, SelectMgr_ViewerSelector ) |
67 | #endif // __IVTKOCC_VIEWERSELECTOR_H__ |