if(!aMeshOnEntity->myIsVTKDone){
if(MYVTKDEBUG) aSource->DebugOn();
- LoadMeshOnEntity(aMeshOnEntity);
+ LoadMeshOnEntity(aMesh,aMeshOnEntity);
GetPoints(aSource,aMesh);
GetCellsOnEntity(aSource,aMeshOnEntity);
FindFamilyOnEntity(theMeshName,theEntity,theFamilyName);
PMeshImpl aMesh = boost::get<0>(aFindFamilyOnEntity);;
- PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindFamilyOnEntity);
+ PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
//Main part of code
const TVTKSource& aSource = aFamily->GetSource();
if(!aFamily->myIsVTKDone){
if(MYVTKDEBUG) aSource->DebugOn();
- LoadMeshOnEntity(aMeshOnEntity,theFamilyName);
+ LoadFamilyOnEntity(aMesh,aMeshOnEntity,aFamily);
GetPoints(aSource,aMesh);
GetCellsOnEntity(aSource,aMeshOnEntity,theFamilyName);
LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
try{
- LoadMeshOnEntity(aVTKMeshOnEntity);
+ LoadMeshOnEntity(aMesh,aVTKMeshOnEntity);
}catch(std::exception& exc){
aVTKMeshOnEntity = aMeshOnEntity;
MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
protected:
virtual
int
- LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity,
- const std::string& theFamilyName = "") = 0;
+ LoadMeshOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
+
+ virtual
+ int
+ LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily) = 0;
virtual
int
//---------------------------------------------------------------
int
VISU_MedConvertor
-::LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity,
- const string& theFamilyName)
+::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity)
{
MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
- const std::string& aMeshName = theMeshOnEntity->myMeshName;
const TEntity& anEntity = theMeshOnEntity->myEntity;
- PMeshImpl aMesh = myMeshMap[aMeshName];
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
if(anEntity == NODE_ENTITY){
- isPointsUpdated += LoadPoints(aMed,aMesh,theFamilyName);
+ isPointsUpdated += LoadPoints(aMed,theMesh);
}else{
- isPointsUpdated += LoadPoints(aMed,aMesh);
- isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,aMesh,theMeshOnEntity,theFamilyName);
+ isPointsUpdated += LoadPoints(aMed,theMesh);
+ isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
+ }
+
+ return (isPointsUpdated || isCellsOnEntityUpdated);
+}
+
+
+//---------------------------------------------------------------
+int
+VISU_MedConvertor
+::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily)
+{
+ MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
+ const TEntity& anEntity = theMeshOnEntity->myEntity;
+
+ int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
+ if(anEntity == NODE_ENTITY){
+ isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,theFamily);
+ }else{
+ isPointsUpdated += LoadPoints(aMed,theMesh);
+ isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,theMeshOnEntity,theFamily);
}
return (isPointsUpdated || isCellsOnEntityUpdated);
const std::string& aFamilyName = aFamilyAndEntitySetIter->first;
const TEntity& anEntity = aFamilyAndEntitySetIter->second;
const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
+ PMEDFamily aFamily = VISU::GetFamily(aMeshOnEntity,aFamilyName);
if(anEntity == NODE_ENTITY){
- isPointsUpdated += LoadPoints(aMed,theMesh,aFamilyName);
+ isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily);
}else{
isPointsUpdated += LoadPoints(aMed,theMesh);
- isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,aMeshOnEntity,aFamilyName);
+ isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,aMeshOnEntity,aFamily);
}
}
int
VISU_MedConvertor
::LoadPoints(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- const string& theFamilyName)
+ VISU::PMEDMesh theMesh)
{
try{
//Check on existing family
PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
- aMeshOnEntity->myEntity = NODE_ENTITY;
aMeshOnEntity->myMeshName = theMesh->myName;
- PMEDFamily aFamily = VISU::GetFamily(aMeshOnEntity,theFamilyName);
+ aMeshOnEntity->myEntity = NODE_ENTITY;
+
+ INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<<theMesh->myIsDone<<"'\n");
//Check on loading already done
if(theMesh->myIsDone)
- if(!aFamily)
- return 0;
- else if(aFamily->myIsDone)
- return 0;
-
- INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<<theMesh->myIsDone<<
- "; theFamilyName = '"<<theFamilyName<<"'\n");
+ return 0;
//Main part of code
MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
TInt aNbElem = aNodeInfo->GetNbElem();
+ TInt aDim = theMesh->myDim;
- if(!theMesh->myIsDone){
- TInt aDim = theMesh->myDim;
+ TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
+ if(EBooleen anIsNodeNum = aNodeInfo->IsElemNum())
+ aCoords.Init(aNbElem,aDim,aNodeInfo->myElemNum);
+ else
+ aCoords.Init(aNbElem,aDim);
+
+ for(int iDim = 0; iDim < aDim; iDim++)
+ aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim);
+
+ for(int iElem = 0; iElem < aNbElem; iElem++){
+ TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem);
+ MED::TCCoordSlice aMCoordSlice = aNodeInfo->GetCoordSlice(iElem);
+ for(int iDim = 0; iDim < aDim; iDim++)
+ aVCoordSlice[iDim] = aMCoordSlice[iDim];
+ }
+
+ TCell2Connect& aConnForCellType = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
+ aConnForCellType.resize(aNbElem);
+ for (int iElem = 0; iElem < aNbElem; iElem++)
+ aConnForCellType[iElem] = VISU::TConnect(1,iElem);
+
+ theMesh->myIsDone = true;
+
+ return 1;
- TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
- if(EBooleen anIsNodeNum = aNodeInfo->IsElemNum())
- aCoords.Init(aNbElem,aDim,aNodeInfo->myElemNum);
- else
- aCoords.Init(aNbElem,aDim);
+ }catch(std::exception& exc){
+ throw;
+ }catch(...){
+ EXCEPTION(runtime_error,"Unknown exception !!!");
+ }
- for(int iDim = 0; iDim < aDim; iDim++)
- aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim);
-
- for(int iElem = 0; iElem < aNbElem; iElem++){
- TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem);
- MED::TCCoordSlice aMCoordSlice = aNodeInfo->GetCoordSlice(iElem);
- for(int iDim = 0; iDim < aDim; iDim++)
- aVCoordSlice[iDim] = aMCoordSlice[iDim];
- }
+ return 0;
+}
- TCell2Connect& aConnForCellType = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
- aConnForCellType.resize(aNbElem);
- for (int iElem = 0; iElem < aNbElem; iElem++)
- aConnForCellType[iElem] = VISU::TConnect(1,iElem);
-
- theMesh->myIsDone = true;
- }
- if(aFamily){
- if(!aFamily->myIsDone){
- if(aNbElem > 0){
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[VTK_VERTEX];
- for (int iElem = 0; iElem < aNbElem; iElem++)
- if(aNodeInfo->GetFamNum(iElem) == aFamily->myId)
- aSubMeshID.push_back(iElem);
- }
- aFamily->myIsDone = true;
- }
+//---------------------------------------------------------------
+int
+VISU_MedConvertor
+::LoadPointsOnFamily(const MED::PWrapper& theMed,
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDFamily theFamily)
+{
+ try{
+ if(theFamily->myIsDone)
+ return 0;
+
+ //Main part of code
+ MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
+ TInt aNbElem = aNodeInfo->GetNbElem();
+
+ if(aNbElem > 0){
+ TInt anId = theFamily->myId;
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VTK_VERTEX];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aNodeInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
}
+ theFamily->myIsDone = true;
+
return 1;
+
}catch(std::exception& exc){
throw;
}catch(...){
//---------------------------------------------------------------
int
VISU_MedConvertor
-::LoadCellsOnEntity(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- const string& theFamilyName)
+::LoadCellsOnEntity(const MED::PWrapper& theMed,
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity)
{
#ifndef _DEXCEPT_
try{
#endif
-
- //Check on existing family
- PFamilyImpl aFamily = VISU::GetFamily(theMeshOnEntity,theFamilyName);
-
- //Check on loading already done
- bool isCellsLoaded = !theMeshOnEntity->myGeom2Cell2Connect.empty();
- if(isCellsLoaded)
- if(!aFamily)
- return 0;
- else if(!aFamily->myGeom2SubMeshID.empty())
- return 0;
-
- INITMSG(MYDEBUG,"LoadCellsOnEntity - theFamilyName = '"<<theFamilyName<<"'\n");
- BEGMSG(MYDEBUG,"LoadCellsOnEntity - isCellsLoaded = "<<isCellsLoaded<<"; isFamilyPresent = "<<bool(aFamily)<<endl);
-
const TEntity& aVEntity = theMeshOnEntity->myEntity;
const MED::EEntiteMaillage& aMEntity = VTKEntityToMED(aVEntity);
+ INITMSG(MYDEBUG,"LoadCellsOnEntity - aVEntity = "<<aVEntity<<"\n");
+
+ if(theMeshOnEntity->myIsDone)
+ return 0;
+
const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
TInt aNbPoints = aNodeInfo->GetNbElem();
MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aPolygoneInfo->GetNbElem();
- if(!isCellsLoaded){
- TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
- aCell2Connect.resize(aNbElem);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
- TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
- TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aNbConn);
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- anArray[iConn] = aConnSlice[iConn] - 1;
- }
- }
- if(aFamily){
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
- for(int iElem = 0; iElem < aNbElem; iElem++)
- if(aPolygoneInfo->GetFamNum(iElem) == aFamily->myId)
- aSubMeshID.push_back(iElem);
+ TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
+ aCell2Connect.resize(aNbElem);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
+ TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+ TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aNbConn);
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ anArray[iConn] = aConnSlice[iConn] - 1;
}
+
break;
}
case MED::ePOLYEDRE: {
MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aPolyedreInfo->GetNbElem();
- if(!isCellsLoaded){
- TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
- aCell2Connect.resize(aNbElem);
+ TCell2Connect& aCell2Connect = aGeom2Cell2Connect[aVGeom];
+ aCell2Connect.resize(aNbElem);
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
- TConnect& anArray = aCell2Connect[iElem];
- typedef set<TInt> TConnectSet;
- TConnectSet aConnectSet;
- TInt aNbFaces = aConnSliceArr.size();
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- for(TInt iConn = 0; iConn < aNbConn; iConn++){
- aConnectSet.insert(aConnSlice[iConn]);
- }
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+ TConnect& anArray = aCell2Connect[iElem];
+ typedef set<TInt> TConnectSet;
+ TConnectSet aConnectSet;
+ TInt aNbFaces = aConnSliceArr.size();
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ for(TInt iConn = 0; iConn < aNbConn; iConn++){
+ aConnectSet.insert(aConnSlice[iConn]);
}
+ }
- int aNbConn = aConnectSet.size();
- anArray.resize(aNbConn);
- TConnectSet::iterator anIter = aConnectSet.begin();
- for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
- TInt anId = *anIter;
- anArray[i] = anId - 1;
- }
+ int aNbConn = aConnectSet.size();
+ anArray.resize(aNbConn);
+ TConnectSet::iterator anIter = aConnectSet.begin();
+ for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
+ TInt anId = *anIter;
+ anArray[i] = anId - 1;
}
}
- if(aFamily){
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
- for(int iElem = 0; iElem < aNbElem; iElem++)
- if(aPolyedreInfo->GetFamNum(iElem) == aFamily->myId)
- aSubMeshID.push_back(iElem);
- }
+
break;
}
default: {
MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aCellInfo->GetNbElem();
- if(!isCellsLoaded){
- TCell2Connect& aConnForCellType = aGeom2Cell2Connect[aVGeom];
- aConnForCellType.resize(aNbElem);
-
- int aMNbNodes = MEDGeom2NbNodes(aMGeom);
- vector<TInt> aConnect(aMNbNodes);
+ TCell2Connect& aConnForCellType = aGeom2Cell2Connect[aVGeom];
+ aConnForCellType.resize(aNbElem);
+
+ int aMNbNodes = MEDGeom2NbNodes(aMGeom);
+ vector<TInt> aConnect(aMNbNodes);
+
+ for (int iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
+ TConnect& anArray = aConnForCellType[iElem];
+ anArray.resize(aVNbNodes);
- for (int iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
- TConnect& anArray = aConnForCellType[iElem];
- anArray.resize(aVNbNodes);
-
- if(anIsNodeNum){
- for(int iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
- }
- }else{
- for(int iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aConnSlice[iConn] - 1;
- }
+ if(anIsNodeNum){
+ for(int iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
}
-
- switch(aMGeom){
- case MED::eTETRA4:
- case MED::eTETRA10:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[1];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[2];
- break;
- case MED::ePYRA5:
- case MED::ePYRA13:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- break;
- default:
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- anArray[iNode] = aConnect[iNode];
+ }else{
+ for(int iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aConnSlice[iConn] - 1;
}
+ }
+
+ switch(aMGeom){
+ case MED::eTETRA4:
+ case MED::eTETRA10:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[1];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[2];
+ break;
+ case MED::ePYRA5:
+ case MED::ePYRA13:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ break;
+ default:
for(int iNode = 0; iNode < aVNbNodes; iNode++)
- if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
- EXCEPTION(runtime_error,"LoadCellsOnEntity - "<<
- " aNbPoints("<<aNbPoints<<") "<<
- "<= anArray["<<iElem<<"]"<<
- "["<<iNode<<"]"<<
- "("<<anArray[iNode]<<") < 0");
+ anArray[iNode] = aConnect[iNode];
}
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
+ EXCEPTION(runtime_error,"LoadCellsOnEntity - "<<
+ " aNbPoints("<<aNbPoints<<") "<<
+ "<= anArray["<<iElem<<"]"<<
+ "["<<iNode<<"]"<<
+ "("<<anArray[iNode]<<") < 0");
}
- //Filling aFamily Geom2SubMeshID
- if(aFamily){
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
- for(int iElem = 0; iElem < aNbElem; iElem++)
- if(aCellInfo->GetFamNum(iElem) == aFamily->myId)
- aSubMeshID.push_back(iElem);
- }
+ }}
+ }
+ theMeshOnEntity->myIsDone = true;
+
+ return 1;
+
+#ifndef _DEXCEPT_
+ }catch(std::exception& exc){
+ throw;
+ }catch(...){
+ EXCEPTION(runtime_error,"Unknown exception !!!");
+ }
+#endif
+
+ return 0;
+}
+
+
+//---------------------------------------------------------------
+int
+VISU_MedConvertor
+::LoadCellsOnFamily(const MED::PWrapper& theMed,
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const VISU::PMEDFamily theFamily)
+{
+#ifndef _DEXCEPT_
+ try{
+#endif
+ const TEntity& aVEntity = theMeshOnEntity->myEntity;
+ const MED::EEntiteMaillage& aMEntity = VTKEntityToMED(aVEntity);
+
+ INITMSG(MYDEBUG,"LoadCellsOnFamily - aVEntity = "<<aVEntity<<"\n");
+
+ if(theFamily->myIsDone)
+ return 0;
+
+ TInt anId = theFamily->myId;
+
+ const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
+ const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
+ MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+ TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
+
+ for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+ int aVGeom = MEDGeomToVTK(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ switch(aMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolygoneInfo->GetNbElem();
+
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aVGeom];
+ for(int iElem = 0; iElem < aNbElem; iElem++)
+ if(aPolygoneInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+
+ break;
}
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolyedreInfo->GetNbElem();
+
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aVGeom];
+ for(int iElem = 0; iElem < aNbElem; iElem++)
+ if(aPolyedreInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+
+ break;
}
+ default: {
+ int aVNbNodes = VTKGeom2NbNodes(aVGeom);
+
+ MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aCellInfo->GetNbElem();
+
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aVGeom];
+ for(int iElem = 0; iElem < aNbElem; iElem++)
+ if(aCellInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ }}
}
+
+ theFamily->myIsDone = true;
+
return 1;
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- theMeshOnEntity->myGeom2Cell2Connect.clear();
- throw;
+ throw;x
}catch(...){
- theMeshOnEntity->myGeom2Cell2Connect.clear();
EXCEPTION(runtime_error,"Unknown exception !!!");
}
#endif
virtual
int
- LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity,
- const std::string& theFamilyName = "");
+ LoadMeshOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity);
+ virtual
+ int
+ LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily);
+
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
int
LoadPoints(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- const std::string& theFamilyName = "");
+ const VISU::PMEDMesh theMesh);
+
+ int
+ LoadPointsOnFamily(const MED::PWrapper& theMed,
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDFamily theFamily);
int
LoadCellsOnEntity(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- const std::string& theFamilyName = "");
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity);
+
+ int
+ LoadCellsOnFamily(const MED::PWrapper& theMed,
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const VISU::PMEDFamily theFamily);
int
LoadValForTimeOnMesh(const MED::PWrapper& theMed,
//---------------------------------------------------------------
int
-VISU_MEDConvertor::LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity,
- const string& theFamilyName)
+VISU_MEDConvertor
+::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity)
{
- //Main part of code
- const string& aMeshName = theMeshOnEntity->myMeshName;
const TEntity& aVEntity = theMeshOnEntity->myEntity;
- PCMesh aMesh = myMeshMap[aMeshName];
- int isPointsUpdated;
+ int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
if(aVEntity == NODE_ENTITY)
- isPointsUpdated = LoadPoints(aMesh,theFamilyName);
- else
- isPointsUpdated = LoadPoints(aMesh);
- int isCellsOnEntityUpdated = LoadCellsOnEntity(aMesh,theMeshOnEntity,theFamilyName);
+ isPointsUpdated += LoadPoints(theMesh);
+ else{
+ isPointsUpdated += LoadPoints(theMesh);
+ isCellsOnEntityUpdated += LoadCellsOnEntity(theMesh,theMeshOnEntity);
+ }
return (isPointsUpdated || isCellsOnEntityUpdated);
}
+//---------------------------------------------------------------
+int
+VISU_MEDConvertor
+::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily)
+{
+ const TEntity& anEntity = theMeshOnEntity->myEntity;
+ int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
+ if(anEntity == NODE_ENTITY){
+ isPointsUpdated += LoadPointsOnFamily(theMesh,theFamily);
+ }else{
+ isPointsUpdated += LoadPoints(theMesh);
+ isCellsOnEntityUpdated += LoadCellsOnFamily(theMesh,theMeshOnEntity,theFamily);
+ }
+
+ return (isPointsUpdated || isCellsOnEntityUpdated);
+}
+
+
//---------------------------------------------------------------
int
-VISU_MEDConvertor::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
+VISU_MEDConvertor
+::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
+ const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
{
//Main part of code
int isPointsUpdated = 0;
const string& aFamilyName = aFamilyAndEntitySetIter->first;
const VISU::TEntity& aVEntity = aFamilyAndEntitySetIter->second;
PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
+ PCFamily aFamily = VISU::GetFamily(aMeshOnEntity,aFamilyName);
if(aVEntity == VISU::NODE_ENTITY){
- isPointsUpdated += LoadPoints(theMesh,aFamilyName);
+ isPointsUpdated += LoadPointsOnFamily(theMesh,aFamily);
isCellsOnEntityUpdated += LoadCellsOnEntity(theMesh,aMeshOnEntity);
}else{
isPointsUpdated += LoadPoints(theMesh);
- isCellsOnEntityUpdated += LoadCellsOnEntity(theMesh,aMeshOnEntity,aFamilyName);
+ isCellsOnEntityUpdated += LoadCellsOnFamily(theMesh,aMeshOnEntity,aFamily);
}
}
//---------------------------------------------------------------
int
-VISU_MEDConvertor::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+VISU_MEDConvertor
+::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
//Main part of code
int isPointsUpdated = LoadPoints(theMesh);
//---------------------------------------------------------------
int
-VISU_MEDConvertor::LoadPoints(VISU::PCMesh theMesh,
- const string& theFamilyName)
+VISU_MEDConvertor
+::LoadPoints(VISU::PCMesh theMesh)
{
//Check on existing family
PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
- PCFamily aFamily = GetFamily(aMeshOnEntity,theFamilyName);
-
+
//Check on loading already done
if(theMesh->myIsDone)
- if(!aFamily)
- return 0;
- else if(!aFamily->myIsDone)
- return 0;
-
- if(MYDEBUG)
- MESSAGE("LoadPoints - theFamilyName = '"<<theFamilyName<<"'");
-
+ return 0;
+
SALOME_MED::MESH_var& aMedMesh = theMesh->myMesh;
int aDim = theMesh->myDim;
TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
throw std::runtime_error("LoadPoints >> There is no points in the mesh !!!");
SALOME_MED::double_array_var aCCoord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
- if(!theMesh->myIsDone){
- for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
- VISU::TCoordSlice aCoordSlice = aCoords.GetCoordSlice(iElem);
- for(int iDim = 0; iDim < aDim; iDim++)
- aCoordSlice[iDim] = aCCoord[anId++];
- }
+ for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
+ VISU::TCoordSlice aCoordSlice = aCoords.GetCoordSlice(iElem);
+ for(int iDim = 0; iDim < aDim; iDim++)
+ aCoordSlice[iDim] = aCCoord[anId++];
+ }
+
+ if(MYDEBUG) MESSAGE("LoadPoints - Filling aMeshOnEntity with type NODE_ENTITY");
+
+ TCell2Connect& aCell2Connect = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
+ aCell2Connect.resize(aNbElem);
+ for(int iElem = 0; iElem < aNbElem; iElem++)
+ aCell2Connect[iElem] = TConnect(1,iElem);
+
+ theMesh->myIsDone = true;
- if(MYDEBUG) MESSAGE("LoadPoints - Filling aMeshOnEntity with type NODE_ENTITY");
+ return 1;
+}
- TCell2Connect& aCell2Connect = aMeshOnEntity->myGeom2Cell2Connect[VTK_VERTEX];
- aCell2Connect.resize(aNbElem);
- for(int iElem = 0; iElem < aNbElem; iElem++)
- aCell2Connect[iElem] = TConnect(1,iElem);
-
- theMesh->myIsDone = true;
- }
- if(aFamily){
- if(!aFamily->myIsDone){
- if(MYDEBUG) MESSAGE("LoadPoints - Filling aFamily Geom2SubMeshID");
-
- SALOME_MED::FAMILY_var aMedFamily = aFamily->myFamily;
- CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[VTK_VERTEX];
-
- if(!anIsOnAllElements){
- SALOME_MED::medGeometryElement_array_var aGeom = aMedFamily->getTypes();
- SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom[0]);
- int aMaxElemId = aNbElem;
- aNbElem = aCellNumForType->length();
- for(int iElem = 0; iElem < aNbElem; iElem++){
- int aTmp = aCellNumForType[iElem]-1;
- if(0 > aTmp || aTmp >= aMaxElemId){
- static QString aString;
- aString.sprintf("LoadPoints - aMaxElemId(%d) <= aCellNumForType[%d]=%d < 0",aMaxElemId,iElem,aTmp);
- throw std::runtime_error(aString.latin1());
- }
- aSubMeshID.push_back(aTmp);
- }
- }else{
- for(int iElem = 0; iElem < aNbElem; iElem++){
- aSubMeshID.push_back(iElem);
- }
- }
+//---------------------------------------------------------------
+int
+VISU_MEDConvertor
+::LoadPointsOnFamily(VISU::PCMesh theMesh,
+ VISU::PCFamily theFamily)
+{
+ PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
- aFamily->myIsDone = true;
+ if(theFamily->myIsDone)
+ return 0;
+
+ TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
+ int aNbElem = aCoords.GetNbPoints();
+
+ SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily;
+ CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VTK_VERTEX];
+
+ if(!anIsOnAllElements){
+ SALOME_MED::medGeometryElement_array_var aGeom = aMedFamily->getTypes();
+ SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom[0]);
+ int aMaxElemId = aNbElem;
+ aNbElem = aCellNumForType->length();
+ for(int iElem = 0; iElem < aNbElem; iElem++){
+ int aTmp = aCellNumForType[iElem]-1;
+ if(0 > aTmp || aTmp >= aMaxElemId){
+ static QString aString;
+ aString.sprintf("LoadPointsOnFamily - aMaxElemId(%d) <= aCellNumForType[%d]=%d < 0",aMaxElemId,iElem,aTmp);
+ throw std::runtime_error(aString.latin1());
+ }
+ aSubMeshID.push_back(aTmp);
+ }
+ }else{
+ for(int iElem = 0; iElem < aNbElem; iElem++){
+ aSubMeshID.push_back(iElem);
}
}
+
+ theFamily->myIsDone = true;
return 1;
}
//---------------------------------------------------------------
int
-VISU_MEDConvertor::LoadCellsOnEntity(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- const string& theFamilyName)
+VISU_MEDConvertor
+::LoadCellsOnEntity(VISU::PCMesh theMesh,
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
- //Check on existing family
- PCFamily aFamily = GetFamily(theMeshOnEntity,theFamilyName);
- //Check on loading already done
- bool isCellsLoaded = !theMeshOnEntity->myGeom2Cell2Connect.empty();
- if(isCellsLoaded)
- if(!aFamily)
- return 0;
- else if(!aFamily->myGeom2SubMeshID.empty())
- return 0;
+ if(theMeshOnEntity->myIsDone)
+ return 0;
SALOME_MED::SUPPORT_var& aMedSupport = theMeshOnEntity->mySupport;
SALOME_MED::MESH_var aMedMesh = aMedSupport->getMesh();
- if(MYDEBUG) {
- MESSAGE("LoadCellsOnEntity - theFamilyName = '"<<theFamilyName<<"'");
- MESSAGE("LoadCellsOnEntity - isCellsLoaded = "<<isCellsLoaded<<"; isFamilyPresent = "<<bool(aFamily));
- }
//Main part of code
SALOME_MED::medGeometryElement* aGeomElems;
const SALOME_MED::medEntityMesh& aMEntity = VTKEntityToMED(aVEntity);
const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
int aNbPoints = aCoords.GetNbPoints();
- if(!isCellsLoaded){
- for(int iGeom = 0, aCounter = 0; iGeom < iGeomEnd; iGeom++){
- SALOME_MED::medGeometryElement aGeom = aGeomElems[iGeom];
- int aMNbNodes = MEDGeom2NbNodes(aGeom);
- int aVGeom = MEDGeomToVTK(aGeom);
- int aVNbNodes = VTKGeom2NbNodes(aVGeom);
- int iNumElemEnd = aMedMesh->getNumberOfElements(aMEntity,aGeom);
- if (iNumElemEnd > 0) {
- SALOME_MED::long_array_var conn =
- aMedMesh->getConnectivity(SALOME_MED::MED_FULL_INTERLACE,SALOME_MED::MED_NODAL,aMEntity,aGeom);
- TCell2Connect& aCell2Connect = theMeshOnEntity->myGeom2Cell2Connect[aVGeom];
- //APO - aCell2Connect.resize(iNumElemEnd);
- vector<int> aConnect(aMNbNodes);
- int aNbConnForElem = conn->length()/iNumElemEnd;
- if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aGeom = "<<aGeom<<
- "; iNumElemEnd = "<<iNumElemEnd<<
- "; aNbConnForElem = "<<aNbConnForElem);
- for (int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++) {
- VISU::TConnect anArray(aVNbNodes);
- for (int k = 0, kj = iNumElem*aNbConnForElem; k < aMNbNodes; k++) {
- aConnect[k] = conn[kj+k] - 1;
- }
- switch(aGeom){
- case SALOME_MED::MED_TETRA4 :
- case SALOME_MED::MED_TETRA10 :
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[1];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[2];
- break;
- case SALOME_MED::MED_PYRA5 :
- case SALOME_MED::MED_PYRA13 :
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- break;
- default:
- for (int k = 0; k < aVNbNodes; k++)
- anArray[k] = aConnect[k];
- }
+
+ for(int iGeom = 0, aCounter = 0; iGeom < iGeomEnd; iGeom++){
+ SALOME_MED::medGeometryElement aGeom = aGeomElems[iGeom];
+ int aMNbNodes = MEDGeom2NbNodes(aGeom);
+ int aVGeom = MEDGeomToVTK(aGeom);
+ int aVNbNodes = VTKGeom2NbNodes(aVGeom);
+ int iNumElemEnd = aMedMesh->getNumberOfElements(aMEntity,aGeom);
+ if (iNumElemEnd > 0) {
+ SALOME_MED::long_array_var conn =
+ aMedMesh->getConnectivity(SALOME_MED::MED_FULL_INTERLACE,SALOME_MED::MED_NODAL,aMEntity,aGeom);
+ TCell2Connect& aCell2Connect = theMeshOnEntity->myGeom2Cell2Connect[aVGeom];
+ std::vector<int> aConnect(aMNbNodes);
+ int aNbConnForElem = conn->length()/iNumElemEnd;
+
+ if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aGeom = "<<aGeom<<
+ "; iNumElemEnd = "<<iNumElemEnd<<
+ "; aNbConnForElem = "<<aNbConnForElem);
+
+ for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++){
+ VISU::TConnect anArray(aVNbNodes);
+ for(int k = 0, kj = iNumElem*aNbConnForElem; k < aMNbNodes; k++)
+ aConnect[k] = conn[kj+k] - 1;
+
+ switch(aGeom){
+ case SALOME_MED::MED_TETRA4 :
+ case SALOME_MED::MED_TETRA10 :
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[1];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[2];
+ break;
+ case SALOME_MED::MED_PYRA5 :
+ case SALOME_MED::MED_PYRA13 :
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ break;
+ default:
for (int k = 0; k < aVNbNodes; k++)
- if(anArray[k] < 0 || aNbPoints <= anArray[k]){
- static QString aString;
- aString.sprintf("ImportCells >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iNumElem,k,anArray[k]);
- throw std::runtime_error(aString.latin1());
- }
- aCell2Connect.push_back(anArray);
+ anArray[k] = aConnect[k];
}
- //Workaround for MED Component data structure
- int aSize = aCell2Connect.size();
- theMeshOnEntity->myCellsFirstIndex[aGeom] = TCMeshOnEntity::TIndexAndSize(aCounter,aSize);
- aCounter += aSize;
- }
- }
- }
- //Filling aFamily Geom2SubMeshID
- if(aFamily){
- SALOME_MED::FAMILY_var aMedFamily = aFamily->myFamily;
- CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
- if(!anIsOnAllElements){
- SALOME_MED::medGeometryElement_array_var aGeoms = aMedFamily->getTypes();
- iGeomEnd = aGeoms->length();
- if(MYDEBUG) MESSAGE("LoadCellsOnEntity - iGeomEnd = "<<iGeomEnd);
- for (int iGeom = 0; iGeom < iGeomEnd; iGeom++) {
- SALOME_MED::medGeometryElement aGeom = aGeoms[iGeom];
- SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom);
- int aVGeom = MEDGeomToVTK(aGeom);
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
- int iNumElemEndTmp = theMeshOnEntity->myGeom2Cell2Connect[aVGeom].size();
- int iNumElemEnd = aCellNumForType->length();
- int aCounter = theMeshOnEntity->myCellsFirstIndex[aGeom].first;
- if(MYDEBUG)
- MESSAGE("LoadCellsOnEntity - aGeom = "<<aGeom<<
- "; iNumElemEnd = "<<iNumElemEnd<<
- "; aCounter = "<<aCounter);
- for (int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++) {
- int tmp = aCellNumForType[iNumElem]-aCounter-1;
- if(0 > tmp || tmp >= iNumElemEndTmp) {
+ for (int k = 0; k < aVNbNodes; k++)
+ if(anArray[k] < 0 || aNbPoints <= anArray[k]){
static QString aString;
- aString.sprintf("LoadCellsOnEntity >> iNumElemEndTmp(%d) <= aCellNumForType[%d]=%d < 0 !!!",iNumElemEndTmp,iNumElem,tmp);
+ aString.sprintf("ImportCells >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iNumElem,k,anArray[k]);
throw std::runtime_error(aString.latin1());
}
- aSubMeshID.push_back(tmp);
- }
+ aCell2Connect.push_back(anArray);
}
- }else{
- const TGeom2Cell2Connect& aCellsConn = theMeshOnEntity->myGeom2Cell2Connect;
- TGeom2Cell2Connect::const_iterator aCellsConnIter = aCellsConn.begin();
- for(; aCellsConnIter != aCellsConn.end(); aCellsConnIter++){
- int aVGeom = aCellsConnIter->first;
- const TCell2Connect& aCell2Connect = aCellsConnIter->second;
- TSubMeshID& aSubMeshID = aFamily->myGeom2SubMeshID[aVGeom];
- int iNumElemEnd = aCell2Connect.size();
- for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
- aSubMeshID.push_back(iNumElem);
+ //Workaround for MED Component data structure
+ int aSize = aCell2Connect.size();
+ theMeshOnEntity->myCellsFirstIndex[aGeom] = TCMeshOnEntity::TIndexAndSize(aCounter,aSize);
+ aCounter += aSize;
+ }
+ }
+
+ theMeshOnEntity->myIsDone = true;
+
+ return 1;
+}
+
+
+//---------------------------------------------------------------
+int
+VISU_MEDConvertor
+::LoadCellsOnFamily(VISU::PCMesh theMesh,
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PCFamily theFamily)
+{
+ if(theFamily->myIsDone)
+ return 0;
+
+ SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily;
+ CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
+ if(!anIsOnAllElements){
+ SALOME_MED::medGeometryElement_array_var aGeoms = aMedFamily->getTypes();
+ int iGeomEnd = aGeoms->length();
+ if(MYDEBUG) MESSAGE("LoadCellsOnEntity - iGeomEnd = "<<iGeomEnd);
+ for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
+ SALOME_MED::medGeometryElement aGeom = aGeoms[iGeom];
+ SALOME_MED::long_array_var aCellNumForType = aMedFamily->getNumber(aGeom);
+ int aVGeom = MEDGeomToVTK(aGeom);
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aVGeom];
+ int iNumElemEndTmp = theMeshOnEntity->myGeom2Cell2Connect[aVGeom].size();
+ int iNumElemEnd = aCellNumForType->length();
+ int aCounter = theMeshOnEntity->myCellsFirstIndex[aGeom].first;
+
+ if(MYDEBUG)
+ MESSAGE("LoadCellsOnFamily "<<
+ "- aGeom = "<<aGeom<<
+ "; iNumElemEnd = "<<iNumElemEnd<<
+ "; aCounter = "<<aCounter);
+
+ for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++){
+ int tmp = aCellNumForType[iNumElem]-aCounter-1;
+ if(0 > tmp || tmp >= iNumElemEndTmp){
+ static QString aString;
+ aString.sprintf("LoadCellsOnEntity >> iNumElemEndTmp(%d) <= aCellNumForType[%d]=%d < 0 !!!",iNumElemEndTmp,iNumElem,tmp);
+ throw std::runtime_error(aString.latin1());
+ }
+ aSubMeshID.push_back(tmp);
}
}
+ }else{
+ const TGeom2Cell2Connect& aCellsConn = theMeshOnEntity->myGeom2Cell2Connect;
+ TGeom2Cell2Connect::const_iterator aCellsConnIter = aCellsConn.begin();
+ for(; aCellsConnIter != aCellsConn.end(); aCellsConnIter++){
+ int aVGeom = aCellsConnIter->first;
+ const TCell2Connect& aCell2Connect = aCellsConnIter->second;
+ TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aVGeom];
+ int iNumElemEnd = aCell2Connect.size();
+ for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
+ aSubMeshID.push_back(iNumElem);
+ }
}
+
+ theFamily->myIsDone = true;
+
return 1;
}
+
template<class TArray>
int
ImportField(TArray& theArray,
virtual
int
- LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity,
- const std::string& theFamilyName = "");
+ LoadMeshOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity);
+
+ virtual
+ int
+ LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily);
virtual
int
{}
int
- LoadPoints(VISU::PCMesh theMesh,
- const std::string& theFamilyName = "") ;
+ LoadPoints(VISU::PCMesh theMesh) ;
+
+ int
+ LoadPointsOnFamily(VISU::PCMesh theMesh,
+ VISU::PCFamily theFamily) ;
int
LoadCellsOnEntity(VISU::PCMesh theMesh,
+ VISU::PCMeshOnEntity theMeshOnEntity);
+
+ int
+ LoadCellsOnFamily(VISU::PCMesh theMesh,
VISU::PCMeshOnEntity theMeshOnEntity,
- const std::string& theFamilyName = "");
+ VISU::PCFamily theFamily);
int
LoadField(VISU::PCMesh theMesh,
};
-class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
+class VISU_MEDFieldConvertor: public VISU_MEDConvertor
+{
protected:
SALOME_MED::FIELD_var myField;
+
public:
+
VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) :
myField(SALOME_MED::FIELD::_duplicate(theField))
{}
- virtual VISU_Convertor* Build() ;
+
+ virtual
+ VISU_Convertor*
+ Build();
};
extern "C" {