X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD%2FHOMARD_Cas.cxx;h=4b67d08cda5b76902acdf9aee98ece1c6a66db3a;hb=refs%2Ftags%2FV9_13_0b1;hp=916b1b0a6b162fdca8adb76da756cbd8d2fa1987;hpb=376361b76f3823b13f8f8d39f23326fc3bad2ff7;p=modules%2Fhomard.git diff --git a/src/HOMARD/HOMARD_Cas.cxx b/src/HOMARD/HOMARD_Cas.cxx index 916b1b0a..4b67d08c 100644 --- a/src/HOMARD/HOMARD_Cas.cxx +++ b/src/HOMARD/HOMARD_Cas.cxx @@ -1,11 +1,11 @@ -// HOMARD HOMARD : implementaion of HOMARD idl descriptions +// HOMARD HOMARD : implementation of HOMARD idl descriptions // -// Copyright (C) 2011-2012 CEA/DEN, EDF R&D +// Copyright (C) 2011-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 @@ -19,15 +19,28 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : HOMARD_Cas.cxx -// Author : Paul RASCLE, EDF +// Author : Gerald NICOLAS, EDF // Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier #include "HOMARD_Cas.hxx" #include "utilities.h" +#include "HOMARD.hxx" #include +#include #ifndef WIN32 -# include +#include +#else +#include #endif //============================================================================= @@ -37,7 +50,7 @@ */ //============================================================================= HOMARD_Cas::HOMARD_Cas(): - _Name(""), _NomDir("/tmp"), _ConfType(1) + _Name(""), _NomDir("/tmp"), _ConfType(0), _ExtType(0) { MESSAGE("HOMARD_Cas"); } @@ -47,55 +60,30 @@ HOMARD_Cas::~HOMARD_Cas() { MESSAGE("~HOMARD_Cas"); } - //============================================================================= -void HOMARD_Cas::SetDirName( const char* NomDir ) //============================================================================= -{ - MESSAGE("SetDirName, NomDir : "<::const_iterator it = _ListBoundaryGroup.begin(); while(it != _ListBoundaryGroup.end()) @@ -115,69 +103,88 @@ std::string HOMARD_Cas::GetDumpPython() const return aScript.str(); } //============================================================================= -void HOMARD_Cas::AddIteration( const char* NomIteration ) //============================================================================= -{ - _ListIter.push_back( std::string( NomIteration ) ); -} - +// Caracteristiques //============================================================================= -const std::list& HOMARD_Cas::GetIterations() const //============================================================================= +int HOMARD_Cas::SetDirName( const char* NomDir ) { - return _ListIter; -} +// MESSAGE("SetDirName, NomDir : "< 1 ) { erreur = 1 ; } + // Creation + if ( CHDIR(NomDir) == 0 ) + { _NomDir = std::string( NomDir ); } + else + { +#ifndef WIN32 + if ( mkdir(NomDir, S_IRWXU|S_IRGRP|S_IXGRP) == 0 ) +#else + if ( _mkdir(NomDir) == 0 ) +#endif + { + if ( CHDIR(NomDir) == 0 ) { _NomDir = std::string( NomDir ); } + else { erreur = 2 ; } + } + else { erreur = 2 ; } + }; + return erreur ; +} //============================================================================= -void HOMARD_Cas::SupprIterations() -//============================================================================= +std::string HOMARD_Cas::GetDirName() const { - _ListIter.clear(); + return _NomDir; } - -//============================================================================= -std::string HOMARD_Cas::GetIter0Name() const //============================================================================= +int HOMARD_Cas::GetNumberofIter() { -// Par construction de la liste, l'iteration a ete mise en tete. - return (*(_ListIter.begin())); + return _ListIter.size(); } - +// +// Le type de conformite ou non conformite +// //============================================================================= void HOMARD_Cas::SetConfType( int Conftype ) -//============================================================================= { +// VERIFICATION( (Conftype>=-2) && (Conftype<=3) ); _ConfType = Conftype; } //============================================================================= const int HOMARD_Cas::GetConfType() const -//============================================================================= { return _ConfType; } +// +// Le type exterieur +// //============================================================================= -int HOMARD_Cas::GetNumber() +void HOMARD_Cas::SetExtType( int ExtType ) +{ +// VERIFICATION( (ExtType>=0) && (ExtType<=2) ); + _ExtType = ExtType; +} //============================================================================= - +const int HOMARD_Cas::GetExtType() const { - return _ListIter.size(); + return _ExtType; } // // La boite englobante // //============================================================================= void HOMARD_Cas::SetBoundingBox( const std::vector& extremas ) -//============================================================================= { _Boite.clear(); _Boite.resize( extremas.size() ); for ( int i = 0; i < extremas.size(); i++ ) _Boite[i] = extremas[i]; } - //============================================================================= const std::vector& HOMARD_Cas::GetBoundingBox() const -//============================================================================= { return _Boite; } @@ -185,20 +192,12 @@ const std::vector& HOMARD_Cas::GetBoundingBox() const // Les groupes // //============================================================================= -const std::list& HOMARD_Cas::GetGroups() const -//============================================================================= -{ - return _ListGroup; -} -//============================================================================= -void HOMARD_Cas::SupprGroups() -//============================================================================= +void HOMARD_Cas::AddGroup( const char* Group ) { - _ListGroup.clear(); + _ListGroup.push_back(Group); } //============================================================================= void HOMARD_Cas::SetGroups( const std::list& ListGroup ) -//============================================================================= { _ListGroup.clear(); std::list::const_iterator it = ListGroup.begin(); @@ -208,40 +207,77 @@ void HOMARD_Cas::SetGroups( const std::list& ListGroup ) } } //============================================================================= -void HOMARD_Cas::AddGroup( const char* Group ) +const std::list& HOMARD_Cas::GetGroups() const { - _ListGroup.push_back(Group); + return _ListGroup; +} +//============================================================================= +void HOMARD_Cas::SupprGroups() +{ + _ListGroup.clear(); } // // Les frontieres // //============================================================================= -const std::list& HOMARD_Cas::GetBoundaryGroup() const -//============================================================================= +void HOMARD_Cas::AddBoundary( const char* Boundary ) { - return _ListBoundaryGroup; +// MESSAGE ( ". HOMARD_Cas::AddBoundary : Boundary = " << Boundary ); + const char* Group = ""; + AddBoundaryGroup( Boundary, Group ); } //============================================================================= void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group ) { +// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Boundary = " << Boundary ); +// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Group = " << Group ); _ListBoundaryGroup.push_back( Boundary ); _ListBoundaryGroup.push_back( Group ); } //============================================================================= -void HOMARD_Cas::SupprBoundaryGroup() +const std::list& HOMARD_Cas::GetBoundaryGroup() const +{ + return _ListBoundaryGroup; +} //============================================================================= +void HOMARD_Cas::SupprBoundaryGroup() { _ListBoundaryGroup.clear(); } //============================================================================= void HOMARD_Cas::SetPyram( int Pyram ) -//============================================================================= { _Pyram = Pyram; } //============================================================================= const int HOMARD_Cas::GetPyram() const -//============================================================================= { return _Pyram; } +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +std::string HOMARD_Cas::GetIter0Name() const +{ +// Par construction de la liste, l'iteration a ete mise en tete. + return (*(_ListIter.begin())); +} +//============================================================================= +void HOMARD_Cas::AddIteration( const char* NomIteration ) +{ + _ListIter.push_back( std::string( NomIteration ) ); +} +//============================================================================= +const std::list& HOMARD_Cas::GetIterations() const +{ + return _ListIter; +} +//============================================================================= +void HOMARD_Cas::SupprIterations() +{ + _ListIter.clear(); +} + +