7f24b768 |
1 | // Created on: 1995-03-15 |
2 | // Created by: Robert COUBLANC |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _SelectMgr_ViewerSelector3d_HeaderFile |
18 | #define _SelectMgr_ViewerSelector3d_HeaderFile |
19 | |
20 | #include <Graphic3d_SequenceOfStructure.hxx> |
21 | #include <SelectMgr_ViewerSelector.hxx> |
22 | #include <SelectMgr_Selection.hxx> |
23 | #include <StdSelect_TypeOfSelectionImage.hxx> |
24 | |
25 | class Graphic3d_Structure; |
26 | class Graphic3d_TransformPers; |
27 | class V3d_View; |
28 | |
29 | //! Selector Usable by Viewers from V3d |
30 | class SelectMgr_ViewerSelector3d : public SelectMgr_ViewerSelector |
31 | { |
32 | DEFINE_STANDARD_RTTIEXT(SelectMgr_ViewerSelector3d, SelectMgr_ViewerSelector) |
33 | public: |
34 | |
35 | //! Constructs an empty 3D selector object. |
36 | Standard_EXPORT SelectMgr_ViewerSelector3d(); |
37 | |
38 | //! Picks the sensitive entity at the pixel coordinates of |
39 | //! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners. |
40 | Standard_EXPORT void Pick (const Standard_Integer theXPix, |
41 | const Standard_Integer theYPix, |
42 | const Handle(V3d_View)& theView); |
43 | |
44 | //! Picks the sensitive entity according to the minimum |
45 | //! and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax> |
46 | //! and <theYPMax> defining a 2D area for selection in the 3D view aView. |
47 | Standard_EXPORT void Pick (const Standard_Integer theXPMin, |
48 | const Standard_Integer theYPMin, |
49 | const Standard_Integer theXPMax, |
50 | const Standard_Integer theYPMax, |
51 | const Handle(V3d_View)& theView); |
52 | |
53 | //! pick action - input pixel values for polyline selection for selection. |
54 | Standard_EXPORT void Pick (const TColgp_Array1OfPnt2d& thePolyline, |
55 | const Handle(V3d_View)& theView); |
56 | |
57 | //! Dump of detection results into image. |
58 | //! This method performs axis picking for each pixel in the image |
59 | //! and generates a color depending on picking results and selection image type. |
60 | //! @param theImage result image, should be initialized |
61 | //! @param theView 3D view defining camera position |
62 | //! @param theType type of image to define |
63 | //! @param thePickedIndex index of picked entity (1 means topmost) |
64 | Standard_EXPORT Standard_Boolean ToPixMap (Image_PixMap& theImage, |
65 | const Handle(V3d_View)& theView, |
66 | const StdSelect_TypeOfSelectionImage theType, |
67 | const Standard_Integer thePickedIndex = 1); |
68 | |
69 | public: |
70 | |
71 | //! Displays sensitives in view <theView>. |
72 | Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& theView); |
73 | |
74 | Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& theView); |
75 | |
76 | Standard_EXPORT void DisplaySensitive (const Handle(SelectMgr_Selection)& theSel, |
77 | const gp_Trsf& theTrsf, |
78 | const Handle(V3d_View)& theView, |
79 | const Standard_Boolean theToClearOthers = Standard_True); |
80 | |
81 | //! Dumps the content of me into the stream |
82 | Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; |
83 | |
84 | protected: |
85 | |
86 | //! Update z-layers order map. |
87 | Standard_EXPORT void updateZLayers (const Handle(V3d_View)& theView); |
88 | |
89 | protected: |
90 | |
91 | Graphic3d_SequenceOfStructure myStructs; //!< list of debug presentations |
92 | }; |
93 | |
94 | DEFINE_STANDARD_HANDLE(SelectMgr_ViewerSelector3d, SelectMgr_ViewerSelector) |
95 | |
96 | #endif |