1 // Copyright (C) 2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef MEDMESHCONVERTERUTILITIES_HXX
21 #define MEDMESHCONVERTERUTILITIES_HXX
23 #include "MEDLoaderDefines.hxx"
33 #define THROW_IK_EXCEPTION(text) \
35 std::ostringstream oss; oss << text; \
36 throw INTERP_KERNEL::Exception(oss.str().c_str()); \
41 bool isMeshExtensionCorrect( const std::string& fileName );
43 //~void closeMeshFile(const int gmfMeshID);
47 DRS_EMPTY, // a file contains no mesh with the given name
48 DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
49 // so the numbers from the file are ignored
50 DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
51 DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
52 DRS_FAIL // general failure (exception etc.)
55 * \brief Class to generate string from any type
57 class Comment : public std::string
59 std::ostringstream _s ;
63 Comment():std::string("") {}
65 Comment(const Comment& c):std::string() {
67 this->std::string::operator=( _s.str() );
70 Comment & operator=(const Comment& c) {
72 this->std::string::operator=( _s.str() );
77 Comment( const T &anything ) {
79 this->std::string::operator=( _s.str() );
83 Comment & operator<<( const T &anything ) {
85 this->std::string::operator=( _s.str() );
89 operator char*() const {
90 return (char*)c_str();
93 std::ostream& Stream() {
98 * \brief Enforce freeing memory allocated by std::vector
100 template <class TVECTOR>
101 void FreeVector(TVECTOR& vec)
106 template <class TVECTOR>
107 void CompactVector(TVECTOR& vec)
117 MEDLOADER_EXPORT Localizer();
118 MEDLOADER_EXPORT ~Localizer();
123 #endif // MEDMESHCONVERTERUTILITIES_HXX