Salome HOME
Sorting alphabetically.
[modules/hydro.git] / src / HYDROData / HYDROData_Tool.h
1
2 #ifndef HYDROData_Tool_HeaderFile
3 #define HYDROData_Tool_HeaderFile
4
5 #include <Precision.hxx>
6
7 #include <QString>
8
9 class QFile;
10 class QStringList;
11 class Handle_HYDROData_Document;
12
13 class HYDROData_Tool {
14
15 public:
16
17   static void                           WriteStringsToFile( QFile&             theFile,
18                                                             const QStringList& theStrings,
19                                                             const QString&     theSep = "\n" );
20
21   /**
22    * Enables "MustBeUpdated" flag for Images that are depended on "MustBeUpdated" images.
23    * \param theDoc document where this operation is performed
24    */
25   static void                           SetMustBeUpdatedImages( Handle_HYDROData_Document theDoc );
26
27 };
28
29 inline bool ValuesEquals( const double& theFirst, const double& theSecond )
30 {
31   return theFirst > ( theSecond - Precision::Confusion() ) &&
32          theFirst < ( theSecond + Precision::Confusion() );
33 }
34
35 inline bool ValuesMoreEquals( const double& theFirst, const double& theSecond )
36 {
37   return theFirst >= theSecond || ValuesEquals( theFirst, theSecond );
38 }
39
40 inline  bool ValuesLessEquals( const double& theFirst, const double& theSecond )
41 {
42   return theFirst <= theSecond || ValuesEquals( theFirst, theSecond );
43 }
44
45
46
47
48 #endif
49
50