Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCK / hexa_base.hxx
old mode 100755 (executable)
new mode 100644 (file)
index e79dd9e..aee9961
@@ -1,12 +1,12 @@
 
 // Incl : Common definitions for HEXA-BLOCK
 
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,8 +17,7 @@
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
-// or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #define DumpActif true
@@ -84,13 +83,12 @@ typedef FILE*       pfile;
 typedef const std::string& rcstring;
                        // Impressions de mise au point
 #include <iostream>
-using namespace std;
 
-#define HexDisplay(x)   cout << " ... " #x " = " << x << endl
-#define PutData(x)      cout << " ... " #x " = " << x << endl
-#define PutCoord(x)     cout << " ... " #x " = (" << x[0] << ", " \
-                              << x[1] << ", " << x[2] << ")"  << endl
-#define Echo(m)         cout << " _______________ " << m << endl
+#define HexDisplay(x)   std::cout << " ... " #x " = " << x << std::endl
+#define PutData(x)      std::cout << " ... " #x " = " << x << std::endl
+#define PutCoord(x)     std::cout << " ... " #x " = (" << x[0] << ", " \
+                              << x[1] << ", " << x[2] << ")"  << std::endl
+#define Echo(m)         std::cout << " _______________ " << m << std::endl
 
 //  #define Libere(obj)     { if (obj!=NULL) free (obj)      ;  obj=NULL; }
 //  #define Destroy(obj)    { delete obj       ;  obj=NULL   ;            }
