Salome HOME
Merge branch 'BR_H2018_2' of https://codev-tuleap.cea.fr/plugins/git/salome/hydro...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Tool.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_TOOL_H
20 #define HYDROGUI_TOOL_H
21
22 #include <HYDROData_Entity.h>
23 #include <QString>
24
25 class TCollection_AsciiString;
26 class HYDROData_Document;
27 class Image_PixMap;
28 class TCollection_HAsciiString;
29 class TCollection_HExtendedString;
30 class QDockWidget;
31 class QImage;
32 class QWidget;
33
34 namespace HYDROGUI_Tool
35 {
36   QString ToQString( const TCollection_AsciiString& );
37   QString ToQString( const TCollection_ExtendedString& );
38   QString ToQString( const Handle(TCollection_HAsciiString)& );
39   QString ToQString( const Handle(TCollection_HExtendedString)& );
40   TCollection_AsciiString ToAsciiString( const QString& );
41   TCollection_ExtendedString ToExtString( const QString& );
42   Handle(TCollection_HAsciiString) ToHAsciiString( const QString& );
43   Handle(TCollection_HExtendedString) ToHExtString( const QString& );
44
45   QString GetTempDir( const bool theToCreate );
46
47   QDockWidget* WindowDock( QWidget* wid );
48
49   QStringList FindExistingObjectsNames( const Handle(HYDROData_Document)& theDoc, 
50                                         const ObjectKind theObjectKind, 
51                                         bool isCheckValidProfile = false );
52   QString GetCoordinateString( const double theNumber, bool isInLocale );
53   
54   Handle(Image_PixMap) Pixmap( const QImage& theImage );
55
56   void GetObjectReferences( const Handle(HYDROData_Entity)& theObj,
57                             HYDROData_SequenceOfObjects& theRefObjects,
58                             QStringList& theRefNames );
59   HYDROData_SequenceOfObjects GetObjectBackReferences( const Handle(HYDROData_Entity)& theObj );
60   QMap<QString,HYDROData_SequenceOfObjects> GetObjectsBackReferences
61     ( const Handle(HYDROData_Document)& theDocument, const QStringList& theObjectNames );
62 };
63
64 #endif