Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[bos #41978][EDF] Edit table of density on wire discretization. Load properly the...
[modules/smesh.git]
/
src
/
DriverSTL
/
DriverSTL_R_SMDS_Mesh.cxx
diff --git
a/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cxx
b/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cxx
index ae7e48cca98a1d0b25af2faae85e51dca1d9962b..c2fd53597f643c596c4dbf1d257ed8c9ff2c2a2a 100644
(file)
--- a/
src/DriverSTL/DriverSTL_R_SMDS_Mesh.cxx
+++ b/
src/DriverSTL/DriverSTL_R_SMDS_Mesh.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
16 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-20
24 CEA, EDF
, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-23,6
+23,7
@@
#include "DriverSTL_R_SMDS_Mesh.h"
#include <Basics_Utils.hxx>
#include "DriverSTL_R_SMDS_Mesh.h"
#include <Basics_Utils.hxx>
+#include <Basics_OCCTVersion.hxx>
#include <gp_Pnt.hxx>
#include <NCollection_DataMap.hxx>
#include <gp_Pnt.hxx>
#include <NCollection_DataMap.hxx>
@@
-41,8
+42,12
@@
namespace
//function : HashCode
//purpose :
//=======================================================================
//function : HashCode
//purpose :
//=======================================================================
+#if OCC_VERSION_LARGE < 0x07080000
inline static Standard_Integer HashCode
(const gp_Pnt& point, Standard_Integer Upper)
inline static Standard_Integer HashCode
(const gp_Pnt& point, Standard_Integer Upper)
+#else
+ size_t operator()(const gp_Pnt& point) const
+#endif
{
union
{
{
union
{
@@
-52,14
+57,22
@@
namespace
point.Coord( U.R[0], U.R[1], U.R[2] );
point.Coord( U.R[0], U.R[1], U.R[2] );
+#if OCC_VERSION_LARGE < 0x07080000
return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper);
return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper);
+#else
+ return static_cast<size_t>(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7);
+#endif
}
//=======================================================================
//function : IsEqual
//purpose :
//=======================================================================
}
//=======================================================================
//function : IsEqual
//purpose :
//=======================================================================
+#if OCC_VERSION_LARGE < 0x07080000
inline static Standard_Boolean IsEqual
(const gp_Pnt& point1, const gp_Pnt& point2)
inline static Standard_Boolean IsEqual
(const gp_Pnt& point1, const gp_Pnt& point2)
+#else
+ bool operator()(const gp_Pnt& point1, const gp_Pnt& point2) const
+#endif
{
static Standard_Real tab1[3], tab2[3];
point1.Coord(tab1[0],tab1[1],tab1[2]);
{
static Standard_Real tab1[3], tab2[3];
point1.Coord(tab1[0],tab1[1],tab1[2]);
@@
-142,6
+155,9
@@
Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::Perform()
else
aResult = readBinary( file );
else
aResult = readBinary( file );
+ myMesh->Modified();
+ myMesh->CompactMesh();
+
return aResult;
}
return aResult;
}
@@
-235,7
+251,12
@@
Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readAscii(SMESH_File& theFile) const
theFile.close();
// Open the file
theFile.close();
// Open the file
- FILE* file = fopen( myFile.c_str(),"r");
+#if defined(WIN32) && defined(UNICODE)
+ std::wstring aFile = Kernel_Utils::utf8_decode_s(myFile);
+ FILE* file = _wfopen( aFile.c_str(), L"r");
+#else
+ FILE* file = fopen(myFile.c_str(), "r");
+#endif
// count the number of lines
Standard_Integer nbLines = 0;
// count the number of lines
Standard_Integer nbLines = 0;