return myFilter;
}
+ TDataSet*
+ TAppendFilter
+ ::GetDataSet() const
+ {
+ return GetFilter()->GetOutput();
+ }
+
//---------------------------------------------------------------
TPointCoords
}
+ //---------------------------------------------------------------
+ vtkIdType
+ TSubMeshImpl
+ ::GetElemVTKID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
+ vtkIdType
+ TSubMeshImpl
+ ::GetElemObjID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
+
//---------------------------------------------------------------
vtkIdType
TMeshOnEntityImpl
TMeshOnEntityImpl
::GetElemObjID(vtkIdType theID) const
{
- return theID;
+ vtkIdType anInputID;
+ const TVTKAppendFilter& anAppendFilter = GetFilter();
+ vtkIdType aID = anAppendFilter->GetElemObjId(theID,anInputID);
+ const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID];
+ return aSubMesh->GetElemObjID(aID);
}
//---------------------------------------------------------------
- void
- GetPoints(const TVTKSource& theSource,
- const PMeshImpl& theMesh)
+ vtkPoints*
+ GetPoints(const PMeshImpl& theMesh)
{
TVTKPoints& aPoints = theMesh->myPoints;
const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
}
theMesh->myIsVTKDone = true;
+
if(MYVTKDEBUG) aPoints->DebugOn();
}
- theSource->SetPoints(aPoints.GetPointer());
+ return aPoints.GetPointer();
}
//---------------------------------------------------------------
void
- GetCellsOnEntity(const TVTKSource& theSource,
- const PMeshOnEntityImpl& theMeshOnEntity)
+ GetCellsOnSubMesh(const TVTKSource& theSource,
+ const PSubMeshImpl& theSubMesh,
+ const vtkIdType theGeom)
{
- INITMSG(MYDEBUG,"GetCellsOnEntity"<<endl);
+ const VISU::TCell2Connect& anArray = theSubMesh->myCell2Connect;
+ vtkIdType aCellsSize = theSubMesh->myCellsSize;
+ vtkIdType aNbCells = theSubMesh->myNbCells;
+ INITMSG(MYDEBUG,"GetCellsOnSubMesh "<<
+ "- theGeom = "<<theGeom<<
+ "; aNbCells = "<<aNbCells<<
+ endl);
- vtkIdType aNbCells = theMeshOnEntity->myNbCells;
- vtkIdType aCellsSize = theMeshOnEntity->myCellsSize;
vtkCellArray* aConnectivity = vtkCellArray::New();
aConnectivity->Allocate(aCellsSize,0);
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
- VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
- for(vtkIdType i = 0, j = 0; anIter != aGeom2SubMesh.end(); anIter++){
- const vtkIdType& aGeom = anIter->first;
- const VISU::TSubMeshImpl& aSubMesh = anIter->second;
- const VISU::TCell2Connect& anArray = aSubMesh.myCell2Connect;
- INITMSG(MYDEBUG,"aGeom = "<<aGeom<<
- "; anArray.size() = "<<anArray.size()<<
- endl);
- for(vtkIdType k = 0, kEnd = anArray.size(); k < kEnd; k++, i++){
- PrintCells(i,aConnectivity,anArray[k]);
- aCellTypesArray->SetValue(j++,(unsigned char)aGeom);
- }
+ for(vtkIdType anID = 0; anID < aNbCells; anID++){
+ PrintCells(anID,aConnectivity,anArray[anID]);
+ aCellTypesArray->SetValue(anID,(unsigned char)theGeom);
}
+
vtkIdType *pts = 0, npts = 0;
vtkIntArray* aCellLocationsArray = vtkIntArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
if(theSubProfile->myIsVTKDone)
return;
- GetPoints(aSource,theMesh);
+ aSource->SetPoints(GetPoints(theMesh));
INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
GetCells(aSource,theSubProfile,theProfile,theMeshOnEntity);
BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
if(theProfile->myIsAll){
- const TVTKSource& aSource = theMeshOnEntity->GetSource();
- anAppendFilter->AddInput(aSource.GetPointer());
+ TDataSet* aDataSet = theMeshOnEntity->GetDataSet();
+ anAppendFilter->AddInput(aDataSet);
}else{
const TGeom2SubProfile& aGeom2SubProfile = theProfile->myGeom2SubProfile;
+ TSubProfileArr& aSubProfileArr = theProfile->mySubProfileArr;
+ aSubProfileArr.resize(aGeom2SubProfile.size());
TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
- for(; anIter != aGeom2SubProfile.end(); anIter++){
+ for(vtkIdType anID = 0; anIter != aGeom2SubProfile.end(); anIter++, anID++){
PSubProfileImpl aSubProfile = anIter->second;
if(aSubProfile->myStatus == eRemoveAll)
continue;
const TVTKSource& aSource = aSubProfile->GetSource();
anAppendFilter->AddInput(aSource.GetPointer());
+
+ aSubProfileArr[anID] = aSubProfile;
}
}
anAppendFilter->Update(); // Fix on VTK
//Cheching possibility do the query
TFindMeshOnEntity aFindMeshOnEntity =
FindMeshOnEntity(theMeshName,theEntity);
-
+
PMeshImpl aMesh = boost::get<0>(aFindMeshOnEntity);;
PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity);
-
+
//Main part of code
- const TVTKSource& aSource = aMeshOnEntity->GetSource();
+ const TVTKAppendFilter& anAppendFilter = aMeshOnEntity->GetFilter();
#ifndef _DEXCEPT_
try{
#endif
if(!aMeshOnEntity->myIsVTKDone){
- if(MYVTKDEBUG) aSource->DebugOn();
+ if(MYVTKDEBUG) anAppendFilter->DebugOn();
LoadMeshOnEntity(aMesh,aMeshOnEntity);
- GetPoints(aSource,aMesh);
- GetCellsOnEntity(aSource,aMeshOnEntity);
+
+ const TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
+ TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
+ TSubMeshArr& aSubMeshArr = aMeshOnEntity->mySubMeshArr;
+ aSubMeshArr.resize(aGeom2SubMesh.size());
+ for(vtkIdType anID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
+ const vtkIdType& aGeom = anIter->first;
+ PSubMeshImpl aSubMesh = anIter->second;
+ const TVTKSource& aSource = aSubMesh->GetSource();
+ aSource->SetPoints(GetPoints(aMesh));
+ GetCellsOnSubMesh(aSource,aSubMesh,aGeom);
+ anAppendFilter->AddInput(aSource.GetPointer());
+ aSubMeshArr[anID] = aSubMesh;
+ }
aMeshOnEntity->myIsVTKDone = true;
std::string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
std::string aFileName = string(getenv("HOME"))+"/"+getenv("USER")+"-";
aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-Conv.vtk";
- VISU::WriteToFile(aSource.GetPointer(),aFileName);
+ VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
}
if(MYVTKDEBUG){
GetMeshOnEntitySize(theMeshName,theEntity);
- PrintMemorySize(aSource.GetPointer());
+ PrintMemorySize(anAppendFilter->GetOutput());
}
#ifndef _DEXCEPT_
}
#endif
- return aSource.GetPointer();
+ return anAppendFilter->GetOutput();
}
GetMeshOnEntity(theMeshName,theEntity);
LoadFamilyOnEntity(aMesh,aMeshOnEntity,aFamily);
- GetPoints(aSource,aMesh);
+ aSource->SetPoints(GetPoints(aMesh));
GetCellsOnFamily(aSource,aMeshOnEntity,aFamily);
aFamily->myIsVTKDone = true;
vtkIdType aVGeom = aSubProfile->myGeom;
aGeom2SubProfile[aVGeom] = aSubProfile;
}
- {
- TSubProfileArr& aSubProfileArr = aProfile->mySubProfileArr;
- aSubProfileArr.resize(aGeom2SubProfile.size());
- TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
- for(TInt anID = 0; anIter != aGeom2SubProfile.end(); anIter++, anID++){
- const PSubProfileImpl& aSubProfile = anIter->second;
- aSubProfileArr[anID] = aSubProfile;
- }
- }
+
aProfileMap[aProfileKey] = aProfile;
theValForTime.myProfile = aProfile;
}
const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
TInt aSize = boost::get<1>(aFamilyTSize);
- if(aFamilyInfo->GetId() == 0)
+ TInt anId = aFamilyInfo->GetId();
+ if(anId == 0)
continue;
- TInt anId = aFamilyInfo->GetId();
std::string aFamilyName = aFamilyInfo->GetName();
PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin();
for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){
const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
- const std::string& aFamilyName = aFamilyInfo->GetName();
+ std::string aFamilyName = aFamilyInfo->GetName();
TEntity aVEntity = TEntity(-1);
PMEDFamily aFamily;
return TGaussPointID(aCellID,aLocalPntID);
}
+
+ //---------------------------------------------------------------
+ vtkIdType
+ TMEDSubMesh
+ ::GetElemObjID(vtkIdType theID) const
+ {
+ if(myIsElemNum)
+ return myElemNum[theID];
+ else
+ return TSubMeshImpl::GetElemObjID(theID);
+ }
+
+ vtkIdType
+ TMEDSubMesh
+ ::GetElemVTKID(vtkIdType theID) const
+ {
+ if(myIsElemNum){
+ MED::TElemNum::const_iterator anIter =
+ std::find(myElemNum.begin(),myElemNum.end(),theID);
+ if(anIter != myElemNum.end())
+ return *anIter;
+ else
+ return -1;
+ }else
+ return TSubMeshImpl::GetElemVTKID(theID);
+ }
+
}
aSubMesh->myIsElemNum = aNodeInfo->IsElemNum();
aSubMesh->myElemNum = aNodeInfo->myElemNum;
+ aSubMesh->myNbCells = theMesh->myNbPoints;
+ aSubMesh->myCellsSize = 2*theMesh->myNbPoints;
+ {
+ TSubMeshArr& aSubMeshArr = aMeshOnEntity->mySubMeshArr;
+ aSubMeshArr.resize(aGeom2SubMesh.size());
+ TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
+ for(TInt anID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
+ const PSubMeshImpl& aSubMesh = anIter->second;
+ aSubMeshArr[anID] = aSubMesh;
+ }
+ }
+
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for (int iElem = 0; iElem < aNbElem; iElem++)
aSubMesh->myIsElemNum = aPolygoneInfo->IsElemNum();
aSubMesh->myElemNum = aPolygoneInfo->myElemNum;
+ aSubMesh->myNbCells = aNbElem;
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for(TInt iElem = 0; iElem < aNbElem; iElem++) {
MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+ aSubMesh->myCellsSize += aNbConn;
TConnect& anArray = aCell2Connect[iElem];
anArray.resize(aNbConn);
for(TInt iConn = 0; iConn < aNbConn; iConn++)
aSubMesh->myIsElemNum = aPolyedreInfo->IsElemNum();
aSubMesh->myElemNum = aPolyedreInfo->myElemNum;
+ aSubMesh->myNbCells = aNbElem;
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for(TInt iFace = 0; iFace < aNbFaces; iFace++){
MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
TInt aNbConn = aConnSlice.size();
+ aSubMesh->myCellsSize += aNbConn;
for(TInt iConn = 0; iConn < aNbConn; iConn++){
aConnectSet.insert(aConnSlice[iConn]);
}
break;
}
default: {
- int aVNbNodes = VTKGeom2NbNodes(aVGeom);
+ TInt aVNbNodes = VTKGeom2NbNodes(aVGeom);
MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
TInt aNbElem = aCellInfo->GetNbElem();
aSubMesh->myIsElemNum = aCellInfo->IsElemNum();
aSubMesh->myElemNum = aCellInfo->myElemNum;
+ aSubMesh->myNbCells = aNbElem;
+ aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);