-// Copyright (C) 2004-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2004-2020 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
#include "MG_Hexotic_API.hxx"
+#ifdef WIN32
+#define NOMINMAX
+#endif
+
#include <SMESH_Comment.hxx>
#include <SMESH_File.hxx>
#include <Utils_SALOME_Exception.hxx>
{
if ( _hexa_mesh )
hexa_regain_mesh( _session, _hexa_mesh );
- if ( _session )
- hexa_session_delete( _session );
if ( _tria_mesh )
mesh_delete( _tria_mesh );
if ( _sizemap )
sizemap_delete( _sizemap );
+ if ( _session )
+ hexa_session_delete( _session );
if ( _context )
context_delete( _context );
int IsVertexRequired( int iNode )
{
- return ! ( iNode < int( _xyz.size() - _nodeSize.size() ));
+ return ! ( iNode < int( NbNodes() - _nodeSize.size() ));
}
double GetSizeAtVertex( int iNode )
{
- return IsVertexRequired( iNode ) ? _nodeSize[ iNode - _xyz.size() + _nodeSize.size() ] : 0.;
+ return IsVertexRequired( iNode ) ? _nodeSize[ iNode - NbNodes() + _nodeSize.size() ] : 0.;
}
};
MG_Hexotic_API::LibData* data = (MG_Hexotic_API::LibData *) user_data;
data->AddError( desc );
+#ifdef _DEBUG_
+ //std::cout << desc << std::endl;
+#endif
+
// Compute progress
// corresponding messages are:
// " | Analyzing the surface mesh |" => 1 %
MG_Hexotic_API::MG_Hexotic_API(volatile bool& cancelled_flag, double& progress)
{
+ _useLib = false;
#ifdef USE_MG_LIBS
_useLib = true;
_libData = new LibData( cancelled_flag, progress );
_libData->Init();
-#endif
if ( getenv("MG_HEXA_USE_EXE"))
_useLib = false;
+#endif
}
//================================================================================
value = "";
while ( i+1 < args.size() && args[i+1][0] != '-' )
{
+ if ( strncmp( "1>", args[i+1].c_str(), 2 ) == 0 )
+ break;
if ( !value.empty() ) value += " ";
value += args[++i];
}
}
// compute
- return _libData->Compute();
+ bool ok = _libData->Compute();
+
+ GetLog(); // write a log file
+ _logFile = ""; // not to write it again
+
+ return ok;
#endif
}
errStr = SMESH_Comment("system(mg-hexa.exe ...) command failed with error: ")
<< strerror( errno );
- GetLog(); // write a log file
- _logFile = ""; // not to write it again
-
return !err;
}