-// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 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
#include "MED_Utilities.hxx"
#include <NCollection_Map.hxx>
+#include <smIdType.hxx>
#include "utilities.h"
//#include <stdlib.h>
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-//#define _DEXCEPT_
-#else
-static int MYDEBUG = 0;
-#endif
-
#define _EDF_NODE_IDS_
using namespace MED;
try {
#endif
myFamilies.clear();
- if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile);
+ MESSAGE("Perform - myFile : "<<myFile);
PWrapper aMed = CrWrapperR(myFile);
aResult = DRS_EMPTY;
if (myMeshId != -1) aMeshName = SMESH_Comment( myMeshId );
else aMeshName = myMeshName;
- if(MYDEBUG) MESSAGE("Perform - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
+ MESSAGE("Perform - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
if ( aMeshName != aMeshInfo->GetName() ) continue;
aResult = DRS_OK;
//------------------------------------------------
TErr anErr;
TInt aNbFams = aMed->GetNbFamilies(aMeshInfo);
- if(MYDEBUG) MESSAGE("Read " << aNbFams << " families");
+ MESSAGE("Read " << aNbFams << " families");
for (TInt iFam = 0; iFam < aNbFams; iFam++)
{
PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr);
if(anErr >= 0){
TInt aFamId = aFamilyInfo->GetId();
- if(MYDEBUG) MESSAGE("Family " << aFamId << " :");
+ MESSAGE("Family " << aFamId << " :");
DriverMED_FamilyPtr aFamily (new DriverMED_Family);
TInt aNbGrp = aFamilyInfo->GetNbGroup();
- if(MYDEBUG) MESSAGE("belong to " << aNbGrp << " groups");
+ MESSAGE("belong to " << aNbGrp << " groups");
bool isAttrOk = false;
if(aFamilyInfo->GetNbAttr() == aNbGrp)
isAttrOk = true;
TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr);
aFamily->SetGroupAttributVal(anAttrVal);
}
- if(MYDEBUG) MESSAGE(aGroupName);
+ MESSAGE(aGroupName);
if ( strncmp( aGroupName.c_str(), NIG_GROUP_PREFIX, strlen(NIG_GROUP_PREFIX) ) != 0 )
aFamily->AddGroupName( fixUTF8( aGroupName ));
}
EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
TInt aNbElems = aNodeInfo->GetNbElem();
- if(MYDEBUG) MESSAGE("Perform - aNodeInfo->GetNbElem() = "<<aNbElems<<"; anIsNodeNum = "<<anIsNodeNum);
+ MESSAGE("Perform - aNodeInfo->GetNbElem() = "<<aNbElems<<"; anIsNodeNum = "<<anIsNodeNum);
DriverMED_FamilyPtr aFamily;
for ( TInt iElem = 0; iElem < aNbElems; iElem++ )
{
// 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();
aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end());
// 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() );
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);
#endif
if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
- anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId );
+ anElement = (myMesh->*addPolyWithID)( aNodeIds, ToSmIdType(anElemId) );
}
if ( !anElement ) {
aNodes.resize( aNbConn );
#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);
PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
EBooleen anIsElemNum = takeNumbers ? aCellInfo->IsElemNum() : eFAUX;
TInt aNbElems = aCellInfo->GetNbElem();
- if(MYDEBUG) MESSAGE("Perform - anEntity = "<<anEntity<<"; anIsElemNum = "<<anIsElemNum);
- if(MYDEBUG) MESSAGE("Perform - aGeom = "<<aGeom<<"; aNbElems = "<<aNbElems);
+ MESSAGE("Perform - anEntity = "<<anEntity<<"; anIsElemNum = "<<anIsElemNum);
+ MESSAGE("Perform - aGeom = "<<aGeom<<"; aNbElems = "<<aNbElems);
TInt aNbNodes = -1;
switch(aGeom){
default:;
}
vector<TInt> aNodeIds(aNbNodes);
- for ( int iElem = 0; iElem < aNbElems; iElem++ )
+ for ( TInt iElem = 0; iElem < aNbElems; iElem++ )
{
bool anIsValidConnect = false;
TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
aResult = DRS_WARN_DESCENDING;
}
- if(MYDEBUG) MESSAGE("Perform - aResult status = "<<aResult);
+ MESSAGE("Perform - aResult status = "<<aResult);
return aResult;
}
list<string> aMeshNames;
try {
- if(MYDEBUG) MESSAGE("GetMeshNames - myFile : " << myFile);
+ MESSAGE("GetMeshNames - myFile : " << myFile);
theStatus = DRS_OK;
PWrapper aMed = CrWrapperR(myFile);
}
const char* aGroupName = theGroup->GetStoreName();
- if(MYDEBUG) MESSAGE("Get Group " << aGroupName);
+ MESSAGE("Get Group " << aGroupName);
if (( famVecPtr = myGroups2FamiliesMap.ChangeSeek( aGroupName )))
{