@@ -173,9 +171,9 @@ enum EnumHVertex {V_ACE, V_ACF, V_ADE, V_ADF, V_BCE, V_BCF, V_BDE, V_BDF,
 
 enum EnumQDirection {Q_INSIDE, Q_DIRECT, Q_INVERSE, Q_UNDEFINED, Q_WAITING };
 
-enum EnumKindOfShape {KS_None, KS_Line, KS_Circle, KS_Ellipse, KS_Hyperbola,
+enum EnumKindOfShape {KS_Line, KS_Circle, KS_Ellipse, KS_Hyperbola,
                       KS_Parabola, KS_BezierCurve, KS_BSplineCurve,
-                      KS_OtherCurve };
+                      KS_OtherCurve, KS_None=-1 };
 
 enum { CylSmall=0, CylBig=1, NxInt=1, NxExt=2 };
 
@@ -240,49 +238,60 @@ typedef std::vector <std::string> TabText;
 typedef double Real;
 typedef double Real3 [DIM3];
 
+                                  // a cause de Swig
+#ifndef HEXABLOCKENGINE_EXPORT 
+#define HEXABLOCKENGINE_EXPORT 
+#endif 
+
+#ifndef HexaExport 
+#define HexaExport 
+#endif 
+
                         // Quelques fonctions :
 
-HEXABLOCKENGINE_EXPORT pchar   get_temp_name (cpchar format, pchar nomfic);
-HEXABLOCKENGINE_EXPORT void    fatal_error   (cpchar format, cpchar info1=NULL, cpchar info2=NULL);
+HexaExport pchar   get_temp_name (cpchar format, pchar nomfic);
+HexaExport void    fatal_error   (cpchar format, cpchar info1=NULL, cpchar info2=NULL);
 
-HEXABLOCKENGINE_EXPORT double   prod_scalaire  (double v1[], double v2[]);
-HEXABLOCKENGINE_EXPORT double* prod_vectoriel (double v1[], double v2[], double v3[]);
-HEXABLOCKENGINE_EXPORT double  prod_mixte     (double vi[], double vj[], double vk[]);
+HexaExport double  prod_scalaire  (double v1[], double v2[]);
+HexaExport double* prod_vectoriel (double v1[], double v2[], double v3[]);
+HexaExport double  prod_mixte     (double vi[], double vj[], double vk[]);
 
-HEXABLOCKENGINE_EXPORT inline  double deg2radians (double angle) {  return (angle*M_PI/180.0); }
-HEXABLOCKENGINE_EXPORT inline  double rad2degres  (double angle) {  return (angle*180.0/M_PI); }
+HexaExport inline  double deg2radians (double angle) {  return (angle*M_PI/180.0); }
+HexaExport inline  double rad2degres  (double angle) {  return (angle*180.0/M_PI); }
 
-HEXABLOCKENGINE_EXPORT double  calc_norme     (double v1[]);
-HEXABLOCKENGINE_EXPORT double  calc_distance  (double v1[], double v2[]);
-HEXABLOCKENGINE_EXPORT void    calc_vecteur   (double pta[], double ptb[], double vab[]);
-HEXABLOCKENGINE_EXPORT void    copy_vecteur   (double va [], double vb []);
-HEXABLOCKENGINE_EXPORT void    calc_milieu    (double pta[], double ptb[], double milieu[]);
-HEXABLOCKENGINE_EXPORT int     normer_vecteur (double v1[]);
+HexaExport double  calc_norme     (double v1[]);
+HexaExport double  calc_distance  (double v1[],  double v2[]);
+HexaExport double  calc_d2        (double v1[],  double v2[]);
+HexaExport double  calc_d2        (double v1[], double v2[]);
+HexaExport void    calc_vecteur   (double pta[], double ptb[], double vab[]);
+HexaExport void    copy_vecteur   (double va [], double vb []);
+HexaExport void    calc_milieu    (double pta[], double ptb[], double milieu[]);
+HexaExport int     normer_vecteur (double v1[]);
 
-HEXABLOCKENGINE_EXPORT double  carre       (double val);
-HEXABLOCKENGINE_EXPORT bool    same_coords (double* pa, double* pb, double epsilon=1e-6);
+HexaExport double  carre       (double val);
+HexaExport bool    same_coords (double* pa, double* pb, double epsilon=1e-6);
 
-HEXABLOCKENGINE_EXPORT bool requals (const double  v1, const double  v2);
-HEXABLOCKENGINE_EXPORT bool requals (const double* v1, const double* v2);
+HexaExport bool requals (const double  v1, const double  v2);
+HexaExport bool requals (const double* v1, const double* v2);
 
-HEXABLOCKENGINE_EXPORT bool    on_debug();     // == getenv ("HEXA_DB") > 0
-HEXABLOCKENGINE_EXPORT bool   in_test ();     // == getenv ("HEXA_TEST") > 0
-HEXABLOCKENGINE_EXPORT int    niv_debug();    // Implemente prochainement
+HexaExport bool   on_debug();     // == getenv ("HEXA_DB") > 0
+HexaExport bool   in_test ();     // == getenv ("HEXA_TEST") > 0
+HexaExport int    niv_debug();    // Implemente prochainement
 
-HEXABLOCKENGINE_EXPORT void   set_minus (string& chaine);
+HexaExport void   set_minus (std::string& chaine);
 
-HEXABLOCKENGINE_EXPORT bool   special_option ();
-HEXABLOCKENGINE_EXPORT void   set_special_option (bool opt);
+HexaExport bool   special_option ();
+HexaExport void   set_special_option (bool opt);
 
-HEXABLOCKENGINE_EXPORT int    sizeof_file (cpchar filename);
-HEXABLOCKENGINE_EXPORT char*  read_file   (cpchar filename, int& size);
-HEXABLOCKENGINE_EXPORT cpchar get_time   (string& buffer);
+HexaExport int    sizeof_file (cpchar filename);
+HexaExport char*  read_file   (cpchar filename, int& size);
+HexaExport cpchar get_time   (std::string& buffer);
+HexaExport int make_basename (cpchar filename, std::string& base);
 
 const double Epsil   = 1e-6;
 const double UnEpsil = 0.999999;
 const double Epsil2  = 1e-12;
 
-
 END_NAMESPACE_HEXA
 
 #endif