Salome HOME
Fix for "0023306: [EDF 8444] Mesh controls behavior" issue.
[modules/smesh.git] / src / PluginUtils / GeomSelectionTools.h
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File    : GeomSelectionTools.h
22 // Authors : Nicolas GEIMER (OCC)
23 // ---
24
25 #ifndef _GEOMSELECTIONTOOLS_H_
26 #define _GEOMSELECTIONTOOLS_H_
27
28 #ifdef WIN32
29 #  ifdef GeomSelectionTools_EXPORTS
30 #    define GEOMSELECTIONTOOLS_EXPORT __declspec( dllexport )
31 #  else
32 #    define GEOMSELECTIONTOOLS_EXPORT __declspec( dllimport )
33 #  endif
34 #else
35 #  define GEOMSELECTIONTOOLS_EXPORT
36 #endif
37
38 #include "SALOMEDSClient.hxx"
39 #include "SALOME_InteractiveObject.hxx"
40 #include <SALOME_ListIO.hxx>
41 #include <SalomeApp_Application.h>
42
43 #include <TopoDS_Shape.hxx>
44 #include <GeomAbs_SurfaceType.hxx>
45
46 class LightApp_SelectionMgr;
47
48
49 /*!
50  * The GeomSelectionTools class gives high level tools to select Geom (and other objects)
51  * A specific attention has been given to analyze selected GEOM objects.
52  *
53  * @param myStudy This class is specific to the study !
54  *
55  */
56
57 class GEOMSELECTIONTOOLS_EXPORT GeomSelectionTools
58 {
59
60 private:
61
62   _PTR(Study) myStudy;
63
64 public:
65
66   GeomSelectionTools(_PTR(Study));
67   static SalomeApp_Application*  GetSalomeApplication();
68   static LightApp_SelectionMgr* selectionMgr();
69   SALOME_ListIO* getSelectedSalomeObjects();
70   Handle(SALOME_InteractiveObject) getFirstSelectedSalomeObject();
71   std::string getFirstSelectedEntry();
72   std::string getEntryOfObject(Handle(SALOME_InteractiveObject));
73   std::string getNameFromEntry(std::string);
74   std::string getFirstSelectedComponentDataType();
75   TopAbs_ShapeEnum getFirstSelectedShapeType();
76   TopAbs_ShapeEnum entryToShapeType(std::string );
77   GeomAbs_SurfaceType getFaceInformation(TopoDS_Shape);
78   _PTR(Study) getMyStudy();
79 };
80
81 //////////////////////////////////////////
82 // Utility functions
83 //////////////////////////////////////////
84
85 namespace PluginUtils
86 {
87   GEOMSELECTIONTOOLS_EXPORT QString PrintDoubleValue( double, int = 16 );
88 };
89
90 #endif // _GEOMSELECTIONTOOLS_H_
91