Back to index

salome-smesh  6.5.0
GeomSelectionTools.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // ---
00021 // File    : GeomSelectionTools.h
00022 // Authors : Nicolas GEIMER (OCC)
00023 // ---
00024 
00025 #ifndef _GEOMSELECTIONTOOLS_H_
00026 #define _GEOMSELECTIONTOOLS_H_
00027 
00028 #ifdef WIN32
00029 #  ifdef GeomSelectionTools_EXPORTS
00030 #    define GEOMSELECTIONTOOLS_EXPORT __declspec( dllexport )
00031 #  else
00032 #    define GEOMSELECTIONTOOLS_EXPORT __declspec( dllimport )
00033 #  endif
00034 #else
00035 #  define GEOMSELECTIONTOOLS_EXPORT
00036 #endif
00037 
00038 #include "SALOMEDSClient.hxx"
00039 #include "SALOME_InteractiveObject.hxx"
00040 #include <SALOME_ListIO.hxx>
00041 #include <SalomeApp_Application.h>
00042 
00043 #include <TopoDS_Shape.hxx>
00044 #include <GeomAbs_SurfaceType.hxx>
00045 
00046 class LightApp_SelectionMgr;
00047 
00048 
00057 class GEOMSELECTIONTOOLS_EXPORT GeomSelectionTools
00058 {
00059 
00060 private:
00061 
00062   _PTR(Study) myStudy;
00063 
00064 public:
00065 
00066   GeomSelectionTools(_PTR(Study));
00067   static SalomeApp_Application*  GetSalomeApplication();
00068   static LightApp_SelectionMgr* selectionMgr();
00069   SALOME_ListIO* getSelectedSalomeObjects();
00070   Handle(SALOME_InteractiveObject) getFirstSelectedSalomeObject();
00071   std::string getFirstSelectedEntry();
00072   std::string getEntryOfObject(Handle(SALOME_InteractiveObject));
00073   std::string getNameFromEntry(std::string);
00074   std::string getFirstSelectedComponentDataType();
00075   TopAbs_ShapeEnum getFirstSelectedShapeType();
00076   TopAbs_ShapeEnum entryToShapeType(std::string );
00077   GeomAbs_SurfaceType getFaceInformation(TopoDS_Shape);
00078   _PTR(Study) getMyStudy();
00079 };
00080 
00082 // Utility functions
00084 
00085 namespace PluginUtils
00086 {
00087   GEOMSELECTIONTOOLS_EXPORT QString PrintDoubleValue( double, int = 16 );
00088 };
00089 
00090 #endif // _GEOMSELECTIONTOOLS_H_
00091