Salome HOME
0023505: Sigsegv with fuse on cylinder and cone
[modules/geom.git] / src / MeasureGUI / MeasureGUI_DimensionFilter.h
1 // Copyright (C) 2007-2016  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 // KERNEL includes
31 #include <Basics_OCCTVersion.hxx>
32
33 // GEOM includes
34 #include <GEOM_GenericObjPtr.h>
35
36 // OCCT includes
37 #include <AIS_InteractiveObject.hxx>
38 #include <SelectMgr_Filter.hxx>
39 #include <Standard_DefineHandle.hxx>
40
41 DEFINE_STANDARD_HANDLE(MeasureGUI_DimensionFilter, SelectMgr_Filter)
42
43 //=====================================================================================
44 // class    : MeasureGUI_DimensionFilter
45 // purpose  : OCC viewer filter for selecting dimensions displayed as part of
46 //            presentation of particular GEOM object by its entry (owner of dimension).
47 //=====================================================================================
48 class MeasureGUI_DimensionFilter : public SelectMgr_Filter
49 {
50 public:
51
52   OCCT_DEFINE_STANDARD_RTTIEXT(MeasureGUI_DimensionFilter,SelectMgr_Filter)
53
54 public:
55   Standard_EXPORT MeasureGUI_DimensionFilter( const Handle(AIS_InteractiveObject)& theIO );
56   Standard_EXPORT MeasureGUI_DimensionFilter( const int theId );
57   Standard_EXPORT MeasureGUI_DimensionFilter( const std::string& theEntry );
58   Standard_EXPORT MeasureGUI_DimensionFilter( const std::string& theEntry, const int theId );
59
60   Standard_EXPORT void SetFilterIO( const Handle(AIS_InteractiveObject)& theIO );
61   Standard_EXPORT void SetFilterEntry( const std::string& theEntry );
62   Standard_EXPORT void SetFilterId( const int theId );
63
64   Standard_Boolean IsFilterIO() const { return myIsFilterIO; }
65   Standard_Boolean IsFilterEntry() const { return myIsFilterEntry; }
66   Standard_Boolean IsFilterId() const { return myIsFilterId; }
67
68   void UnsetFilterIO() { myIsFilterIO = Standard_False; }
69   void UnsetFilterEntry() { myIsFilterEntry = Standard_False; }
70   void UnsetFilterId() { myIsFilterId = Standard_False; }
71
72   Standard_EXPORT virtual Standard_Boolean IsOk( const Handle(SelectMgr_EntityOwner)& theEntity ) const;
73
74 private:
75   Handle(AIS_InteractiveObject) myFilterIO;
76   std::string                   myFilterEntry;
77   int                           myFilterId;
78   Standard_Boolean              myIsFilterIO;
79   Standard_Boolean              myIsFilterEntry;
80   Standard_Boolean              myIsFilterId;
81 };
82
83 #endif