Salome HOME
improve test h003 h008 h016
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_BathymetryPrs.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROGUI_BATHYMETRY_PRS_H
20 #define HYDROGUI_BATHYMETRY_PRS_H
21
22 #include <AIS_PointCloud.hxx>
23 #include <SelectMgr_EntityOwner.hxx>
24 #include <Bnd_Box.hxx>
25 #include <QVector>
26
27 class HYDROGUI_ShapeBathymetry;
28
29 class HYDROGUI_BathymetryPrs : public AIS_PointCloud
30 {
31 public:
32   HYDROGUI_BathymetryPrs( const HYDROGUI_ShapeBathymetry* );
33   virtual ~HYDROGUI_BathymetryPrs();
34
35   virtual void SetPoints( const Handle(TColgp_HArray1OfPnt)&     theCoords,
36                           const Handle(Quantity_HArray1OfColor)& theColors = NULL,
37                           const Handle(TColgp_HArray1OfDir)&     theNormals = NULL) Standard_OVERRIDE;
38
39   int NbPoints() const;
40   gp_Pnt GetPoint( int theIndex ) const;
41
42   virtual void HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
43                                       const Handle(Prs3d_Drawer)& theColor,
44                                       const Handle(SelectMgr_EntityOwner)& theOwner );
45
46   virtual void HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePM,
47                                 const SelectMgr_SequenceOfOwner& theOwners );
48
49   virtual void ClearSelected();
50   virtual void ClearSelectedPoints() {mySelectedPoints.clear();};
51
52   void SetTextLabels( const QVector<int>& );
53
54   HYDROGUI_ShapeBathymetry* GetShape() const;
55
56   QVector<int> getSelectedPoints() {return mySelectedPoints;};
57
58 protected:
59   virtual void Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
60                         const Handle(Prs3d_Presentation)& thePresentation,
61                         const Standard_Integer theMode = 0 ) Standard_OVERRIDE;
62   virtual void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection,
63                                  const Standard_Integer theMode ) Standard_OVERRIDE;
64
65   void UpdateBound();
66   void AddPoint( const Handle(Graphic3d_ArrayOfPoints)&, const Handle(SelectMgr_EntityOwner)& );
67
68 private:
69   const HYDROGUI_ShapeBathymetry* myShape;
70   Bnd_Box myBound;
71   QVector<int> myTextIndices;
72   QVector<int> mySelectedPoints;
73 };
74
75 class HYDROGUI_BathymetryPointOwner : public SelectMgr_EntityOwner
76 {
77 public:
78   HYDROGUI_BathymetryPointOwner( const Handle(HYDROGUI_BathymetryPrs)&, int theIndex );
79   virtual ~HYDROGUI_BathymetryPointOwner();
80
81   virtual Standard_Boolean IsAutoHilight() const;
82   int GetIndex() const;
83
84 private:
85   int myIndex;
86 };
87
88 #endif