//---------------------------------------------------------------
void
- GetCellsSize(vtkIdType& theNbCells, vtkIdType& theCellsSize,
+ GetCellsSize(vtkIdType& theNbCells,
+ vtkIdType& theCellsSize,
SALOME_MED::MESH_ptr theMEDMesh,
const VISU::TEntity& theVEntity)
{
int iGeomEnd = GetEntity2Geom(theVEntity,aGeomElems);
const medEntityMesh& aMEntity = VTKEntityToMED(theVEntity);
if(MYDEBUG) MESSAGE("GetCellsSize - theVEntity = "<<theVEntity);
- for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
- medGeometryElement aMEDGeom = aGeomElems[iGeom];
- int iNumElemEnd = theMEDMesh->getNumberOfElements(aMEntity,aMEDGeom);
- if(iNumElemEnd > 0){
- if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
- theCellsSize += iNumElemEnd*(MEDGeom2NbNodes(aMEDGeom) + 1);
- theNbCells += iNumElemEnd;
- }
+ for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
+ medGeometryElement aMEDGeom = aGeomElems[iGeom];
+ int iNumElemEnd = theMEDMesh->getNumberOfElements(aMEntity,aMEDGeom);
+ if(iNumElemEnd > 0){
+ if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+ theCellsSize += iNumElemEnd*(MEDGeom2NbNodes(aMEDGeom) + 1);
+ theNbCells += iNumElemEnd;
}
+ }
}
//---------------------------------------------------------------
void
- GetCellsSize(vtkIdType& theNbCells, vtkIdType& theCellsSize,
+ GetCellsSize(vtkIdType& theNbCells,
+ vtkIdType& theCellsSize,
SALOME_MED::FAMILY_ptr theMEDFamily)
{
medGeometryElement_array_var aGeom = theMEDFamily->getTypes();
if(theEntity == NODE_ENTITY){
aMeshOnEntity->myNbCells = theMesh->myNbPoints;
aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
- vtkIdType aNbCells, aCellsSize;
- GetCellsSize(aNbCells,aCellsSize,theMEDMesh,CELL_ENTITY);
- if(aNbCells > 0){
- TMeshOnEntityMap::iterator aIter = aMeshOnEntityMap.find(CELL_ENTITY);
- if (aIter != aMeshOnEntityMap.end()){
- VISU::PCMeshOnEntity aMeshOnCells = aIter->second;
- aMeshOnCells->myEntity = VISU::CELL_ENTITY;
- aMeshOnCells->myMeshName = theMesh->myName;
- aMeshOnCells->myNbCells = aNbCells;
- aMeshOnCells->myCellsSize = aCellsSize;
- }
- }
}else{
GetCellsSize(aMeshOnEntity->myNbCells,aMeshOnEntity->myCellsSize,theMEDMesh,theEntity);
}
}
-
+
+
+ //---------------------------------------------------------------
+ PCMeshOnEntity
+ InitMeshOnEntity(const VISU::PCMesh& theMesh,
+ const VISU::TEntity& theEntity,
+ const VISU::PCMeshOnEntity& theMeshOnEntity)
+ {
+ PCMeshOnEntity aMeshOnEntity;
+ TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(theEntity);
+ if(anIter == aMeshOnEntityMap.end()){
+ aMeshOnEntity.reset(new TCMeshOnEntity());
+ *aMeshOnEntity = *theMeshOnEntity;
+ aMeshOnEntity->myEntity = theEntity;
+ aMeshOnEntityMap[theEntity] = aMeshOnEntity;
+ }else
+ aMeshOnEntity = anIter->second;
+
+ GetCellsSize(theMesh,theMesh->myMesh,theEntity);
+
+ return aMeshOnEntity;
+ }
+
}
aMeshOnEntity->myMeshName = aMeshName.in();
aMeshOnEntity->mySupport = aMEDSupport;
- if(aVEntity == NODE_ENTITY){
- PCMeshOnEntity aMeshOnEntity2 = aMeshOnEntityMap[CELL_ENTITY](new TCMeshOnEntity());
- *aMeshOnEntity2 = *aMeshOnEntity;
- aMeshOnEntity->myEntity = CELL_ENTITY;
- GetCellsSize(aMesh,aMEDMesh,CELL_ENTITY);
- }else{
- PCMeshOnEntity aMeshOnEntity2 = aMeshOnEntityMap[NODE_ENTITY](new TCMeshOnEntity());
- *aMeshOnEntity2 = *aMeshOnEntity;
- aMeshOnEntity->myEntity = NODE_ENTITY;
- GetCellsSize(aMesh,aMEDMesh,NODE_ENTITY);
- }
- GetCellsSize(aMesh,aMEDMesh,aVEntity);
+ if(aVEntity == NODE_ENTITY)
+ ::InitMeshOnEntity(aMesh,CELL_ENTITY,aMeshOnEntity);
+ else
+ ::InitMeshOnEntity(aMesh,NODE_ENTITY,aMeshOnEntity);
+
+ ::GetCellsSize(aMesh,aMEDMesh,aVEntity);
TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
PCField aField = aFieldMap[aFieldName.in()](new TCField());
aNbCells = aMesh->myNbPoints;
aCellsSize = 2*aMesh->myNbPoints;
}else
- GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
+ ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
if(aNbCells > 0){
TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
int aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
if(!anIsOnAllElements)
- GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
+ ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
if(MYDEBUG)
MESSAGE("VISU_MEDConvertor::Build "<<
}else
aMeshOnEntity = aMeshOnEntityMapIter->second;
- PCMeshOnEntity aMeshOnEntity2;
- if(aVEntity == NODE_ENTITY){
- TEntity aVEntity2 = CELL_ENTITY;
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter2 = aMeshOnEntityMap.find(aVEntity2);
- if(aMeshOnEntityMapIter2 == aMeshOnEntityMap.end()){
- aMeshOnEntity2.reset(new TCMeshOnEntity());
- aMeshOnEntity2->myEntity = aVEntity2;
- aMeshOnEntity2->myMeshName = aMeshName.in();
- aMeshOnEntity2->mySupport = aMEDSupport;
- aMeshOnEntityMap[aVEntity2] = aMeshOnEntity2;
- }else
- aMeshOnEntity2 = aMeshOnEntityMapIter2->second;
- GetCellsSize(aMesh,aMEDMesh,aVEntity2);
- }else{
- TEntity aVEntity2 = NODE_ENTITY;
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter2 = aMeshOnEntityMap.find(aVEntity2);
- if(aMeshOnEntityMapIter2 == aMeshOnEntityMap.end()){
- aMeshOnEntity2.reset(new TCMeshOnEntity());
- aMeshOnEntity2->myEntity = aVEntity2;
- aMeshOnEntity2->myMeshName = aMeshName.in();
- aMeshOnEntity2->mySupport = aMEDSupport;
- aMeshOnEntityMap[aVEntity2] = aMeshOnEntity2;
- }else
- aMeshOnEntity2 = aMeshOnEntityMapIter2->second;
- GetCellsSize(aMesh,aMEDMesh,aVEntity2);
- }
+ if(aVEntity == NODE_ENTITY)
+ ::InitMeshOnEntity(aMesh,CELL_ENTITY,aMeshOnEntity);
+ else
+ ::InitMeshOnEntity(aMesh,NODE_ENTITY,aMeshOnEntity);
- GetCellsSize(aMesh,aMEDMesh,aVEntity);
+ ::GetCellsSize(aMesh,aMEDMesh,aVEntity);
PCField aField;
TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;