1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SALOME VTKViewer : build VTK viewer into Salome desktop
24 // File : SVTK_RectPicker.h
28 #ifndef __SVTK_RectPicker_h
29 #define __SVTK_RectPicker_h
32 #include "VTKViewer.h"
37 #include <vtkAbstractPropPicker.h>
42 #pragma warning ( disable:4251 )
45 /*! \class vtkAbstractPropPicker
46 * \brief For more information see <a href="http://www.vtk.org/">VTK documentation
48 /*! \class SVTK_RectPicker
49 * \brief Rectangular picker class.
51 class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker
55 SVTK_RectPicker *New();
57 vtkTypeMacro(SVTK_RectPicker,vtkAbstractPropPicker);
60 Specify tolerance for performing pick operation. Tolerance is specified
61 as fraction of rendering window size. (Rendering window size is measured
64 vtkSetMacro(Tolerance,double);
65 vtkGetMacro(Tolerance,double);
67 //! Use these methods to pick points or points and cells
68 vtkSetMacro(PickPoints,int);
69 vtkGetMacro(PickPoints,int);
70 vtkBooleanMacro(PickPoints,int);
74 Pick(double theSelectionX,
77 double theSelectionX2,
78 double theSelectionY2,
79 double theSelectionZ2,
80 vtkRenderer *theRenderer);
83 Pick(double theSelection[3],
84 double theSelection2[3],
85 vtkRenderer *theRenderer);
87 typedef std::vector<vtkIdType> TVectorIds;
88 typedef std::map<vtkActor*,TVectorIds> TVectorIdsMap;
91 GetPointIdsMap() const;
94 GetCellIdsMap() const;
100 //! tolerance for computation (% of window)
103 //! use the following to control picking mode
106 //! second rectangle selection point in window (pixel) coordinates
107 double SelectionPoint2[3];
109 //! second rectangle selection point in world coordinates
110 double PickPosition2[3];
112 TVectorIdsMap myPointIdsMap;
113 TVectorIdsMap myCellIdsMap;
125 #pragma warning ( default:4251 )