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
IPAL0054674: Wrong mesh icon after mesh modification
[modules/smesh.git]
/
src
/
DriverMED
/
DriverMED_W_SMESHDS_Mesh.cxx
diff --git
a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
index a1902daac8aafe9f4cfc43d9c83906a2e769242f..c7d22645d5407218d01cd2b872b2f9d1767e136f 100644
(file)
--- a/
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
+++ b/
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
16
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
20
CEA/DEN, EDF R&D, 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
@@
-34,6
+34,7
@@
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include "SMESHDS_Mesh.hxx"
+#include "MED_Common.hxx"
#include <med.h>
#include <med.h>
@@
-61,12
+62,14
@@
DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
myDoGroupOfBalls(false),
myAutoDimension(false),
myAddODOnVertices(false),
myDoGroupOfBalls(false),
myAutoDimension(false),
myAddODOnVertices(false),
- myDoAllInGroups(false)
+ myDoAllInGroups(false),
+ myVersion(-1),
+ myZTolerance(-1.)
{}
{}
-void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, int the
Minor
)
+void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, int the
Version
)
{
{
- my
Minor = theMinor
;
+ my
Version = theVersion
;
Driver_SMESHDS_Mesh::SetFile(theFileName);
}
Driver_SMESHDS_Mesh::SetFile(theFileName);
}
@@
-74,7
+77,7
@@
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, int theMi
* MED version is either the latest available, or with an inferior minor,
* to ensure backward compatibility on writing med files.
*/
* MED version is either the latest available, or with an inferior minor,
* to ensure backward compatibility on writing med files.
*/
-string DriverMED_W_SMESHDS_Mesh::GetVersionString(int the
Version
, int theNbDigits)
+string DriverMED_W_SMESHDS_Mesh::GetVersionString(int the
Minor
, int theNbDigits)
{
TInt majeur, mineur, release;
majeur=MED_MAJOR_NUM;
{
TInt majeur, mineur, release;
majeur=MED_MAJOR_NUM;
@@
-82,12
+85,12
@@
string DriverMED_W_SMESHDS_Mesh::GetVersionString(int theVersion, int theNbDigit
release=MED_RELEASE_NUM;
TInt imposedMineur = mineur;
release=MED_RELEASE_NUM;
TInt imposedMineur = mineur;
- if (the
Version
< 0)
+ if (the
Minor
< 0)
imposedMineur = mineur;
imposedMineur = mineur;
- else if (the
Version
> MED_MINOR_NUM)
+ else if (the
Minor
> MED_MINOR_NUM)
imposedMineur = mineur;
else
imposedMineur = mineur;
else
- imposedMineur = the
Version
;
+ imposedMineur = the
Minor
;
ostringstream name;
if ( theNbDigits > 0 )
ostringstream name;
if ( theNbDigits > 0 )
@@
-416,6
+419,8
@@
Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
+ if ( myZTolerance > 0 && anIsZDimension )
+ anIsZDimension = (aBounds[5] > myZTolerance || aBounds[4] < -myZTolerance );
aSpaceDimension = Max( aMeshDimension, anIsXDimension + anIsYDimension + anIsZDimension );
if ( !aSpaceDimension )
aSpaceDimension = 3;
aSpaceDimension = Max( aMeshDimension, anIsXDimension + anIsYDimension + anIsZDimension );
if ( !aSpaceDimension )
aSpaceDimension = 3;
@@
-457,7
+462,7
@@
Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
}
}
}
}
- MED::PWrapper myMed = CrWrapperW(myFile, my
Minor
);
+ MED::PWrapper myMed = CrWrapperW(myFile, my
Version
);
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
//MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
myMed->SetMeshInfo(aMeshInfo);
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
//MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
myMed->SetMeshInfo(aMeshInfo);
@@
-549,6
+554,10
@@
Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
for(TInt iCoord = 0; iCoord < aSpaceDimension; iCoord++){
aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord);
}
for(TInt iCoord = 0; iCoord < aSpaceDimension; iCoord++){
aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord);
}
+ if ( aSpaceDimension == 3 &&
+ -myZTolerance < aTCoordSlice[2] && aTCoordSlice[2] < myZTolerance )
+ aTCoordSlice[2] = 0.;
+
// node number
int aNodeID = aCoordHelperPtr->GetID();
aNodeInfo->SetElemNum( iNode, aNodeID );
// node number
int aNodeID = aCoordHelperPtr->GetID();
aNodeInfo->SetElemNum( iNode, aNodeID );