1 // SALOME VTKViewer : build VTK viewer into Salome desktop
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : VTKViewer_CellRectPicker.h
23 // Author : Natalia KOPNOVA
27 #ifndef __VTKViewer_CellRectPicker_h
28 #define __VTKViewer_CellRectPicker_h
30 #include "VTKViewer_RectPicker.h"
34 /*! \brief Cell data structure*/
43 typedef std::vector<VTKViewer_CellData> VTKViewer_CellDataSet;
44 typedef std::map<vtkActor*, VTKViewer_CellDataSet> VTKViewer_ActorDataMap;
49 /*!Rectangular cell picker class.*/
50 class VTK_EXPORT VTKViewer_CellRectPicker : public VTKViewer_RectPicker
53 /*!Create new instance of CellRectPicker class.*/
54 static VTKViewer_CellRectPicker *New();
56 /*! \fn vtkTypeMacro(VTKViewer_CellRectPicker,VTKViewer_RectPicker);
57 * \brief VTK type macros.
59 vtkTypeMacro(VTKViewer_CellRectPicker,VTKViewer_RectPicker);
61 /*! \fn VTKViewer_CellDataSet GetCellData(vtkActor* actor)
62 * \brief Get the id of the picked cells.
63 * \brief (Notes: use GetActors() to get picked actors list)
64 * \param actor - vtkActor pointer
66 VTKViewer_CellDataSet GetCellData(vtkActor* actor)
67 { return this->ActorData[actor]; }
69 static int IntersectCells(vtkCell* c1, float d1, vtkCell* c2, float d2, float dir[3]);
71 static char PointInside(float point[3], vtkPoints* list);
75 VTKViewer_CellRectPicker();
76 ~VTKViewer_CellRectPicker();
78 VTKViewer_ActorDataMap ActorData;
80 virtual float IntersectWithHex(float p1[4][4], float p2[4][4], float tol,
81 vtkAssemblyPath *path, vtkProp3D *p,
82 vtkAbstractMapper3D *m);
87 void IncludeCell(vtkDataSet* input, VTKViewer_CellData cellData, VTKViewer_CellDataSet& dalaList);
88 void IncludeActor(vtkProp3D* prop, vtkDataSet* input, VTKViewer_CellDataSet& dataList);