if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
#endif /* VERIFICATION */
+#ifdef WIN32
+ #if defined HOMARDIMPL_EXPORTS || defined HOMARDImpl_EXPORTS
+ #define HOMARDIMPL_EXPORT __declspec( dllexport )
+ #else
+ #define HOMARDIMPL_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define HOMARDIMPL_EXPORT
+#endif
+
#endif
mesCoor.push_back( _Rayon2 );
break ;
}
- VERIFICATION( (_Type>=1) and (_Type<=4) ) ;
+ VERIFICATION( (_Type>=1) && (_Type<=4) ) ;
}
return mesCoor;
}
#ifndef _HOMARD_Boundary_HXX_
#define _HOMARD_Boundary_HXX_
+#include "HOMARD.hxx"
+
#include <vector>
#include <string>
#include <list>
-class HOMARD_Boundary
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#endif
+
+class HOMARDIMPL_EXPORT HOMARD_Boundary
{
public:
HOMARD_Boundary();
#include <sys/stat.h>
#ifndef WIN32
-# include <unistd.h>
+#include <unistd.h>
+#else
+#include <direct.h>
#endif
//=============================================================================
MESSAGE("SetDirName, _ListIter.size() : "<<_ListIter.size());
if ( _ListIter.size() > 1 ) { erreur = 1 ; }
// Creation
- if ( chdir(NomDir) == 0 ) { _NomDir = std::string( NomDir ); }
+#ifndef WIN32
+ if ( chdir(NomDir) == 0 )
+#else
+ if ( _chdir(NomDir) == 0 )
+#endif
+ { _NomDir = std::string( NomDir ); }
else
{
+
+#ifndef WIN32
if ( mkdir(NomDir, S_IRWXU|S_IRGRP|S_IXGRP) == 0 )
{
- if ( chdir(NomDir) == 0 ) { _NomDir = std::string( NomDir ); }
+ if ( chdir(NomDir) == 0 )
+#else
+ if ( _mkdir(NomDir) == 0 )
+ {
+ if ( _chdir(NomDir) == 0 )
+#endif
+ { _NomDir = std::string( NomDir ); }
else { erreur = 2 ; }
}
else { erreur = 2 ; }
#ifndef _HOMARD_CAS_HXX_
#define _HOMARD_CAS_HXX_
+#include "HOMARD.hxx"
+
#include <string>
#include <list>
#include <vector>
-class HOMARD_Cas
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#endif
+
+class HOMARDIMPL_EXPORT HOMARD_Cas
{
public:
HOMARD_Cas();
// Les coordonnees des zones : le nombre depend du type
std::vector<double> coords;
int lgcoords ;
- if ( ZoneType == 2 or ( ZoneType >= 11 and ZoneType <= 13 ) ) { lgcoords = 6 ; }
+ if ( ZoneType == 2 || ( ZoneType >= 11 && ZoneType <= 13 ) ) { lgcoords = 6 ; }
else if ( ZoneType == 4 ) { lgcoords = 4 ; }
- else if ( ZoneType == 5 or ( ZoneType >= 31 and ZoneType <= 33 ) ) { lgcoords = 8 ; }
- else if ( ZoneType == 7 or ( ZoneType >= 61 and ZoneType <= 63 ) ) { lgcoords = 9 ; }
+ else if ( ZoneType == 5 || ( ZoneType >= 31 && ZoneType <= 33 ) ) { lgcoords = 8 ; }
+ else if ( ZoneType == 7 || ( ZoneType >= 61 && ZoneType <= 63 ) ) { lgcoords = 9 ; }
else return false;
coords.resize( lgcoords );
for ( int i = 0; i < lgcoords; i++ ) {
if ( !ok ) return false;
coords[i] = strtod( chunk.c_str(), 0 );
}
- if ( ZoneType == 2 or ( ZoneType >= 11 and ZoneType <= 13 ) )
+ if ( ZoneType == 2 || ( ZoneType >= 11 && ZoneType <= 13 ) )
{ zone.SetBox( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5] ); }
else if ( ZoneType == 4 )
{ zone.SetSphere( coords[0], coords[1], coords[2], coords[3] ); }
- else if ( ZoneType == 5 or ( ZoneType >= 31 and ZoneType <= 33 ) )
+ else if ( ZoneType == 5 || ( ZoneType >= 31 && ZoneType <= 33 ) )
{ zone.SetCylinder( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7] ); }
- else if ( ZoneType == 7 or ( ZoneType >= 61 and ZoneType <= 63 ) )
+ else if ( ZoneType == 7 || ( ZoneType >= 61 && ZoneType <= 63 ) )
{ zone.SetPipe( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7], coords[8] ); }
// Remarque : la taille de coords est suffisante pour les limites
for ( int i = 0; i < 3; i++ ) {
#ifndef HOMARD_DRIVERTOOLS_H
#define HOMARD_DRIVERTOOLS_H
+#include "HOMARD.hxx"
+
#include <string>
class HOMARD_Boundary;
typedef enum { Case, Zone, Hypothesis, Iteration, Boundary, YACS } SignatureType;
//! get persistence signature
- std::string GetSignature( SignatureType type );
+ HOMARDIMPL_EXPORT std::string GetSignature( SignatureType type );
//! get data separator
- std::string separator();
+ HOMARDIMPL_EXPORT std::string separator();
//! dump boundary to the string
- std::string Dump( const ::HOMARD_Boundary& boundary );
+ HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Boundary& boundary );
//! dump case to the string
- std::string Dump( const ::HOMARD_Cas& cas );
+ HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Cas& cas );
//! dump iteration to the string
- std::string Dump( const ::HOMARD_Iteration& iteration );
+ HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Iteration& iteration );
//! dump hypothesis to the string
- std::string Dump( const ::HOMARD_Hypothesis& hypothesis );
+ HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Hypothesis& hypothesis );
//! dump zone to the string
- std::string Dump( const ::HOMARD_Zone& zone );
+ HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Zone& zone );
//! dump yacs to the string
- std::string Dump( const ::HOMARD_YACS& yacs );
+ HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_YACS& yacs );
//! restore boundary from the string
- bool Restore( ::HOMARD_Boundary& boundary, const std::string& stream );
+ HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Boundary& boundary, const std::string& stream );
//! restore case from the string
- bool Restore( ::HOMARD_Cas& cas, const std::string& stream );
+ HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Cas& cas, const std::string& stream );
//! restore hypothesis from the string
- bool Restore( ::HOMARD_Hypothesis& hypothesis, const std::string& stream );
+ HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Hypothesis& hypothesis, const std::string& stream );
//! restore iteration from the string
- bool Restore( ::HOMARD_Iteration& iteration, const std::string& stream );
+ HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Iteration& iteration, const std::string& stream );
//! restore zone from the string
- bool Restore( ::HOMARD_Zone& zone, const std::string& stream );
+ HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Zone& zone, const std::string& stream );
//! restore yacs from the string
- bool Restore( ::HOMARD_YACS& yacs, const std::string& stream );
+ HOMARDIMPL_EXPORT bool Restore( ::HOMARD_YACS& yacs, const std::string& stream );
};
#endif // HOMARD_DRIVERTOOLS_H
#ifndef _HOMARD_GEN_HXX_
#define _HOMARD_GEN_HXX_
-class HOMARD_Gen
+#include "HOMARD.hxx"
+
+class HOMARDIMPL_EXPORT HOMARD_Gen
{
public :
HOMARD_Gen();
//=============================================================================
void HOMARD_Hypothesis::SetAdapType( int TypeAdap )
{
- VERIFICATION( (TypeAdap>=-1) and (TypeAdap<=1) );
+ VERIFICATION( (TypeAdap>=-1) && (TypeAdap<=1) );
_TypeAdap = TypeAdap;
}
//=============================================================================
//=============================================================================
void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera )
{
- VERIFICATION( (TypeRaff>=-1) and (TypeRaff<=1) );
+ VERIFICATION( (TypeRaff>=-1) && (TypeRaff<=1) );
_TypeRaff = TypeRaff;
- VERIFICATION( (TypeDera>=-1) and (TypeDera<=1) );
+ VERIFICATION( (TypeDera>=-1) && (TypeDera<=1) );
_TypeDera = TypeDera;
}
//=============================================================================
//=============================================================================
void HOMARD_Hypothesis::SetUseField( int UsField )
{
- VERIFICATION( (UsField>=0) and (UsField<=1) );
+ VERIFICATION( (UsField>=0) && (UsField<=1) );
_UsField = UsField;
}
//=============================================================================
//=============================================================================
void HOMARD_Hypothesis::SetUseComp( int UsCmpI )
{
- VERIFICATION( (UsCmpI>=0) and (UsCmpI<=2) );
+ VERIFICATION( (UsCmpI>=0) && (UsCmpI<=2) );
_UsCmpI = UsCmpI;
}
//=============================================================================
void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR )
{
MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR );
- VERIFICATION( (TypeThR>=0) and (TypeThR<=4) );
+ VERIFICATION( (TypeThR>=0) && (TypeThR<=4) );
_TypeThR = TypeThR;
_ThreshR = ThreshR;
}
//=============================================================================
void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC )
{
- VERIFICATION( (TypeThC>=0) and (TypeThC<=4) );
+ VERIFICATION( (TypeThC>=0) && (TypeThC<=4) );
_TypeThC = TypeThC;
_ThreshC = ThreshC;
}
// 2 : certains champs sont interpoles
void HOMARD_Hypothesis::SetTypeFieldInterp( int TypeFieldInterp )
{
- VERIFICATION( (TypeFieldInterp>=0) and (TypeFieldInterp<=2) );
+ VERIFICATION( (TypeFieldInterp>=0) && (TypeFieldInterp<=2) );
_TypeFieldInterp = TypeFieldInterp;
}
//=============================================================================
#ifndef _HOMARD_HYPOTHESIS_HXX_
#define _HOMARD_HYPOTHESIS_HXX_
+#include "HOMARD.hxx"
+
#include <string>
#include <list>
-class HOMARD_Hypothesis
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#endif
+
+class HOMARDIMPL_EXPORT HOMARD_Hypothesis
{
public:
HOMARD_Hypothesis();
#ifndef _HOMARD_ITER_HXX_
#define _HOMARD_ITER_HXX_
+#include "HOMARD.hxx"
+
#include <string>
#include <list>
-class HOMARD_Iteration
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#endif
+
+class HOMARDIMPL_EXPORT HOMARD_Iteration
{
public:
HOMARD_Iteration();
#ifndef _HOMARD_YACS_HXX_
#define _HOMARD_YACS_HXX_
+#include "HOMARD.hxx"
+
#include <string>
#include <list>
-class HOMARD_YACS
+class HOMARDIMPL_EXPORT HOMARD_YACS
{
public:
HOMARD_YACS();
// MESSAGE("GetDumpPython avec _Name " << _Name) ;
std::ostringstream aScript;
aScript << "\n# Creation of the ";
- if ( _Type >= 11 and _Type <= 13 ) { aScript << "rectangle " ; }
+ if ( _Type >= 11 && _Type <= 13 ) { aScript << "rectangle " ; }
else if ( _Type == 2 ) { aScript << "box " ;}
- else if ( _Type >= 31 and _Type <= 33 ) { aScript << "disk " ;}
+ else if ( _Type >= 31 && _Type <= 33 ) { aScript << "disk " ;}
else if ( _Type == 4 ) { aScript << "sphere " ; }
else if ( _Type == 5 ) { aScript << "cylinder " ; }
- else if ( _Type >= 61 and _Type <= 63 ) { aScript << "disk with hole " ;}
+ else if ( _Type >= 61 && _Type <= 63 ) { aScript << "disk with hole " ;}
else if ( _Type == 7 ) { aScript << "pipe " ; }
aScript << _Name << "\n" ;
//
mesCoor.push_back( _Rayonint ) ;
break ;
}
- VERIFICATION ( ( (_Type>10) and (_Type<14) ) or (_Type==2) or ( (_Type>30) and (_Type<34) ) or (_Type==4) or (_Type==5) or ( (_Type>60) and (_Type<64) ) or (_Type==7) ) ;
+ VERIFICATION ( ( (_Type>10) && (_Type<14) ) || (_Type==2) || ( (_Type>30) && (_Type<34) ) || (_Type==4) || (_Type==5) || ( (_Type>60) && (_Type<64) ) || (_Type==7) ) ;
}
return mesCoor;
}
#ifndef _HOMARD_Zone_HXX_
#define _HOMARD_Zone_HXX_
+#include "HOMARD.hxx"
+
#include <vector>
#include <string>
#include <list>
-class HOMARD_Zone
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#endif
+
+class HOMARDIMPL_EXPORT HOMARD_Zone
{
public:
HOMARD_Zone();
// Pilote l'ecriture du fichier de configuration pour lancer l'execution de HOMARD
#include <cstring>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <sys/stat.h>
#include "HomardDriver.hxx"
// <0 signifie que l'on deraffinera
//
int ZoneTypeHOMARD ;
- if ( ZoneType >= 11 and ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; }
- else if ( ZoneType >= 31 and ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; }
- else if ( ZoneType >= 61 and ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; }
+ if ( ZoneType >= 11 && ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; }
+ else if ( ZoneType >= 31 && ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; }
+ else if ( ZoneType >= 61 && ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; }
else { ZoneTypeHOMARD = ZoneType ; }
//
if ( TypeUse < 0 ) { ZoneTypeHOMARD = -ZoneTypeHOMARD ; }
//
// Cas du disque
//
- else if ( ZoneType == 31 or ZoneType == 61 )
+ else if ( ZoneType == 31 || ZoneType == 61 )
{
saux += "# Sphere\n" ;
{ std::stringstream saux1 ;
saux += "ZoRaRayI " + saux1.str() + "\n" ;
}
}
- else if ( ZoneType == 32 or ZoneType == 62 )
+ else if ( ZoneType == 32 || ZoneType == 62 )
{
saux += "# Sphere\n" ;
{ std::stringstream saux1 ;
saux += "ZoRaRayI " + saux1.str() + "\n" ;
}
}
- else if ( ZoneType == 33 or ZoneType == 63 )
+ else if ( ZoneType == 33 || ZoneType == 63 )
{
saux += "# Sphere\n" ;
{ std::stringstream saux1 ;
//
// Cas du cylindre ou du tuyau
//
- else if ( ZoneType == 5 or ZoneType == 7 )
+ else if ( ZoneType == 5 || ZoneType == 7 )
{
if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; }
else { saux += "# Tuyau\n" ; }
{ saux += "# Cylindre\n" ; }
if ( BoundaryType == 2 )
{ saux += "# Sphere\n" ; }
- if ( BoundaryType == 3 or BoundaryType == 4 )
+ if ( BoundaryType == 3 || BoundaryType == 4 )
{ saux += "# Cone\n" ; }
//
// Le nom de la frontiere
# ifndef _HOMARDDRIVER_HXX_
# define _HOMARDDRIVER_HXX_
+#include "HOMARD.hxx"
+
#include <iostream>
#include <fstream>
-class HomardDriver
+class HOMARDIMPL_EXPORT HomardDriver
{
public:
HomardDriver(const std::string siter, const std::string siterp1);
// Pilote l'ecriture du fichier xml pour lancer un schema YACS
#include <cstring>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <sys/stat.h>
#include "YACSDriver.hxx"
}
//
// 4.2. Cas du rectangle (11, 12, 13)
- else if ( ( ZoneType > 10 ) and ( ZoneType < 14 ) )
+ else if ( ( ZoneType > 10 ) && ( ZoneType < 14 ) )
{
_Texte += Texte_inport( "double", "Umini" ) ;
_Texte += Texte_inport( "double", "Umaxi" ) ;
}
//
// 4.2. Cas du disque (31, 32, 33) ou du disque perce (61, 62, 63)
- else if ( ( ( ZoneType > 30 ) and ( ZoneType < 34 ) ) or ( ( ZoneType > 60 ) and ( ZoneType < 64 ) ) )
+ else if ( ( ( ZoneType > 30 ) && ( ZoneType < 34 ) ) || ( ( ZoneType > 60 ) && ( ZoneType < 64 ) ) )
{
_Texte += Texte_inport( "double", "Ucentre" ) ;
_Texte += Texte_inport( "double", "Vcentre" ) ;
}
//
// 4.2. Cas du cylindre (5) ou du tuyau (7)
- else if ( ZoneType == 5 or ZoneType == 7 )
+ else if ( ZoneType == 5 || ZoneType == 7 )
{
_Texte += Texte_inport( "double", "Xcentre" ) ;
_Texte += Texte_inport( "double", "Ycentre" ) ;
# ifndef __YACSDRIVER_H__
# define __YACSDRIVER_H__
+#include "HOMARD.hxx"
+
#include <iostream>
#include <fstream>
-class YACSDriver
+class HOMARDIMPL_EXPORT YACSDriver
{
public:
YACSDriver(const std::string XMLFile, const std::string DirName) ;
HOMARDGUI_Utils.h
EditFile.h
HomardQtCommun.h
+ HOMARDGUI_Exports.hxx
)
# header files / to install
// Author : Paul RASCLE, EDF
// Module : HOMARD
-using namespace std;
#include "HOMARDGUI.h"
// SALOME Includes
#include "SALOMEDS_Study.hxx"
#include "HOMARDGUI_Utils.h"
+using namespace std;
+
static CORBA::ORB_var _orb;
//=======================================================================
if (obj)
{
// Suppression d'une frontiere
- if ( HOMARD_UTILS::isBoundaryDi(obj) or HOMARD_UTILS::isBoundaryAn(obj) )
+ if ( HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) )
{
try
{ homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); }
{
MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() );
_PTR(SObject) obj = chercheMonObjet();
- if ( (obj) and ( HOMARD_UTILS::isFileType(obj,QString("log")) or HOMARD_UTILS::isFileType(obj,QString("Summary")) or HOMARD_UTILS::isFileType(obj,QString("xml")) ) )
+ if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) )
{
MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, 0 ) ;
if ( aDlg->_codret == 0 ) { aDlg->show(); }
EditObject = true ;
DeleteObject = true ;
}
- else if ( HOMARD_UTILS::isFileType(obj,QString("log")) or HOMARD_UTILS::isFileType(obj,QString("Summary")) or HOMARD_UTILS::isFileType(obj,QString("xml")) )
+ else if ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) )
{
pix = resMgr->loadPixmap( "HOMARD", "texte.png" );
menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this, SLOT(EditAsciiFile()));
#ifndef _HOMARDGUI_H_
#define _HOMARDGUI_H_
+#include "HOMARDGUI_Exports.hxx"
+
#include <SalomeApp_Module.h>
#include "SalomeApp_Study.h"
class SalomeApp_Application;
-class HOMARDGUI: public SalomeApp_Module
+class HOMARD_EXPORT HOMARDGUI: public SalomeApp_Module
{
Q_OBJECT
--- /dev/null
+// Copyright (C) 2011-2013 CEA/DEN, EDF R&D
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// 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
+//
+
+#ifndef _HOMARDGUI_EXPORTS_H_
+#define _HOMARDGUI_EXPORTS_H_
+
+#ifdef WIN32
+ #if defined HOMARD_EXPORTS || defined Homadr_EXPORTS
+ #define HOMARD_EXPORT __declspec( dllexport )
+ #else
+ #define HOMARD_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define HOMARD_EXPORT
+#endif
+
+
+#endif //_HOMARDGUI_EXPORTS_H_
+
#include <qstring.h>
#include <qstringlist.h>
#include <sys/stat.h>
+#ifndef WIN32
#include <dirent.h>
+#endif
SALOME_ListIO HOMARD_UTILS::mySelected;
#ifndef HOMARD_H_UTILS
#define HOMARD_H_UTILS
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
namespace HOMARD_UTILS {
+ HOMARD_EXPORT
_PTR(Study)
GetCStudy(const SalomeApp_Study* theStudy);
- SUIT_Study* GetActiveStudy();
- _PTR(Study) GetActiveStudyDocument();
- void updateObjBrowser();
+ HOMARD_EXPORT SUIT_Study* GetActiveStudy();
+ HOMARD_EXPORT _PTR(Study) GetActiveStudyDocument();
- const SALOME_ListIO& selectedIO(); // Function returns a list of SALOME_InteractiveObject's from
+ HOMARD_EXPORT void updateObjBrowser();
+
+ HOMARD_EXPORT const SALOME_ListIO& selectedIO(); // Function returns a list of SALOME_InteractiveObject's from
// selection manager in GUI
- int IObjectCount() ; // Function returns the number of selected objects
+ HOMARD_EXPORT int IObjectCount() ; // Function returns the number of selected objects
- Handle(SALOME_InteractiveObject) firstIObject() ;
+ HOMARD_EXPORT Handle(SALOME_InteractiveObject) firstIObject() ;
// Function returns the first selected object in the list
// of selected objects
- Handle(SALOME_InteractiveObject) lastIObject() ;
+ HOMARD_EXPORT Handle(SALOME_InteractiveObject) lastIObject() ;
// Function returns the last selected object in the list
// of selected objects
- bool isBoundaryAn(_PTR(SObject) MonObj);
- bool isBoundaryDi(_PTR(SObject) MonObj);
- bool isCase(_PTR(SObject) MonObj);
- bool isHypo(_PTR(SObject) MonObj);
- bool isIter(_PTR(SObject) MonObj);
- bool isYACS(_PTR(SObject) MonObj);
- bool isZone(_PTR(SObject) MonObj);
- bool isFileType(_PTR(SObject) MonObj, QString TypeFile);
- bool isObject(_PTR(SObject) MonObj, QString TypeObject, int option );
-
- void PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort);
+ HOMARD_EXPORT bool isBoundaryAn(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isBoundaryDi(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isCase(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isHypo(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isIter(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isYACS(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isZone(_PTR(SObject) MonObj);
+ HOMARD_EXPORT bool isFileType(_PTR(SObject) MonObj, QString TypeFile);
+ HOMARD_EXPORT bool isObject(_PTR(SObject) MonObj, QString TypeObject, int option );
+
+ HOMARD_EXPORT void PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort);
extern SALOME_ListIO mySelected;
}
#include <qfiledialog.h>
#include <qstring.h>
#include <stdlib.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <sys/stat.h>
#ifndef HOMARDQTCOMMUN_H
#define HOMARDQTCOMMUN_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include "SALOME_Selection.h"
namespace HOMARD_QT_COMMUN
{
- QString PushNomFichier(bool avertir=true);
- QString LireNomMaillage(int Medidt,int MeshId);
- QString LireNomMaillage(QString aFile);
+ HOMARD_EXPORT QString PushNomFichier(bool avertir=true);
+ HOMARD_EXPORT QString LireNomMaillage(int Medidt,int MeshId);
+ HOMARD_EXPORT QString LireNomMaillage(QString aFile);
- int OuvrirFichier(QString aFile);
+ HOMARD_EXPORT int OuvrirFichier(QString aFile);
- std::list<QString> GetListeChamps(QString aFile);
- std::list<QString> GetListeComposants(QString aFile, QString aChamp);
+ HOMARD_EXPORT std::list<QString> GetListeChamps(QString aFile);
+ HOMARD_EXPORT std::list<QString> GetListeComposants(QString aFile, QString aChamp);
- QString SelectionArbreEtude(QString commentaire, int grave );
- QString SelectionCasEtude();
+ HOMARD_EXPORT QString SelectionArbreEtude(QString commentaire, int grave );
+ HOMARD_EXPORT QString SelectionCasEtude();
};
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateBoundaryAn.h"
#include "MonCreateCase.h"
#include "math.h"
#define PI 3.141592653589793
+
+using namespace std;
// ------------------------------------------------------------------------------------------------------------------------
MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0,
{
case 1 : // il s agit d un cylindre
{
- if ((_BoundaryAnXcentre != SpinBox_Xcent->value()) or
- (_BoundaryAnYcentre != SpinBox_Ycent->value()) or
- (_BoundaryAnZcentre != SpinBox_Zcent->value()) or
- (_BoundaryAnRayon != SpinBox_Radius->value()) or
- (_BoundaryAnXaxis != SpinBox_Xaxis->value()) or
- (_BoundaryAnYaxis != SpinBox_Yaxis->value()) or
+ if ((_BoundaryAnXcentre != SpinBox_Xcent->value()) ||
+ (_BoundaryAnYcentre != SpinBox_Ycent->value()) ||
+ (_BoundaryAnZcentre != SpinBox_Zcent->value()) ||
+ (_BoundaryAnRayon != SpinBox_Radius->value()) ||
+ (_BoundaryAnXaxis != SpinBox_Xaxis->value()) ||
+ (_BoundaryAnYaxis != SpinBox_Yaxis->value()) ||
(_BoundaryAnZaxis != SpinBox_Zaxis->value()) )
{
Chgt = true;
case 2 : // il s agit d une sphere
{
- if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) or
- (_BoundaryAnYcentre != SpinBox_Ycentre->value()) or
- (_BoundaryAnZcentre != SpinBox_Zcentre->value()) or
+ if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) ||
+ (_BoundaryAnYcentre != SpinBox_Ycentre->value()) ||
+ (_BoundaryAnZcentre != SpinBox_Zcentre->value()) ||
(_BoundaryAnRayon != SpinBox_Rayon->value()) )
{
Chgt = true;
case 3 : // il s agit d un cone defini par un axe et un angle
{
- if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) or
- (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) or
- (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) or
- (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) or
- (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) or
- (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) or
+ if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) ||
(_BoundaryAngle != SpinBox_Cone_V1->value()) )
{
Chgt = true;
case 4 : // il s agit d un cone defini par les 2 rayons
{
- if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) or
- (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) or
- (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) or
- (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) or
- (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) or
- (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) or
- (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) or
+ if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) ||
+ (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) ||
(_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
{
Chgt = true;
MESSAGE("Debut de SetConeR")
//
// Stockage et conversion des valeurs si elles ont change
- if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) or
- (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) or
- (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) or
- (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) or
- (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) or
- (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) or
+ if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) ||
(_BoundaryAngle != SpinBox_Cone_V1->value()) )
{
MESSAGE("Stockage et conversion")
{
MESSAGE("Debut de SetConeA")
// Stockage et conversion des valeurs si elles ont change
- if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) or
- (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) or
- (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) or
- (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) or
- (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) or
- (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) or
- (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) or
+ if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) ||
+ (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) ||
(_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
{
MESSAGE("Stockage et conversion")
#ifndef MON_CREATEBOUNDARYAN_H
#define MON_CREATEBOUNDARYAN_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <QDialog>
class MonCreateCase;
-class MonCreateBoundaryAn : public QDialog, public Ui_CreateBoundaryAn
+class HOMARD_EXPORT MonCreateBoundaryAn : public QDialog, public Ui_CreateBoundaryAn
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateBoundaryDi.h"
#include "MonCreateListGroup.h"
#include "MonCreateCase.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
+
// -------------------------------------------------------------------------------
MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0,
#ifndef MON_CREATEBOUNDARYDI_H
#define MON_CREATEBOUNDARYDI_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <QDialog>
class MonCreateCase;
-class MonCreateBoundaryDi : public QDialog, public Ui_CreateBoundaryDi
+class HOMARD_EXPORT MonCreateBoundaryDi : public QDialog, public Ui_CreateBoundaryDi
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateCase.h"
#include "MonCreateBoundaryAn.h"
#include "MonEditBoundaryAn.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
+
+using namespace std;
// -----------------------------------------------------------------------------------------
/* Constructs a MonCreateCase
return false;
}
}
+#ifndef WIN32
if (chdir(aDirName.toStdString().c_str()) != 0)
+#else
+ if (_chdir(aDirName.toStdString().c_str()) != 0)
+#endif
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_CASE_DIRECTORY_3") );
#ifndef MON_CREATECASE_H
#define MON_CREATECASE_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <CreateCase.h>
#include <QWidget>
-class MonCreateCase : public QDialog, public Ui_CreateCase
+class HOMARD_EXPORT MonCreateCase : public QDialog, public Ui_CreateCase
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateHypothesis.h"
#include "MonCreateListGroup.h"
#include "MonCreateIteration.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
+
// -------------------------------------------------------------------------------
MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0,
MESSAGE("Debut de MonCreateHypothesis::PushZoneEdit")
int colonne = TWZone->currentColumn();
QTableWidgetItem * monItem = TWZone->currentItem();
- if (colonne !=2 or monItem == NULL)
+ if (colonne !=2 || monItem == NULL)
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_HYPO_ZONE_1") );
int Pbm = 0 ;
for ( int row=0; row< TWZone->rowCount(); row++)
{
- if ( ( TWZone->item( row, 0 )->checkState() == Qt::Checked ) and ( TWZone->item( row, 1 )->checkState() == Qt::Checked ) )
+ if ( ( TWZone->item( row, 0 )->checkState() == Qt::Checked ) && ( TWZone->item( row, 1 )->checkState() == Qt::Checked ) )
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_HYPO_ZONE_3") );
{
MESSAGE("Debut de SetFieldName");
_aFieldName=CBFieldName->currentText();
- if (QString(_aFieldFile) == QString("") or QString(_aFieldName) == QString("") ) { return; }
+ if (QString(_aFieldFile) == QString("") || QString(_aFieldName) == QString("") ) { return; }
int nbrow= TWCMP->rowCount() ;
for ( int row=0; row < nbrow ; row++)
#ifndef MON_CREATEHYPOTHESIS_H
#define MON_CREATEHYPOTHESIS_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <QDialog>
class MonCreateIteration;
-class MonCreateHypothesis : public QDialog, public Ui_CreateHypothesis
+class HOMARD_EXPORT MonCreateHypothesis : public QDialog, public Ui_CreateHypothesis
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateIteration.h"
#include "MonCreateHypothesis.h"
#include "MonEditHypothesis.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
+
// -----------------------------------------------------------------------------------------------------
MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0, QString IterParentName ):
HOMARD::HOMARD_Hypothesis_var _myHypothesis = myHomardGen->GetHypothesis(monHypoName.toStdString().c_str());
HOMARD::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef());
int TypeAdap = ListTypes[0];
- if ( TypeAdap == 1 and LEFieldFile->text().trimmed() == QString("") )
+ if ( TypeAdap == 1 && LEFieldFile->text().trimmed() == QString("") )
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ITER_FIELD_FILE") );
#ifndef MON_CREATEITERATION_H
#define MON_CREATEITERATION_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <QDialog>
#include <QWidget>
-class MonCreateIteration : public QDialog, public Ui_CreateIteration
+class HOMARD_EXPORT MonCreateIteration : public QDialog, public Ui_CreateIteration
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateListGroup.h"
#include "MonCreateHypothesis.h"
#include "MonCreateBoundaryDi.h"
#include <SUIT_Session.h>
#include <SUIT_ViewManager.h>
+using namespace std;
+
// --------------------------------------------------------------------------------------------------------------
MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) :
#ifndef MON_CREATELISTGROUP_H
#define MON_CREATELISTGROUP_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
class MonCreateHypothesis;
class MonCreateBoundaryDi;
-class MonCreateListGroup : public QDialog, public Ui_CreateListGroup
+class HOMARD_EXPORT MonCreateListGroup : public QDialog, public Ui_CreateListGroup
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateYACS.h"
#include <QFileDialog>
#include "HomardQtCommun.h"
#include <utilities.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
+using namespace std;
// ----------------------------------------------------------------------
MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString CaseName ):
return false;
}
}
+#ifndef WIN32
if (chdir(aDirName.toStdString().c_str()) != 0)
+#else
+ if (_chdir(aDirName.toStdString().c_str()) != 0)
+#endif
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_CASE_DIRECTORY_3") );
#ifndef MON_CREATEYACS_H
#define MON_CREATEYACS_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <CreateYACS.h>
#include <QWidget>
-class MonCreateYACS : public QDialog, public Ui_CreateYACS
+class HOMARD_EXPORT MonCreateYACS : public QDialog, public Ui_CreateYACS
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonCreateZone.h"
#include "MonCreateHypothesis.h"
#include <SUIT_Session.h>
#include <SUIT_ViewManager.h>
+using namespace std;
+
// ----------------------------------------------------------------------
MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen0,
{ }
case 2 : // il s agit d un parallelipipede rectangle
{
- if ( (_ZoneXmin != SpinBox_Xmini->value()) or
- (_ZoneXmax != SpinBox_Xmaxi->value()) or
- (_ZoneYmin != SpinBox_Ymini->value()) or
- (_ZoneYmax != SpinBox_Ymaxi->value()) or
- (_ZoneZmin != SpinBox_Zmini->value()) or
+ if ( (_ZoneXmin != SpinBox_Xmini->value()) ||
+ (_ZoneXmax != SpinBox_Xmaxi->value()) ||
+ (_ZoneYmin != SpinBox_Ymini->value()) ||
+ (_ZoneYmax != SpinBox_Ymaxi->value()) ||
+ (_ZoneZmin != SpinBox_Zmini->value()) ||
(_ZoneZmax != SpinBox_Zmaxi->value()) )
{
Chgt = true;
}
case 4 : // il s agit d une sphere
{
- if ( (_ZoneXcentre != SpinBox_Xcentre->value()) or
- (_ZoneYcentre != SpinBox_Ycentre->value()) or
- (_ZoneZcentre != SpinBox_Zbase->value()) or
+ if ( (_ZoneXcentre != SpinBox_Xcentre->value()) ||
+ (_ZoneYcentre != SpinBox_Ycentre->value()) ||
+ (_ZoneZcentre != SpinBox_Zbase->value()) ||
(_ZoneRayon != SpinBox_Rayon->value()) )
{
Chgt = true;
{ }
case 5 : // il s agit d un cylindre
{
- if ( (_ZoneXcentre != SpinBox_Xbase->value()) or
- (_ZoneYcentre != SpinBox_Ybase->value()) or
- (_ZoneZcentre != SpinBox_Zbase->value()) or
- (_ZoneRayon != SpinBox_Radius->value()) or
- (_ZoneHaut != SpinBox_Haut->value()) or
- (_ZoneXaxis != SpinBox_Xaxis->value()) or
- (_ZoneYaxis != SpinBox_Yaxis->value()) or
+ if ( (_ZoneXcentre != SpinBox_Xbase->value()) ||
+ (_ZoneYcentre != SpinBox_Ybase->value()) ||
+ (_ZoneZcentre != SpinBox_Zbase->value()) ||
+ (_ZoneRayon != SpinBox_Radius->value()) ||
+ (_ZoneHaut != SpinBox_Haut->value()) ||
+ (_ZoneXaxis != SpinBox_Xaxis->value()) ||
+ (_ZoneYaxis != SpinBox_Yaxis->value()) ||
(_ZoneZaxis != SpinBox_Zaxis->value()) )
{
Chgt = true;
{ }
case 7 : // il s agit d un tuyau
{
- if ( (_ZoneXcentre != SpinBox_Xbase_p->value()) or
- (_ZoneYcentre != SpinBox_Ybase_p->value()) or
- (_ZoneZcentre != SpinBox_Zbase_p->value()) or
- (_ZoneRayonInt != SpinBox_Radius_int->value()) or
- (_ZoneRayon != SpinBox_Radius_ext->value()) or
- (_ZoneHaut != SpinBox_Haut_p->value()) or
- (_ZoneXaxis != SpinBox_Xaxis_p->value()) or
- (_ZoneYaxis != SpinBox_Yaxis_p->value()) or
+ if ( (_ZoneXcentre != SpinBox_Xbase_p->value()) ||
+ (_ZoneYcentre != SpinBox_Ybase_p->value()) ||
+ (_ZoneZcentre != SpinBox_Zbase_p->value()) ||
+ (_ZoneRayonInt != SpinBox_Radius_int->value()) ||
+ (_ZoneRayon != SpinBox_Radius_ext->value()) ||
+ (_ZoneHaut != SpinBox_Haut_p->value()) ||
+ (_ZoneXaxis != SpinBox_Xaxis_p->value()) ||
+ (_ZoneYaxis != SpinBox_Yaxis_p->value()) ||
(_ZoneZaxis != SpinBox_Zaxis_p->value()) )
{
Chgt = true;
// Controles
// Pour un rectangle ou un parallelepipede :
- if ( ( _Type >= 11 and _Type <= 13 ) or _Type == 2 )
+ if ( ( _Type >= 11 && _Type <= 13 ) || _Type == 2 )
{
- if ((_ZoneXmin >= _ZoneXmax) and (_Xincr > 0)) {
+ if ((_ZoneXmin >= _ZoneXmax) && (_Xincr > 0)) {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ZONE_LIMIT").arg("X") ) ;
return false; }
- if ((_ZoneYmin >= _ZoneYmax) and (_Yincr > 0)) {
+ if ((_ZoneYmin >= _ZoneYmax) && (_Yincr > 0)) {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ZONE_LIMIT").arg("Y") ) ;
return false; }
- if ((_ZoneZmin >= _ZoneZmax) and (_Zincr > 0)) {
+ if ((_ZoneZmin >= _ZoneZmax) && (_Zincr > 0)) {
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_ZONE_LIMIT").arg("Z") ) ;
return false; }
}
// L'axe pour un cylindre ou un tuyau :
- if ( _Type == 5 or _Type == 7 )
+ if ( _Type == 5 || _Type == 7 )
{
double daux = _ZoneXaxis*_ZoneXaxis + _ZoneYaxis*_ZoneYaxis + _ZoneZaxis*_ZoneZaxis ;
if ( daux < 0.0000001 )
}
}
// Rayons pour disque avec trou ou un tuyau :
- if ( ( _Type >= 61 and _Type <= 63 ) or _Type == 7 )
+ if ( ( _Type >= 61 && _Type <= 63 ) || _Type == 7 )
{
if ( _ZoneRayonInt >= _ZoneRayon )
{
#ifndef MON_CREATEZONE_H
#define MON_CREATEZONE_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <QDialog>
class MonCreateHypothesis;
-class MonCreateZone : public QDialog, public Ui_CreateZone
+class HOMARD_EXPORT MonCreateZone : public QDialog, public Ui_CreateZone
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditBoundaryAn.h"
#include "SalomeApp_Tools.h"
#include "HOMARDGUI_Utils.h"
#include <utilities.h>
+using namespace std;
// ------------------------------------------------------------------------
MonEditBoundaryAn::MonEditBoundaryAn( MonCreateCase* parent, bool modal,
#ifndef MON_EDITBOUNDARYAN_H
#define MON_EDITBOUNDARYAN_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateBoundaryAn.h>
-class MonEditBoundaryAn : public MonCreateBoundaryAn
+class HOMARD_EXPORT MonEditBoundaryAn : public MonCreateBoundaryAn
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditBoundaryDi.h"
#include "MonEditListGroup.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
// -------------------------------------------------------------------------------------------------------------------------------------
MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal,
#ifndef MON_EDITBOUNDARYDI_H
#define MON_EDITBOUNDARYDI_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateBoundaryDi.h>
-class MonEditBoundaryDi : public MonCreateBoundaryDi
+class HOMARD_EXPORT MonEditBoundaryDi : public MonCreateBoundaryDi
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditCase.h"
#include "SalomeApp_Tools.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
// -------------------------------------------------------------
/* Constructs a MonEditCase
#ifndef MON_EDITCASE_H
#define MON_EDITCASE_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateCase.h>
-class MonEditCase : public MonCreateCase
+class HOMARD_EXPORT MonEditCase : public MonCreateCase
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditFile.h"
#include <QFile>
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
+
/* ---------------------------------------------------------
* MonEditFile classe derivee de EditFile
* elle meme generee par uic
#ifndef MON_EDITFILE_H
#define MON_EDITFILE_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include "SALOME_Selection.h"
class QListBox;
class QDialog;
-class MonEditFile : public QWidget, public Ui_EditFile
+class HOMARD_EXPORT MonEditFile : public QWidget, public Ui_EditFile
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditHypothesis.h"
#include "MonEditListGroup.h"
#include "HomardQtCommun.h"
#include "HOMARD.hxx"
#include <utilities.h>
+
+using namespace std;
+
// ----------------------------------------------------------------------------
MonEditHypothesis::MonEditHypothesis( MonCreateIteration* parent, bool modal,
HOMARD::HOMARD_Gen_var myHomardGen,
InitFieldInterp();
- if (_aTypeAdap == 1 or _TypeFieldInterp >= 1 )
+ if (_aTypeAdap == 1 || _TypeFieldInterp >= 1 )
{
if (_aFieldFile == QString("")) { GBFieldFile->setVisible(0); }
else
double DiamMin = aHypothesis->GetDiamMin();
int AdapInit = aHypothesis->GetAdapInit();
int LevelOutput = aHypothesis->GetLevelOutput();
- if ( NivMax > 0 or DiamMin > 0 or AdapInit != 0 or LevelOutput != 0 )
+ if ( NivMax > 0 || DiamMin > 0 || AdapInit != 0 || LevelOutput != 0 )
{ GBAdvancedOptions->setVisible(1);
if ( NivMax > 0 )
{ spinBoxNivMax->setValue(NivMax);
#ifndef MON_EDITHYPOTHESIS_H
#define MON_EDITHYPOTHESIS_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateHypothesis.h>
-class MonEditHypothesis : public MonCreateHypothesis
+class HOMARD_EXPORT MonEditHypothesis : public MonCreateHypothesis
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditIteration.h"
#include "SalomeApp_Tools.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
// -------------------------------------------------------------------------------------------------------------------------------------
MonEditIteration::MonEditIteration ( QWidget* parent, bool modal,
if ( _aTypeAdap == 1)
{
// Pour du raffinement selon un champ, les instants ont-ils change ?
- if ( (_FieldFile != LEFieldFile->text().trimmed()) or
- ( _rank != SpinBox_Rank->value()) or
+ if ( (_FieldFile != LEFieldFile->text().trimmed()) ||
+ ( _rank != SpinBox_Rank->value()) ||
( _step != SpinBox_TimeStep->value()))
{
_FieldFile = LEFieldFile->text().trimmed();
#ifndef MON_EDITITERATION_H
#define MON_EDITITERATION_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateIteration.h>
-class MonEditIteration : public MonCreateIteration
+class HOMARD_EXPORT MonEditIteration : public MonCreateIteration
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditListGroup.h"
#include <utilities.h>
+using namespace std;
//---------------------------------------------------------------------
MonEditListGroup::MonEditListGroup( MonCreateHypothesis* parentHyp,
MonCreateBoundaryDi* parentBound,
#ifndef MON_EDITLISTGROUP_H
#define MON_EDITLISTGROUP_H
+#include "HOMARDGUI_Exports.hxx"
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
class MonCreateHypothesis;
class MonCreateBoundaryDi;
-class MonEditListGroup : public MonCreateListGroup
+class HOMARD_EXPORT MonEditListGroup : public MonCreateListGroup
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditYACS.h"
#include "SalomeApp_Tools.h"
#include "HomardQtCommun.h"
#include <utilities.h>
+using namespace std;
// -------------------------------------------------------------
/* Constructs a MonEditYACS
#ifndef MON_EDITYACS_H
#define MON_EDITYACS_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateYACS.h>
-class MonEditYACS : public MonCreateYACS
+class HOMARD_EXPORT MonEditYACS : public MonCreateYACS
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonEditZone.h"
#include "SalomeApp_Tools.h"
#include <SUIT_Session.h>
#include <SUIT_ViewManager.h>
+using namespace std;
// ------------------------------------------------------------------------
MonEditZone::MonEditZone( MonCreateHypothesis* parent, bool modal,
#ifndef MON_EDITZONE_H
#define MON_EDITZONE_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MonCreateZone.h>
-class MonEditZone : public MonCreateZone
+class HOMARD_EXPORT MonEditZone : public MonCreateZone
{
Q_OBJECT
public:
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonIterInfo.h"
#include <QFile>
#include "MonEditFile.h"
#include <utilities.h>
+using namespace std;
// -----------------------------------------------------------------------------------------
MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString IterName)
MESSAGE("PushOnApply");
// Au moins une option a ete choisie
- if ( ( _Quality == 0 ) and ( _Diametre == 0 ) and ( _Connection == 0 ) and ( _BlockSize == 0 ) and ( _Entanglement == 0 ) )
+ if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) )
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_MESH_INFO_1") );
#ifndef MON_ITERINFO_H
#define MON_ITERINFO_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
class QListBox;
-class MonIterInfo : public QDialog, public Ui_IterInfo
+class HOMARD_EXPORT MonIterInfo : public QDialog, public Ui_IterInfo
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonMeshInfo.h"
#include <QFileDialog>
#include "MonEditFile.h"
#include <utilities.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
+
+using namespace std;
// -----------------------------------------------------------------------------------------
MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0)
return false;
}
}
+#ifndef WIN32
if (chdir(aDirName.toStdString().c_str()) != 0)
+#else
+ if (_chdir(aDirName.toStdString().c_str()) != 0)
+#endif
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_CASE_DIRECTORY_3") );
QObject::tr("HOM_MED_FILE_2") );
return false;
}
- if ( ( _Quality == 0 ) and ( _Diametre == 0 ) and ( _Connection == 0 ) and ( _BlockSize == 0 ) and ( _Entanglement == 0 ) )
+ if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) )
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_MESH_INFO") );
#ifndef MON_MESHINFO_H
#define MON_MESHINFO_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <MeshInfo.h>
#include <QWidget>
-class MonMeshInfo : public QDialog, public Ui_MeshInfo
+class HOMARD_EXPORT MonMeshInfo : public QDialog, public Ui_MeshInfo
{
Q_OBJECT
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
-
#include "MonPursueIteration.h"
#include <QFileDialog>
#include "HomardQtCommun.h"
#include <utilities.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
+
+using namespace std;
// -----------------------------------------------------------------------------------------
/* Constructs a MonPursueIteration
return false;
}
}
+#ifndef WIN32
if (chdir(aDirName.toStdString().c_str()) != 0)
+#else
+ if (_chdir(aDirName.toStdString().c_str()) != 0)
+#endif
{
QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
QObject::tr("HOM_CASE_DIRECTORY_3") );
#ifndef MON_PURSUEITERATION_H
#define MON_PURSUEITERATION_H
+#include "HOMARDGUI_Exports.hxx"
+
#include <SALOMEconfig.h>
#include <SalomeApp_Module.h>
#include <PursueIteration.h>
#include <QWidget>
-class MonPursueIteration : public QDialog, public Ui_PursueIteration
+class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIteration
{
Q_OBJECT
${PROJECT_SOURCE_DIR}/src/HOMARD
${PROJECT_SOURCE_DIR}/src/HOMARDGUI
)
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${OMNIORB_DEFINITIONS}
+)
# libraries to link to
SET(_link_LIBRARIES
HOMARD_Boundary_i.hxx
HOMARD_YACS_i.hxx
HomardMedCommun.h
+ HOMARD_i.hxx
)
# --- sources ---
#include CORBA_SERVER_HEADER(HOMARD_Gen)
#include CORBA_SERVER_HEADER(HOMARD_Boundary)
+#include "HOMARD_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "Utils_CorbaException.hxx"
class HOMARD_Boundary;
-class HOMARD_Boundary_i:
+class HOMARDENGINE_EXPORT HOMARD_Boundary_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_Boundary,
public virtual PortableServer::ServantBase
#include <vector>
#include <sys/stat.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
+
//=============================================================================
/*!
* standard constructor
// D.3. Creation du futur repertoire local pour l'iteration de depart
std::string nomDirIterTotal ;
nomDirIterTotal = std::string(NomDir) + "/" + std::string(nomDirIter) ;
+#ifndef WIN32
if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
+#else
+ if (_mkdir(nomDirIterTotal.c_str()) != 0)
+#endif
{
MESSAGE ( "nomDirIterTotal : " << nomDirIterTotal ) ;
SALOME::ExceptionStruct es;
#include CORBA_SERVER_HEADER(HOMARD_Gen)
#include CORBA_SERVER_HEADER(HOMARD_Cas)
+#include "HOMARD_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "Utils_CorbaException.hxx"
class HOMARD_Cas;
-class HOMARD_Cas_i:
+class HOMARDENGINE_EXPORT HOMARD_Cas_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_Cas,
public virtual PortableServer::ServantBase
#include <cmath>
#include <stdlib.h>
#include <sys/stat.h>
+#ifndef WIN32
#include <dirent.h>
+#endif
#include <string>
#include <cstring>
#include <iostream>
#include <vector>
#include <stdio.h>
+#ifdef WIN32
+#include <direct.h>
+#endif
+
using namespace std;
//=============================================================================
int numero = myIteration->GetNumber();
MESSAGE ( "DeleteIterationOption : numero = " << numero );
- if ( numero == 0 and Option1 == 1 )
+ if ( numero == 0 && Option1 == 1 )
{
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr);
std::string value (aCommentAttr->Value());
/* MESSAGE("... value = " << value);*/
- if( (value == std::string("logInfo")) or ( value == std::string("SummaryInfo")) )
+ if( (value == std::string("logInfo")) || ( value == std::string("SummaryInfo")) )
{
SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
aStudyBuilder->RemoveObject(so);
// A. Decodage du point de reprise
// A.1. Controle du repertoire de depart de l'iteration
+#ifndef WIN32
codret = chdir(DirNameStart) ;
+#else
+ codret = _chdir(DirNameStart) ;
+#endif
if ( codret != 0 )
{
SALOME::ExceptionStruct es;
std::string file_configuration = "" ;
std::string file_maillage_homard = "" ;
int bilan ;
+#ifndef WIN32
DIR *dp;
struct dirent *dirp;
dp = opendir(DirNameStart);
}
}
closedir(dp);
+#else
+ HANDLE hFind = INVALID_HANDLE_VALUE;
+ WIN32_FIND_DATA ffd;
+ hFind = FindFirstFile(DirNameStart, &ffd);
+ if (INVALID_HANDLE_VALUE != hFind) {
+ while (FindNextFile(hFind, &ffd) != 0) {
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
+ std::string file_name(ffd.cFileName);
+ bilan = file_name.find("HOMARD.Configuration.") ;
+ if ( bilan != string::npos ) { file_configuration = file_name ; }
+ bilan = file_name.find("maill.") ;
+ if ( bilan != string::npos )
+ {
+ bilan = file_name.find(".hom.med") ;
+ if ( bilan != string::npos ) { file_maillage_homard = file_name ; }
+ }
+ }
+ FindClose(hFind);
+ }
+#endif
MESSAGE ( "==> file_configuration : " << file_configuration ) ;
MESSAGE ( "==> file_maillage_homard : " << file_maillage_homard ) ;
// A.3. Controle
- if ( ( file_configuration == "" ) or ( file_maillage_homard == "" ) )
+ if ( ( file_configuration == "" ) || ( file_maillage_homard == "" ) )
{
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
NumeIter += 1 ;
}
// B.3. Des valeurs caracteres brutes : le second bloc de la ligne est la valeur
- else if ( ( mot_cle == "TypeConf" ) or ( mot_cle == "TypeElem" ) )
+ else if ( ( mot_cle == "TypeConf" ) || ( mot_cle == "TypeElem" ) )
{
ligne_bis >> argument ;
}
// B.4. Des valeurs caracteres : le deuxieme bloc de la ligne peut etre encadre par des quotes :
// il faut les supprimer
- else if ( ( mot_cle == "CCNoMNP1" ) or ( mot_cle == "CCMaiNP1" ) )
+ else if ( ( mot_cle == "CCNoMNP1" ) || ( mot_cle == "CCMaiNP1" ) )
{
ligne_bis >> argument ;
if ( argument[0] == '"' ) { decalage = 1 ; }
Iter->SetDirNameLoc(nomDirIter);
std::string nomDirIterTotal ;
nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ;
+#ifndef WIN32
if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
+#else
+ if (_mkdir(nomDirIterTotal.c_str()) != 0)
+#endif
{
MESSAGE ( "nomDirIterTotal : " << nomDirIterTotal ) ;
SALOME::ExceptionStruct es;
throw SALOME::SALOME_Exception(es);
}
// E.3. Copie du maillage HOMARD au format MED
+#ifndef WIN32
codret = chdir(DirNameStart) ;
+#else
+ codret = _chdir(DirNameStart) ;
+#endif
std::string commande = "cp " + file_maillage_homard + " " + nomDirIterTotal ;
MESSAGE ( "commande : " << commande ) ;
codret = system(commande.c_str()) ;
delete[] MeshName ;
delete[] MeshFile ;
+#ifndef WIN32
chdir(nomDirWork.c_str());
-
+#else
+ _chdir(nomDirWork.c_str());
+#endif
return HOMARD::HOMARD_Cas::_duplicate(myCase);
}
//=============================================================================
int NumeIterMax = -1 ;
// A.1. Controle du repertoire de depart du cas
+#ifndef WIN32
codret = chdir(DirNameStart) ;
+#else
+ codret = _chdir(DirNameStart) ;
+#endif
if ( codret != 0 )
{
SALOME::ExceptionStruct es;
};
// A.2. Reperage des sous-repertoire du repertoire de reprise
bool existe = false ;
+#ifndef WIN32
DIR *dp;
struct dirent *dirp;
dp = opendir(DirNameStart);
- while ( (dirp = readdir(dp)) != NULL )
- {
+ while ( (dirp = readdir(dp)) != NULL ) {
std::string DirName_1(dirp->d_name);
- if ( ( DirName_1 != "." ) and ( DirName_1 != ".." ) )
+#else
+ HANDLE hFind = INVALID_HANDLE_VALUE;
+ WIN32_FIND_DATA ffd;
+ hFind = FindFirstFile(DirNameStart, &ffd);
+ if (INVALID_HANDLE_VALUE != hFind) {
+ while (FindNextFile(hFind, &ffd) != 0) {
+ std::string DirName_1 = "";
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ DirName_1 = std::string(ffd.cFileName);
+ }
+#endif
+ if ( ( DirName_1 != "." ) && ( DirName_1 != ".." ) )
{
+#ifndef WIN32
if ( chdir(DirName_1.c_str()) == 0 )
{
- // On cherche le fichier de configuration dans ce sous-repertoire
- codret = chdir(DirNameStart) ;
+// On cherche le fichier de configuration dans ce sous-repertoire
+ codret = chdir(DirNameStart);
DIR *dp_1;
struct dirent *dirp_1;
dp_1 = opendir(DirName_1.c_str()) ;
while ( (dirp_1 = readdir(dp_1)) != NULL )
{
std::string file_name_1(dirp_1->d_name);
+#else
+ if ( _chdir(DirName_1.c_str()) == 0 )
+ {
+ codret = _chdir(DirNameStart);
+ HANDLE hFind1 = INVALID_HANDLE_VALUE;
+ WIN32_FIND_DATA ffd1;
+ hFind1 = FindFirstFile(DirName_1.c_str(), &ffd1);
+ while (FindNextFile(hFind1, &ffd1) != 0)
+ {
+ if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
+ std::string file_name_1(ffd1.cFileName);
+#endif
int bilan = file_name_1.find("HOMARD.Configuration.") ;
if ( bilan != string::npos )
{
// Decodage du fichier pour trouver le numero d'iteration
+#ifndef WIN32
chdir(DirName_1.c_str()) ;
+#else
+ _chdir(DirName_1.c_str()) ;
+#endif
+
std::ifstream fichier( file_name_1.c_str() );
if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
{
es.text = CORBA::string_dup(text.c_str());
throw SALOME::SALOME_Exception(es);
}
+#ifndef WIN32
chdir(DirNameStart) ;
+#else
+ _chdir(DirNameStart) ;
+#endif
}
if ( existe ) { break ; }
}
+#ifndef WIN32
closedir(dp_1);
+#else
+ FindClose(hFind1);
+#endif
if ( existe ) { break ; }
- }
+ }
}
}
+#ifndef WIN32
closedir(dp);
+ chdir(nomDirWork.c_str());
+#else
+ FindClose(hFind);
+ }
+ _chdir(nomDirWork.c_str());
+#endif
- chdir(nomDirWork.c_str());
-
- if ( ( Number >= 0 and ( not existe ) ) or ( Number < 0 and ( NumeIterMax == -1 ) ) )
+ if ( ( Number >= 0 && ( !existe ) ) || ( Number < 0 && ( NumeIterMax == -1 ) ) )
{
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
{
existeMeshFile = MEDFileExist ( MeshFile ) ;
MESSAGE ( "CreateCase0 : existeMeshFile = " << existeMeshFile );
- if ( ( existeMeshFile == 0 ) and ( MeshOption == 0 ) )
+ if ( ( existeMeshFile == 0 ) && ( MeshOption == 0 ) )
{
SALOME::ExceptionStruct es;
es.type = SALOME::BAD_PARAM;
//
SALOME::ExceptionStruct es;
int error = 0 ;
- if ( Angle <= 0.0 or Angle >= 90.0 )
+ if ( Angle <= 0.0 || Angle >= 90.0 )
{ es.text = "The angle must be included higher than 0 degree and lower than 90 degrees." ;
error = 1 ; }
double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ;
//
SALOME::ExceptionStruct es;
int error = 0 ;
- if ( Rayon1 < 0.0 or Rayon2 < 0.0 )
+ if ( Rayon1 < 0.0 || Rayon2 < 0.0 )
{ es.text = "The radius must be positive." ;
error = 1 ; }
double daux = fabs(Rayon2-Rayon1) ;
//
SALOME::ExceptionStruct es;
int error = 0 ;
- if ( Rayon <= 0.0 or Rayonint <= 0.0 )
+ if ( Rayon <= 0.0 || Rayonint <= 0.0 )
{ es.text = "The radius must be positive." ;
error = 1 ; }
double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ;
if ( Vmini > Vmaxi )
{ es.text = "The second coordinates are not coherent." ;
error = 2 ; }
- if ( Orient < 1 or Orient > 3 )
+ if ( Orient < 1 || Orient > 3 )
{ es.text = "The orientation must be 1, 2 or 3." ;
error = 3 ; }
if ( error != 0 )
Ymaxi = 0. ;
Zmini = Umini ;
Zmaxi = Umaxi ; }
- else { VERIFICATION( (Orient>=1) and (Orient<=3) ) ; }
+ else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; }
HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 10+Orient) ;
myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ;
if ( Rayon <= 0.0 )
{ es.text = "The radius must be positive." ;
error = 1 ; }
- if ( Orient < 1 or Orient > 3 )
+ if ( Orient < 1 || Orient > 3 )
{ es.text = "The orientation must be 1, 2 or 3." ;
error = 3 ; }
if ( error != 0 )
{ Xcentre = Vcentre ;
Ycentre = 0. ;
Zcentre = Ucentre ; }
- else { VERIFICATION( (Orient>=1) and (Orient<=3) ) ; }
+ else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; }
HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 30+Orient) ;
myZone->SetCylinder( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1. ) ;
//
SALOME::ExceptionStruct es;
int error = 0 ;
- if ( Rayon <= 0.0 or Rayonint <= 0.0 )
+ if ( Rayon <= 0.0 || Rayonint <= 0.0 )
{ es.text = "The radius must be positive." ;
error = 1 ; }
- if ( Orient < 1 or Orient > 3 )
+ if ( Orient < 1 || Orient > 3 )
{ es.text = "The orientation must be 1, 2 or 3." ;
error = 3 ; }
if ( Rayon <= Rayonint )
{ Xcentre = Vcentre ;
Ycentre = 0. ;
Zcentre = Ucentre ; }
- else { VERIFICATION( (Orient>=1) and (Orient<=3) ) ; }
+ else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; }
HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 60+Orient) ;
myZone->SetPipe( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1., Rayonint ) ;
// D. On passe dans le repertoire de l'iteration a calculer
MESSAGE ( ". On passe dans DirCompute = " << DirCompute );
- chdir(DirCompute) ;
+#ifndef WIN32
+ chdir(DirCompute);
+#else
+ _chdir(DirCompute);
+#endif
// E. Les donnees de l'execution HOMARD
// E.1. L'objet du texte du fichier de configuration
{
delete myDriver;
MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork );
+
+#ifndef WIN32
chdir(nomDirWork.c_str());
+#else
+ _chdir(nomDirWork.c_str());
+#endif
}
return codretexec ;
char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
{
MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<<num);
- // On verifie que le repertoire parent existe
+ // On verifie que le repertoire parent existe
+#ifndef WIN32
int codret = chdir(nomrep) ;
+#else
+ int codret = _chdir(nomrep) ;
+#endif
if ( codret != 0 )
{
SALOME::ExceptionStruct es;
while ( a_chercher )
{
// On passe dans le repertoire parent
- chdir(nomrep);
+
+#ifndef WIN32
+ chdir(nomrep);
+#else
+ _chdir(nomrep);
+#endif
// On recherche un nom sous la forme Iabc, avec abc representant le numero
int jaux ;
if ( num < 100 ) { jaux = 2 ; }
DirNameA << "I" << iaux.str();
// Si on ne pas peut entrer dans le repertoire, on doit verifier
// que c'est bien un probleme d'absence
+#ifndef WIN32
if ( chdir(DirNameA.str().c_str()) != 0 )
{
+#else
+ if ( _chdir(DirNameA.str().c_str()) != 0 )
+ {
+#endif
bool existe = false ;
+#ifndef WIN32
DIR *dp;
struct dirent *dirp;
dp = opendir(nomrep);
while ( (dirp = readdir(dp)) != NULL )
{
std::string file_name(dirp->d_name);
+#else
+ HANDLE hFind = INVALID_HANDLE_VALUE;
+ WIN32_FIND_DATA ffd;
+ hFind = FindFirstFile(nomrep, &ffd);
+ if (INVALID_HANDLE_VALUE != hFind) {
+ while (FindNextFile(hFind, &ffd) != 0) {
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
+ std::string file_name(ffd.cFileName);
+#endif
if ( file_name == DirNameA.str() ) { existe = true ; }
}
+#ifndef WIN32
closedir(dp);
- if ( not existe )
+#else
+ }
+ FindClose(hFind);
+#endif
+ if ( !existe )
{
DirName = DirNameA.str() ;
a_chercher = false ;
MESSAGE ( "==> DirName = " << DirName);
MESSAGE ( ". On retourne dans nomDirActuel = " << nomDirActuel );
+#ifndef WIN32
chdir(nomDirActuel.c_str());
-
+#else
+ _chdir(nomDirActuel.c_str());
+#endif
return CORBA::string_dup( DirName.c_str() );
}
//=============================================================================
MESSAGE (". DirCompute = " << DirCompute.str() );
// B.3.3. Si le sous-repertoire n'existe pas, on le cree
+#ifndef WIN32
if (chdir(DirCompute.str().c_str()) != 0)
{
// Creation du repertoire car il n'existe pas :
if (mkdir(DirCompute.str().c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
{
+#else
+ if (_chdir(DirCompute.str().c_str()) != 0)
+ {
+// Creation du repertoire car il n'existe pas :
+ if (_mkdir(DirCompute.str().c_str()) != 0)
+ {
+#endif
// GERALD -- QMESSAGE BOX
std::cerr << "Pb Creation du repertoire DirCompute = " << DirCompute.str() << std::endl;
VERIFICATION("Pb a la creation du repertoire" == 0);
{
if (etatMenage == 0)
{
+#ifndef WIN32
DIR *dp;
struct dirent *dirp;
dp = opendir(DirCompute.str().c_str());
result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false
}
closedir(dp);
+#else
+ HANDLE hFind = INVALID_HANDLE_VALUE;
+ WIN32_FIND_DATA ffd;
+ hFind = FindFirstFile(DirCompute.str().c_str(), &ffd);
+ bool result = true;
+ if (INVALID_HANDLE_VALUE != hFind) {
+ while (FindNextFile(hFind, &ffd) != 0) {
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
+ std::string file_name(ffd.cFileName);
+ result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false
+ }
+ }
+ FindClose(hFind);
+#endif
if ( result == false)
{
SALOME::ExceptionStruct es;
MESSAGE ( "... ZoneType = " << ZoneType << ", TypeUse = "<<TypeUse);
NumZone = iaux/2 + 1 ;
HOMARD::double_array* zone = myZone->GetCoords();
- if ( ZoneType == 2 or ( ZoneType>=11 and ZoneType <=13 ) ) // Cas d un parallelepipede ou d'un rectangle
+ if ( ZoneType == 2 || ( ZoneType>=11 && ZoneType <=13 ) ) // Cas d un parallelepipede ou d'un rectangle
{ myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], 0., 0., 0.); }
else if ( ZoneType == 4 ) // Cas d une sphere
{ myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], 0., 0., 0., 0., 0.); }
- else if ( ZoneType == 5 or ( ZoneType>=31 and ZoneType <=33 ) ) // Cas d un cylindre ou d'un disque
+ else if ( ZoneType == 5 || ( ZoneType>=31 && ZoneType <=33 ) ) // Cas d un cylindre ou d'un disque
{ myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], 0.); }
- else if ( ZoneType == 7 or ( ZoneType>=61 and ZoneType <=63 ) ) // Cas d un tuyau ou disque perce
+ else if ( ZoneType == 7 || ( ZoneType>=61 && ZoneType <=63 ) ) // Cas d un tuyau ou disque perce
{ myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], (*zone)[8]); }
else { VERIFICATION("ZoneType est incorrect." == 0) ; }
iaux += 1 ;
addInStudy(theStudy);
// Controle de la non publication d'un objet de meme nom
- if ( (!aBoundary->_is_nil()) or (!aHypo->_is_nil()) or (!aYACS->_is_nil()) or (!aZone->_is_nil()) )
+ if ( (!aBoundary->_is_nil()) || (!aHypo->_is_nil()) || (!aYACS->_is_nil()) || (!aZone->_is_nil()) )
{
SALOMEDS::Study::ListOfSObject_var listSO = theStudy->FindObjectByName(theName, ComponentDataType());
if (listSO->length() >= 1)
//=============================================================================
extern "C"
{
+ HOMARDENGINE_EXPORT
PortableServer::ObjectId* HOMARDEngine_factory(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
PortableServer::ObjectId* contId,
#include CORBA_CLIENT_HEADER(SALOMEDS)
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+#include "HOMARD_i.hxx"
#include "HOMARD_Gen.hxx"
#include "HomardDriver.hxx"
#include "YACSDriver.hxx"
#include <string>
#include <map>
-class HOMARD_Gen_i:
+class HOMARDENGINE_EXPORT HOMARD_Gen_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_Gen
{
#include CORBA_SERVER_HEADER(HOMARD_Gen)
#include CORBA_SERVER_HEADER(HOMARD_Hypothesis)
+#include "HOMARD_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "Utils_CorbaException.hxx"
class HOMARD_Hypothesis;
-class HOMARD_Hypothesis_i:
+class HOMARDENGINE_EXPORT HOMARD_Hypothesis_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_Hypothesis,
public virtual PortableServer::ServantBase
#include CORBA_SERVER_HEADER(HOMARD_Gen)
#include CORBA_SERVER_HEADER(HOMARD_Iteration)
+#include "HOMARD_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "Utils_CorbaException.hxx"
class HOMARD_Iteration;
-class HOMARD_Iteration_i:
+class HOMARDENGINE_EXPORT HOMARD_Iteration_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_Iteration,
public virtual PortableServer::ServantBase
#include CORBA_SERVER_HEADER(HOMARD_Gen)
#include CORBA_SERVER_HEADER(HOMARD_YACS)
+#include "HOMARD_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "Utils_CorbaException.hxx"
class HOMARD_YACS;
-class HOMARD_YACS_i:
+class HOMARDENGINE_EXPORT HOMARD_YACS_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_YACS,
public virtual PortableServer::ServantBase
#include CORBA_SERVER_HEADER(HOMARD_Gen)
#include CORBA_SERVER_HEADER(HOMARD_Zone)
+#include "HOMARD_i.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "Utils_CorbaException.hxx"
class HOMARD_Zone;
-class HOMARD_Zone_i:
+class HOMARDENGINE_EXPORT HOMARD_Zone_i:
public virtual Engines_Component_i,
public virtual POA_HOMARD::HOMARD_Zone,
public virtual PortableServer::ServantBase
--- /dev/null
+// Copyright (C) 2011-2013 CEA/DEN, EDF R&D
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// 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
+//
+
+#ifndef _HOMARD_I_HXX_
+#define _HOMARD_I_HXX_
+
+#ifdef WIN32
+ #if defined HOMARDENGINE_EXPORTS || defined HOMARDEngine_EXPORTS
+ #define HOMARDENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define HOMARDENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define HOMARDENGINE_EXPORT
+#endif
+
+#endif //_HOMARD_I_HXX_
+
+
#ifndef HOMARDMEDCOMMUN_H
#define HOMARDMEDCOMMUN_H
+#include "HOMARD_i.hxx"
#include <vector>
#include <set>
#include <string>
-int MEDFileExist( const char * aFile );
-std::vector<double> GetBoundingBoxInMedFile( const char * aFile);
-std::set<std::string> GetListeGroupesInMedFile(const char * aFile);
+HOMARDENGINE_EXPORT int MEDFileExist( const char * aFile );
+HOMARDENGINE_EXPORT std::vector<double> GetBoundingBoxInMedFile( const char * aFile);
+HOMARDENGINE_EXPORT std::set<std::string> GetListeGroupesInMedFile(const char * aFile);
#endif // HOMARD%MEDCOMMUN_H