0030480: Visualization - Clear of Select3D_SensitiveGroup does not update internal...
[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>
decdee7d 28#include <StdSelect_TypeOfSelectionImage.hxx>
f751596e 29#include <NCollection_Handle.hxx>
decdee7d 30#include <V3d_ImageDumpOptions.hxx>
f751596e 31
32class Graphic3d_Group;
33class Graphic3d_Structure;
825aa485 34class Graphic3d_TransformPers;
f751596e 35class V3d_View;
f751596e 36class SelectMgr_EntityOwner;
37class SelectMgr_SelectableObjectSet;
38
39
40//! Selector Usable by Viewers from V3d
41class StdSelect_ViewerSelector3d : public SelectMgr_ViewerSelector
42{
43
44public:
45
46 //! Constructs an empty 3D selector object.
47 Standard_EXPORT StdSelect_ViewerSelector3d();
48
49 //! Sets the pixel tolerance <theTolerance>.
3bf9a45f 50 Standard_EXPORT void SetPixelTolerance (const Standard_Integer theTolerance);
f751596e 51
52 //! Returns the pixel tolerance.
51004f1c 53 Standard_Integer PixelTolerance() const { return myTolerances.Tolerance(); }
f751596e 54
55 //! Picks the sensitive entity at the pixel coordinates of
56 //! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
57 Standard_EXPORT void Pick (const Standard_Integer theXPix,
58 const Standard_Integer theYPix,
59 const Handle(V3d_View)& theView);
60
61 //! Picks the sensitive entity according to the minimum
62 //! and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax>
63 //! and <theYPMax> defining a 2D area for selection in the 3D view aView.
64 Standard_EXPORT void Pick (const Standard_Integer theXPMin,
65 const Standard_Integer theYPMin,
66 const Standard_Integer theXPMax,
67 const Standard_Integer theYPMax,
68 const Handle(V3d_View)& theView);
69
70 //! pick action - input pixel values for polyline selection for selection.
71 Standard_EXPORT void Pick (const TColgp_Array1OfPnt2d& thePolyline,
72 const Handle(V3d_View)& theView);
73
decdee7d 74 //! Dump of detection results into image.
75 //! This method performs axis picking for each pixel in the image
76 //! and generates a color depending on picking results and selection image type.
77 //! @param theImage result image, should be initialized
78 //! @param theView 3D view defining camera position
79 //! @param theType type of image to define
80 //! @param thePickedIndex index of picked entity (1 means topmost)
81 Standard_EXPORT Standard_Boolean ToPixMap (Image_PixMap& theImage,
82 const Handle(V3d_View)& theView,
83 const StdSelect_TypeOfSelectionImage theType,
84 const Standard_Integer thePickedIndex = 1);
85
f751596e 86 //! Displays sensitives in view <theView>.
87 Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& theView);
88
89 Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& theView);
90
91 Standard_EXPORT void DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
92 const gp_Trsf& theTrsf,
93 const Handle(V3d_View)& theView,
94 const Standard_Boolean theToClearOthers = Standard_True);
95
f751596e 96 Standard_EXPORT virtual Standard_Boolean HasDepthClipping (const Handle(SelectMgr_EntityOwner)& theOwner) const Standard_OVERRIDE;
97
92efcf78 98 DEFINE_STANDARD_RTTIEXT(StdSelect_ViewerSelector3d,SelectMgr_ViewerSelector)
f751596e 99
1593b4ee 100protected:
f751596e 101
1593b4ee 102 Standard_EXPORT void computeSensitivePrs (const Handle(Graphic3d_Structure)& theStructure,
103 const Handle(SelectMgr_Selection)& theSel,
104 const gp_Trsf& theLoc,
778cd667 105 const Handle(Graphic3d_TransformPers)& theTrsfPers);
1593b4ee 106
107 //! Update z-layers order map.
108 Standard_EXPORT void updateZLayers (const Handle(V3d_View)& theView);
109
110protected:
f751596e 111
825aa485 112 Graphic3d_SequenceOfStructure myStructs;
f751596e 113};
114
115DEFINE_STANDARD_HANDLE(StdSelect_ViewerSelector3d, SelectMgr_ViewerSelector)
116
f751596e 117#endif