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
Merge branch 'V9_9_BR'
[modules/smesh.git]
/
src
/
DriverMED
/
DriverMED_R_SMESHDS_Mesh.cxx
diff --git
a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
index 000316955a73241fe05852f971e80d25461f14b6..9936a73933b101654c6505e184d324c42a6cf7fa 100644
(file)
--- a/
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
+++ b/
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
16
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
22
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
@@
-36,6
+36,7
@@
#include "MED_Utilities.hxx"
#include <NCollection_Map.hxx>
#include "MED_Utilities.hxx"
#include <NCollection_Map.hxx>
+#include <smIdType.hxx>
#include "utilities.h"
#include "utilities.h"
@@
-110,7
+111,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif
myFamilies.clear();
if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile);
#endif
myFamilies.clear();
if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile);
- PWrapper aMed = CrWrapper
(myFile,tru
e);
+ PWrapper aMed = CrWrapper
R(myFil
e);
aResult = DRS_EMPTY;
TInt aNbMeshes = aMed->GetNbMeshes();
aResult = DRS_EMPTY;
TInt aNbMeshes = aMed->GetNbMeshes();
@@
-156,7
+157,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
}
if(MYDEBUG) MESSAGE(aGroupName);
if ( strncmp( aGroupName.c_str(), NIG_GROUP_PREFIX, strlen(NIG_GROUP_PREFIX) ) != 0 )
}
if(MYDEBUG) MESSAGE(aGroupName);
if ( strncmp( aGroupName.c_str(), NIG_GROUP_PREFIX, strlen(NIG_GROUP_PREFIX) ) != 0 )
- aFamily->AddGroupName(
aGroupName
);
+ aFamily->AddGroupName(
fixUTF8( aGroupName )
);
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
@@
-225,7
+226,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
// Reading pre information about all MED cells
//--------------------------------------------
// Reading pre information about all MED cells
//--------------------------------------------
- typedef MED::TVector<
int
> TNodeIds;
+ typedef MED::TVector<
smIdType
> TNodeIds;
bool takeNumbers = true; // initially we trust the numbers from file
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
bool takeNumbers = true; // initially we trust the numbers from file
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
@@
-266,14
+267,14
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
}
#endif
if ( !anIsNodeNum )
}
#endif
if ( !anIsNodeNum )
- aNodeIds.
swap( *(aBallInfo->myConn
));
+ aNodeIds.
assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end(
));
// allocate array of diameters
// allocate array of diameters
- vtkIdType maxID =
myMesh->MaxElementID() + aNbBalls
;
+ vtkIdType maxID =
FromSmIdType<vtkIdType>(myMesh->MaxElementID() + aNbBalls)
;
if ( anIsElemNum && !aBallInfo->myElemNum->empty() )
maxID = *std::max_element( aBallInfo->myElemNum->begin(),
aBallInfo->myElemNum->end() );
if ( anIsElemNum && !aBallInfo->myElemNum->empty() )
maxID = *std::max_element( aBallInfo->myElemNum->begin(),
aBallInfo->myElemNum->end() );
- myMesh->
g
etGrid()->AllocateDiameters( maxID ); // performance optimization
+ myMesh->
G
etGrid()->AllocateDiameters( maxID ); // performance optimization
// create balls
SMDS_MeshElement* anElement;
// create balls
SMDS_MeshElement* anElement;
@@
-318,7
+319,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID)
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID)
- (const std::vector<
int> & nodes_ids, const int
ID);
+ (const std::vector<
smIdType> & nodes_ids, const smIdType
ID);
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon)
(const std::vector<const SMDS_MeshNode*> & nodes);
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon)
(const std::vector<const SMDS_MeshNode*> & nodes);
@@
-355,7
+356,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif
if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
#endif
if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
- anElement = (myMesh->*addPolyWithID)( aNodeIds,
anElemId
);
+ anElement = (myMesh->*addPolyWithID)( aNodeIds,
ToSmIdType(anElemId)
);
}
if ( !anElement ) {
aNodes.resize( aNbConn );
}
if ( !anElement ) {
aNodes.resize( aNbConn );
@@
-436,7
+437,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif
if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
#endif
if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
- anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,
anElemId
);
+ anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,
ToSmIdType(anElemId)
);
}
if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes);
}
if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes);
@@
-502,7
+503,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
default:;
}
vector<TInt> aNodeIds(aNbNodes);
default:;
}
vector<TInt> aNodeIds(aNbNodes);
- for (
i
nt iElem = 0; iElem < aNbElems; iElem++ )
+ for (
TI
nt iElem = 0; iElem < aNbElems; iElem++ )
{
bool anIsValidConnect = false;
TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
{
bool anIsValidConnect = false;
TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
@@
-1038,8
+1039,6
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
- if (myMesh)
- myMesh->compactMesh();
// Mantis issue 0020483
if (aResult == DRS_OK && isDescConn) {
// Mantis issue 0020483
if (aResult == DRS_OK && isDescConn) {
@@
-1058,7
+1057,7
@@
list<string> DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
try {
if(MYDEBUG) MESSAGE("GetMeshNames - myFile : " << myFile);
theStatus = DRS_OK;
try {
if(MYDEBUG) MESSAGE("GetMeshNames - myFile : " << myFile);
theStatus = DRS_OK;
- PWrapper aMed = CrWrapper(myFile);
+ PWrapper aMed = CrWrapper
R
(myFile);
if (TInt aNbMeshes = aMed->GetNbMeshes()) {
for (int iMesh = 0; iMesh < aNbMeshes; iMesh++) {
if (TInt aNbMeshes = aMed->GetNbMeshes()) {
for (int iMesh = 0; iMesh < aNbMeshes; iMesh++) {
@@
-1137,6
+1136,14
@@
void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
if (( famVecPtr = myGroups2FamiliesMap.ChangeSeek( aGroupName )))
{
if (( famVecPtr = myGroups2FamiliesMap.ChangeSeek( aGroupName )))
{
+ size_t groupSize = 0;
+ for ( size_t i = 0; i < famVecPtr->size(); ++i )
+ {
+ DriverMED_FamilyPtr aFamily = (*famVecPtr)[i];
+ groupSize += aFamily->NbElements( theGroup->GetType() );
+ }
+ theGroup->SMDSGroup().Reserve( groupSize );
+
for ( size_t i = 0; i < famVecPtr->size(); ++i )
{
DriverMED_FamilyPtr aFamily = (*famVecPtr)[i];
for ( size_t i = 0; i < famVecPtr->size(); ++i )
{
DriverMED_FamilyPtr aFamily = (*famVecPtr)[i];