VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
const string& aFamilyName = aFamilyMapIter->first;
- aCon->GetMeshOnEntity(aMeshName,anEntity,aFamilyName);
+ aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
}
}
#include "MED_Vector.hxx"
#include <vtkSystemIncludes.h>
-//pkv f
-class vtkCell;
-//pkv t
+
class vtkUnstructuredGrid;
+class vtkCell;
namespace VISU
{
vtkIdType
GetElemObjID(int theVtkI) const = 0;
- //pkv f
virtual
vtkCell*
GetElemCell(int theObjID) = 0;
virtual
float*
GetNodeCoord(int theObjID) = 0;
- //pkv t
};
struct TFamily: virtual TIntId
{
TEntity myEntity;
+ TName myName;
};
//---------------------------------------------------------------
typedef std::pair<TName,TEntity> TFamilyAndEntity;
- typedef std::set<TFamilyAndEntity> TFamilyAndEntitySet;
+ typedef std::set<PFamily> TFamilySet;
struct TGroup: virtual TBaseStructure
{
- TFamilyAndEntitySet myFamilyAndEntitySet;
+ TFamilySet myFamilySet;
};
virtual
TOutput*
GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "") = 0;
+ const VISU::TEntity& theEntity) = 0;
+ virtual
+ TOutput*
+ GetFamilyOnEntity(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
virtual
float
GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "") = 0;
+ const VISU::TEntity& theEntity) = 0;
+ virtual
+ float
+ GetFamilyOnEntitySize(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
virtual
TOutput*
GetMeshOnGroup(const std::string& theMeshName,
void
GetCellsOnGroup(const TVTKSource& theSource,
const PMeshImpl& theMesh,
- const TFamilyAndEntitySet& theFamilyAndEntitySet)
+ const TFamilySet& theFamilySet)
{
//Calculate dimentions of the group
INITMSG(MYDEBUG,"GetCellsOnGroup\n");
int aNbCells = 0, aCellsSize = 0;
- VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
- for(; aFamilyAndEntitySetIter != theFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
- const VISU::TFamilyAndEntity& aFamilyAndEntity = *aFamilyAndEntitySetIter;
- const string& aFamilyName = aFamilyAndEntity.first;
- VISU::TEntity anEntity = aFamilyAndEntity.second;
- VISU::PMeshOnEntityImpl aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
- pair<int,int> aCellsDim = aMeshOnEntity->GetCellsDims(aFamilyName);
- aNbCells += aCellsDim.first;
- aCellsSize += aCellsDim.second;
+ VISU::TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
+ for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
+ VISU::PFamilyImpl aFamily = *aFamilyIter;
+ aCellsSize += aFamily->myCellsSize;
+ aNbCells += aFamily->myNbCells;
}
vtkCellArray* aConnectivity = vtkCellArray::New();
aConnectivity->Allocate(aCellsSize,0);
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
- for(int i = 0, j = 0; aFamilyAndEntitySetIter != theFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
- const VISU::TFamilyAndEntity& aFamilyAndEntity = *aFamilyAndEntitySetIter;
- const string& aFamilyName = aFamilyAndEntity.first;
- const VISU::TEntity& anEntity = aFamilyAndEntity.second;
+ aFamilyIter = theFamilySet.begin();
+ for(int i = 0, j = 0; aFamilyIter != theFamilySet.end(); aFamilyIter++){
+ VISU::PFamilyImpl aFamily = *aFamilyIter;
+ const std::string& aFamilyName = aFamily->myName;
+ const VISU::TEntity& anEntity = aFamily->myEntity;
PMeshOnEntityImpl aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
- PFamilyImpl aFamily = GetFamily(aMeshOnEntity,aFamilyName);
const VISU::TGeom2Cell2Connect &aGeom2Cell2Connect = aMeshOnEntity->myGeom2Cell2Connect;
VISU::TGeom2Cell2Connect::const_iterator aGeom2Cell2ConnectIter = aGeom2Cell2Connect.begin();
for(; aGeom2Cell2ConnectIter != aGeom2Cell2Connect.end(); aGeom2Cell2ConnectIter++){
VISU_Convertor::TOutput*
VISU_Convertor_impl
::GetMeshOnEntity(const string& theMeshName,
- const VISU::TEntity& theEntity,
- const string& theFamilyName)
+ const VISU::TEntity& theEntity)
{
- if(theFamilyName == "")
- return GetMeshOnEntity2(theMeshName,theEntity);
- else
- return GetFamilyOnEntity(theMeshName,theEntity,theFamilyName);
-}
-
-
-//---------------------------------------------------------------
-VISU_Convertor::TOutput*
-VISU_Convertor_impl
-::GetMeshOnEntity2(const string& theMeshName,
- const VISU::TEntity& theEntity)
-{
- INITMSG(MYDEBUG,"GetMeshOnEntity2"<<
+ INITMSG(MYDEBUG,"GetMeshOnEntity"<<
"; theMeshName = '"<<theMeshName<<"'"<<
"; theEntity = "<<theEntity<<
endl);
}
if(MYVTKDEBUG){
- GetMeshOnEntitySize(theMeshName,theEntity,theFamilyName);
+ GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
PrintMemorySize(aSource.GetPointer());
}
TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
- const VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
+ const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
//Main part of code
const TVTKSource& aSource = aGroup->GetSource();
try{
#endif
if(!aGroup->myIsVTKDone){
- LoadMeshOnGroup(aMesh,aFamilyAndEntitySet);
+ LoadMeshOnGroup(aMesh,aFamilySet);
GetPoints(aSource,aMesh);
- GetCellsOnGroup(aSource,aMesh,aFamilyAndEntitySet);
+ GetCellsOnGroup(aSource,aMesh,aFamilySet);
aGroup->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
- string aGroupName = QString(theGroupName.c_str()).simplifyWhiteSpace().latin1();
- string aFileName = string("/users/")+getenv("USER")+"/"+getenv("USER")+"-";
+ std::string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
+ std::string aGroupName = QString(theGroupName.c_str()).simplifyWhiteSpace().latin1();
+ std::string aFileName = string("/users/")+getenv("USER")+"/"+getenv("USER")+"-";
aFileName += aMeshName + "-" + aGroupName + "-Conv.vtk";
VISU::WriteToFile(aSource.GetPointer(),aFileName);
}
VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
const string& aFamilyName = aFamilyMapIter->first;
- aResult += GetMeshOnEntitySize(aMeshName,anEntity,aFamilyName);
+ aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName);
}
//Import mesh on entity
aResult += GetMeshOnEntitySize(aMeshName,anEntity);
float
VISU_Convertor_impl
::GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
-{
- if(theFamilyName == "")
- return GetMeshOnEntitySize2(theMeshName,theEntity);
- else
- return GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
-}
-
-
-//---------------------------------------------------------------
-float
-VISU_Convertor_impl
-::GetMeshOnEntitySize2(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
TFindMeshOnEntity aFindMeshOnEntity =
FindMeshOnEntity(theMeshName,theEntity);
aLinksSize = 0;
vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
- MSG(MYDEBUG,"GetMeshOnEntitySize2 "<<
+ MSG(MYDEBUG,"GetMeshOnEntitySize "<<
"- aResult = "<<float(aResult)<<
"; theMeshName = '"<<theMeshName<<"'"<<
"; theEntity = "<<theEntity);
virtual
float
GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "");
-
- virtual
- float
- GetMeshOnEntitySize2(const std::string& theMeshName,
const VISU::TEntity& theEntity);
virtual
virtual
TOutput*
GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName = "");
-
- virtual
- TOutput*
- GetMeshOnEntity2(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
virtual
TOutput*
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet) = 0;
+ const VISU::TFamilySet& theFamilySet) = 0;
virtual
int
PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
aFamily->myId = anId;
aFamily->myEntity = aVEntity;
+ aFamily->myName = aFamilyName;
aFamily->myNbCells = aSize;
aFamily->myCellsSize = 0;
INITMSG(MY_GROUP_DEBUG,"aGroupName = '"<<aGroupName<<"'\n");
PMEDGroup aGroup(new TMEDGroup());
-
+ TFamilySet& aFamilySet = aGroup->myFamilySet;
+
const MED::TFamilyInfoSet& aFamilyInfoSet = aGroupInfoIter->second;
MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin();
for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){
goto exit_lable;
}
}
- }
+ }
exit_lable:
if(aFamily && aVEntity >= 0){
- aGroup->myFamilyAndEntitySet.insert(TFamilyAndEntity(aFamilyName,aVEntity));
+ aFamilySet.insert(aFamily);
INITMSG(MY_GROUP_DEBUG,
"- aFamilyName = '"<<aFamilyName<<"'"<<
"; aVEntity = "<<aVEntity<<
aGroup->myCellsSize += aFamily->myCellsSize;
}
}
- if(!aGroup->myFamilyAndEntitySet.empty() && aGroup->myNbCells > 0){
+ if(!aFamilySet.empty() && aGroup->myNbCells > 0){
BEGMSG(MY_GROUP_DEBUG,
"- myNbCells = "<<aGroup->myNbCells<<
"; myCellsSize = "<<aGroup->myCellsSize<<
int
VISU_MedConvertor
::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
+ const VISU::TFamilySet& theFamilySet)
{
MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
- TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
- for(; aFamilyAndEntitySetIter != theFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
- const std::string& aFamilyName = aFamilyAndEntitySetIter->first;
- const TEntity& anEntity = aFamilyAndEntitySetIter->second;
+ TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
+ for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
+ PMEDFamily aFamily = *aFamilyIter;
+ const TEntity& anEntity = aFamily->myEntity;
const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
- PMEDFamily aFamily = VISU::GetFamily(aMeshOnEntity,aFamilyName);
if(anEntity == NODE_ENTITY){
isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily);
}else{
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+ const VISU::TFamilySet& theFamilySet);
virtual
int
PCGroup aGroup(new TCGroup());
aGroup->myGroup = aMEDGroup;
- VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
+ VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
int iFamilyEnd = aFamilies->length();
PCFamily aFamily = FindFamily(aMesh,aFamilyName.in());
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
if(aFamily){
- TFamilyAndEntity aFamilyAndEntity(aFamilyName.in(),aFamily->myEntity);
- aFamilyAndEntitySet.insert(aFamilyAndEntity);
+ aFamilySet.insert(aFamily);
aGroup->myNbCells += aFamily->myNbCells;
aGroup->myCellsSize += aFamily->myCellsSize;
}
}
- if(!aGroup->myFamilyAndEntitySet.empty()){
+ if(!aFamilySet.empty()){
TGroupMap& aGroupMap = aMesh->myGroupMap;
aGroupMap[aSupportName.in()] = aGroup;
}
int
VISU_MEDConvertor
::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
+ const VISU::TFamilySet& theFamilySet)
{
//Main part of code
int isPointsUpdated = 0;
int isCellsOnEntityUpdated = 0;
- VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
- for(; aFamilyAndEntitySetIter != theFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
- const string& aFamilyName = aFamilyAndEntitySetIter->first;
- const VISU::TEntity& aVEntity = aFamilyAndEntitySetIter->second;
+ TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
+ for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
+ PCFamily aFamily = *aFamilyIter;
+ const VISU::TEntity& aVEntity = aFamily->myEntity;
PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
- PCFamily aFamily = VISU::GetFamily(aMeshOnEntity,aFamilyName);
if(aVEntity == VISU::NODE_ENTITY){
isPointsUpdated += LoadPointsOnFamily(theMesh,aFamily);
isCellsOnEntityUpdated += LoadCellsOnEntity(theMesh,aMeshOnEntity);
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+ const VISU::TFamilySet& theFamilySet);
virtual
int
try{
MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
float aSize = INCMEMORY*
- theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity,theFamilyName);
+ theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity);
bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
return aResult;
break;
case VISU::TFAMILY :
//jfa IPAL9284:anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity,mySubMeshName);
- anOutput = myResult->GetInput()->GetMeshOnEntity
- (myMeshName,(VISU::TEntity)myEntity,mySubMeshName);//jfa IPAL9284
+ anOutput = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);//jfa IPAL9284
aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str());
break;
for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
const string& aFamilyName = aFamilyMapIter->first;
try{
- myInput->GetMeshOnEntity(aMeshName,anEntity,aFamilyName);
+ myInput->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
string aGroupEntry = CreateAttributes(myStudyDocument,aGroupsEntry.c_str(),aRefFatherEntry.c_str(),
"",aGroupName.c_str(),"",aComment.latin1(),true);
const VISU::PGroup aGroup = aGroupMapIter->second;
- const VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
- VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = aFamilyAndEntitySet.begin();
- for(; aFamilyAndEntitySetIter != aFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
- const VISU::TFamilyAndEntity& aFamilyAndEntity = *aFamilyAndEntitySetIter;
- const string& aFamilyName = aFamilyAndEntity.first;
- const VISU::TEntity& anEntity = aFamilyAndEntity.second;
+ const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
+ VISU::TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
+ for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
+ const VISU::PFamily& aFamily = *aFamilyIter;
+ const string& aFamilyName = aFamily->myName;
+ const VISU::TEntity& anEntity = aFamily->myEntity;
aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
VISU::TFAMILY,
aMeshName.c_str(),