Salome HOME
91e1d3db13ea75797d0d78355ed1e7114cd17b5c
[modules/geom.git] / src / MeasureGUI / MeasureGUI_DimensionFilter.h
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : MeasureGUI_DimensionFilter.h
25 // Author : Anton POLETAEV, Open CASCADE S.A.S.
26 //
27 #ifndef MEASUREGUI_DIMENSIONFILTER_H
28 #define MEASUREGUI_DIMENSIONFILTER_H
29
30 // GEOM includes
31 #include <GEOM_GenericObjPtr.h>
32
33 // OCCT includes
34 #include <AIS_InteractiveObject.hxx>
35 #include <SelectMgr_Filter.hxx>
36 #include <Standard_DefineHandle.hxx>
37
38 DEFINE_STANDARD_HANDLE(MeasureGUI_DimensionFilter, SelectMgr_Filter)
39
40 //=====================================================================================
41 // class    : MeasureGUI_DimensionFilter
42 // purpose  : OCC viewer filter for selecting dimensions displayed as part of
43 //            presentation of particular GEOM object by its entry (owner of dimension).
44 //=====================================================================================
45 class MeasureGUI_DimensionFilter : public SelectMgr_Filter
46 {
47 public:
48
49   DEFINE_STANDARD_RTTIEXT(MeasureGUI_DimensionFilter,SelectMgr_Filter)
50
51 public:
52   Standard_EXPORT MeasureGUI_DimensionFilter( const Handle(AIS_InteractiveObject)& theIO );
53   Standard_EXPORT MeasureGUI_DimensionFilter( const int theId );
54   Standard_EXPORT MeasureGUI_DimensionFilter( const std::string& theEntry );
55   Standard_EXPORT MeasureGUI_DimensionFilter( const std::string& theEntry, const int theId );
56
57   Standard_EXPORT void SetFilterIO( const Handle(AIS_InteractiveObject)& theIO );
58   Standard_EXPORT void SetFilterEntry( const std::string& theEntry );
59   Standard_EXPORT void SetFilterId( const int theId );
60
61   Standard_Boolean IsFilterIO() const { return myIsFilterIO; }
62   Standard_Boolean IsFilterEntry() const { return myIsFilterEntry; }
63   Standard_Boolean IsFilterId() const { return myIsFilterId; }
64
65   void UnsetFilterIO() { myIsFilterIO = Standard_False; }
66   void UnsetFilterEntry() { myIsFilterEntry = Standard_False; }
67   void UnsetFilterId() { myIsFilterId = Standard_False; }
68
69   Standard_EXPORT virtual Standard_Boolean IsOk( const Handle(SelectMgr_EntityOwner)& theEntity ) const;
70
71 private:
72   Handle(AIS_InteractiveObject) myFilterIO;
73   std::string                   myFilterEntry;
74   int                           myFilterId;
75   Standard_Boolean              myIsFilterIO;
76   Standard_Boolean              myIsFilterEntry;
77   Standard_Boolean              myIsFilterId;
78 };
79
80 #endif