0026344: Visualization - provide a support of zoom persistent selection
[occt.git] / src / StdSelect / StdSelect_ViewerSelector3d.hxx
CommitLineData
f751596e 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 _StdSelect_ViewerSelector3d_HeaderFile
18#define _StdSelect_ViewerSelector3d_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
ec357c5c 22#include <Standard_Type.hxx>
f751596e 23
825aa485 24#include <Graphic3d_SequenceOfStructure.hxx>
f751596e 25#include <Graphic3d_SequenceOfHClipPlane.hxx>
26#include <SelectMgr_ViewerSelector.hxx>
27#include <SelectMgr_Selection.hxx>
f751596e 28#include <NCollection_Handle.hxx>
29
30class Graphic3d_Group;
31class Graphic3d_Structure;
825aa485 32class Graphic3d_TransformPers;
f751596e 33class V3d_View;
f751596e 34class SelectMgr_EntityOwner;
35class SelectMgr_SelectableObjectSet;
36
37
38//! Selector Usable by Viewers from V3d
39class StdSelect_ViewerSelector3d : public SelectMgr_ViewerSelector
40{
41
42public:
43
44 //! Constructs an empty 3D selector object.
45 Standard_EXPORT StdSelect_ViewerSelector3d();
46
47 //! Sets the pixel tolerance <theTolerance>.
48 Standard_EXPORT void SetPixelTolerance (const Standard_Real theTolerance);
49
50 //! Returns the pixel tolerance.
51 Standard_Real PixelTolerance() const;
52
53 //! Picks the sensitive entity at the pixel coordinates of
54 //! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
55 Standard_EXPORT void Pick (const Standard_Integer theXPix,
56 const Standard_Integer theYPix,
57 const Handle(V3d_View)& theView);
58
59 //! Picks the sensitive entity according to the minimum
60 //! and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax>
61 //! and <theYPMax> defining a 2D area for selection in the 3D view aView.
62 Standard_EXPORT void Pick (const Standard_Integer theXPMin,
63 const Standard_Integer theYPMin,
64 const Standard_Integer theXPMax,
65 const Standard_Integer theYPMax,
66 const Handle(V3d_View)& theView);
67
68 //! pick action - input pixel values for polyline selection for selection.
69 Standard_EXPORT void Pick (const TColgp_Array1OfPnt2d& thePolyline,
70 const Handle(V3d_View)& theView);
71
72 //! Displays sensitives in view <theView>.
73 Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& theView);
74
75 Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& theView);
76
77 Standard_EXPORT void DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
78 const gp_Trsf& theTrsf,
79 const Handle(V3d_View)& theView,
80 const Standard_Boolean theToClearOthers = Standard_True);
81
f751596e 82 Standard_EXPORT virtual Standard_Boolean HasDepthClipping (const Handle(SelectMgr_EntityOwner)& theOwner) const Standard_OVERRIDE;
83
ec357c5c 84 DEFINE_STANDARD_RTTI(StdSelect_ViewerSelector3d, SelectMgr_ViewerSelector)
f751596e 85
86protected:
87
88 //! Set view clipping for the selector.
89 //! @param thePlanes [in] the view planes.
90 Standard_EXPORT void SetClipping (const Graphic3d_SequenceOfHClipPlane& thePlanes);
91
92private:
93
825aa485 94 void ComputeSensitivePrs (const Handle(Graphic3d_Structure)& theStructure,
95 const Handle(SelectMgr_Selection)& theSel,
96 const gp_Trsf& theLoc,
97 const Graphic3d_TransformPers& theTransPers);
f751596e 98
825aa485 99 Graphic3d_SequenceOfStructure myStructs;
f751596e 100 Graphic3d_SequenceOfHClipPlane myClipPlanes;
101};
102
103DEFINE_STANDARD_HANDLE(StdSelect_ViewerSelector3d, SelectMgr_ViewerSelector)
104
105#include <StdSelect_ViewerSelector3d.lxx>
106
107#endif