VISU_ConvertorUtils.hxx \
VISU_MergeFilter.hxx \
VISU_AppendFilter.hxx \
- VISU_ExtractUnstructuredGrid.hxx
+ VISU_ExtractUnstructuredGrid.hxx \
+ VISU_CommonCellsFilter.hxx
# Libraries targets
VISU_ExtractUnstructuredGrid.cxx \
VISU_MergeFilter.cxx \
VISU_AppendFilter.cxx \
- VISU_MedConvertor.cxx
+ VISU_MedConvertor.cxx \
+ VISU_CommonCellsFilter.cxx
# Executables targets
BIN = VISUConvertor
--- /dev/null
+// File : VISU_CommonCellsFilter.cxx
+// Created : Wed Apr 4 08:45:07 2007
+// Author : Eugeny NIKOLAEV (enk)
+// Copyright : Open CASCADE
+
+#include "VISU_CommonCellsFilter.hxx"
+
+// VTK product headers
+#include <vtkUnstructuredGrid.h>
+#include <vtkSetGet.h>
+#include <vtkObjectFactory.h>
+#include <vtkDataSet.h>
+#include <vtkCellTypes.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkIdList.h>
+#include <vtkFloatArray.h>
+#include <vtkCell.h>
+
+// STL
+#include <algorithm>
+#include <vector>
+#include <map>
+
+namespace
+{
+ typedef std::vector<int> TSortedArray;
+ typedef std::map<int,int> TId2IdMap;
+
+ inline
+ void
+ GetSortedArray(vtkIntArray *theArray,
+ TSortedArray& theSortedArray)
+ {
+ int aMaxId = theArray->GetMaxId();
+ int* aPointer = theArray->GetPointer(0);
+ int* anEndPointer = theArray->GetPointer(aMaxId + 1);
+ TSortedArray aSortedArray(aPointer, anEndPointer);
+ std::sort(aSortedArray.begin(), aSortedArray.end());
+ theSortedArray.swap(aSortedArray);
+ }
+
+ inline
+ void
+ GetIdsForCopy(vtkUnstructuredGrid *inputUGrid,
+ vtkIntArray* inputPointIds,
+ TSortedArray& outputSortedArray)
+ {
+ if(inputUGrid){
+ TSortedArray aSortedPointIds;
+ TSortedArray aOutputCellIds;
+ GetSortedArray(inputPointIds,aSortedPointIds);
+
+ int nbInputCells = inputUGrid->GetNumberOfCells();
+
+ TSortedArray aPointCellIds;
+ for(int idCell=0;idCell<nbInputCells;idCell++){
+ aPointCellIds.clear();
+ vtkCell* aCell = inputUGrid->GetCell(idCell);
+ vtkIdList* ptIds = aCell->GetPointIds();
+ int aMaxId = ptIds->GetNumberOfIds();
+ int* aPointer = ptIds->GetPointer(0);
+ int* anEndPointer = ptIds->GetPointer(aMaxId + 1);
+ TSortedArray aSortedArray(aPointer, anEndPointer);
+ std::sort(aSortedArray.begin(), aSortedArray.end());
+
+ int aMaxLength = std::max(aSortedArray.size(), aSortedPointIds.size());
+ TSortedArray anIntersectionArray(aMaxLength);
+ TSortedArray::iterator anArrayIter = anIntersectionArray.begin();
+ anArrayIter = std::set_intersection(aSortedArray.begin(),
+ aSortedArray.end(),
+ aSortedPointIds.begin(),
+ aSortedPointIds.end(),
+ anArrayIter);
+ anIntersectionArray.erase(anArrayIter, anIntersectionArray.end());
+ if(anIntersectionArray.size() == aSortedArray.size())
+ aOutputCellIds.push_back(idCell);
+ }
+
+ outputSortedArray.swap(aOutputCellIds);
+ }
+ }
+
+ inline
+ void
+ CopyElementsToOutput(vtkUnstructuredGrid* theInputUG,
+ int& theNbElements,
+ TSortedArray& theElementIdsForCopy,
+ TId2IdMap& theOldId2NewIdPointsMap,
+ vtkIntArray* theOuputIDSArray,
+ vtkUnstructuredGrid* theOutputUG)
+ {
+ vtkIntArray* aInputCellsMapper =
+ dynamic_cast<vtkIntArray*>(theInputUG->GetCellData()->GetArray("VISU_CELLS_MAPPER"));
+ int* aInputCellsMapperPointer = aInputCellsMapper->GetPointer(0);
+ for(int aCellIndex=0;aCellIndex<theNbElements;aCellIndex++){
+ int aCellId = theElementIdsForCopy[aCellIndex];
+ vtkIdList* aOldPointIds = theInputUG->GetCell(aCellId)->GetPointIds();
+ vtkIdList* aNewPointIds = vtkIdList::New();
+ int nbPointIds = aOldPointIds->GetNumberOfIds();
+ aNewPointIds->SetNumberOfIds(nbPointIds);
+ for(int j=0;j<nbPointIds;j++){
+ int aOldId = aOldPointIds->GetId(j);
+ int aNewId = theOldId2NewIdPointsMap[aOldId];
+ aNewPointIds->SetId(j,aNewId);
+ }
+ const int aOldCellId = theElementIdsForCopy[aCellIndex];
+ theOutputUG->InsertNextCell(theInputUG->GetCellType(aOldCellId),
+ aNewPointIds);
+ if(aInputCellsMapperPointer)
+ theOuputIDSArray->InsertNextValue(aInputCellsMapperPointer[aOldCellId]);
+ else
+ theOuputIDSArray->InsertNextValue(aOldCellId);
+
+ aNewPointIds->Delete();
+ }
+ }
+}
+
+vtkStandardNewMacro(VISU_CommonCellsFilter);
+
+VISU_CommonCellsFilter
+::VISU_CommonCellsFilter()
+{}
+
+VISU_CommonCellsFilter
+::~VISU_CommonCellsFilter()
+{}
+
+void
+VISU_CommonCellsFilter
+::SetProfileUG(vtkUnstructuredGrid *input)
+{
+ this->SetInput(input);
+}
+
+vtkUnstructuredGrid*
+VISU_CommonCellsFilter
+::GetProfileUG()
+{
+ return dynamic_cast<vtkUnstructuredGrid*>(this->GetInput());
+}
+
+void
+VISU_CommonCellsFilter
+::SetCellsUG(vtkUnstructuredGrid *input)
+{
+ this->vtkProcessObject::SetNthInput(1, input);
+}
+
+vtkUnstructuredGrid*
+VISU_CommonCellsFilter
+::GetCellsUG()
+{
+ if (this->NumberOfInputs < 2)
+ {
+ return NULL;
+ }
+ return dynamic_cast<vtkUnstructuredGrid*>(this->Inputs[1]);
+}
+
+void
+VISU_CommonCellsFilter
+::Execute()
+{
+ vtkUnstructuredGrid* anInputProfileUG = this->GetProfileUG();
+ vtkUnstructuredGrid* anInputCellsUG = this->GetCellsUG();
+
+ vtkUnstructuredGrid* anOutput = this->GetOutput();
+
+ if(anInputCellsUG == NULL){
+ anOutput->ShallowCopy(anInputProfileUG);
+ }
+ else{
+ // check if anInputProfileUG already have cells types not equal VTK_VERTEX
+ vtkCellTypes* aCellTypes = vtkCellTypes::New();
+
+ anInputProfileUG->GetCellTypes(aCellTypes);
+ if(aCellTypes){
+ if (aCellTypes->GetNumberOfTypes()!=1 )
+ anOutput->ShallowCopy(anInputProfileUG);
+ else{
+ if(aCellTypes->GetCellType(0) != VTK_VERTEX)
+ anOutput->DeepCopy(anInputProfileUG);
+ else{
+
+ vtkCellData* aInputCellData = anInputProfileUG->GetCellData();
+
+ //
+ // Calculate output points
+ //
+ vtkIdList* aPointIdsForCopy = vtkIdList::New();
+ vtkPoints* aOutputPointSet = vtkPoints::New();
+ TId2IdMap aOldId2NewIdPointsMap;
+
+ aOutputPointSet->Reset();
+
+ vtkIntArray* aPointIDS =
+ dynamic_cast<vtkIntArray*>(aInputCellData->GetArray("VISU_CELLS_MAPPER"));
+ if(aPointIDS){
+ aPointIdsForCopy->SetNumberOfIds(aPointIDS->GetNumberOfTuples());
+ for(int i=0;i<aPointIDS->GetNumberOfTuples();i++){
+ aPointIdsForCopy->SetId(i,aPointIDS->GetValue(i));
+ }
+ aOutputPointSet->SetNumberOfPoints(aPointIdsForCopy->GetNumberOfIds());
+ // aOutputPointSet copy points from anInputProfileUG to aOutputPointSet, which
+ // in aPointIdsForCopy ids list
+ anInputProfileUG->GetPoints()->GetPoints(aPointIdsForCopy,aOutputPointSet);
+ for(int i=0;i<aPointIdsForCopy->GetNumberOfIds();i++)
+ aOldId2NewIdPointsMap[aPointIdsForCopy->GetId(i)] = i;
+ anOutput->SetPoints(aOutputPointSet);
+ }
+ aOutputPointSet->Delete();
+ // applay scalar,vector,normal,tensor ... values
+ anOutput->GetPointData()->CopyFieldOff("VISU_CELLS_MAPPER");
+ anOutput->GetPointData()->CopyFieldOff("VISU_POINTS_MAPPER");
+ anOutput->GetPointData()->PassData(aInputCellData);
+ //anOutput->GetPointData()->GetArray("VISU_CELLS_MAPPER")->SetName("VISU_POINTS_MAPPER");
+
+ // apply VISU_POINTS_MAPPER
+ vtkIntArray* aNewPointsIdsArray = vtkIntArray::New();
+ aNewPointsIdsArray->SetName("VISU_POINTS_MAPPER");
+ aNewPointsIdsArray->SetNumberOfComponents(1);
+ aNewPointsIdsArray->SetNumberOfTuples(aPointIdsForCopy->GetNumberOfIds());
+ for(int i=0;i<aPointIdsForCopy->GetNumberOfIds();i++)
+ aNewPointsIdsArray->SetValue(i,aPointIdsForCopy->GetId(i));
+ anOutput->GetPointData()->AddArray(aNewPointsIdsArray);
+
+
+
+ aNewPointsIdsArray->Delete();
+
+
+ // Calculate output cells
+ int nbCells=0;
+
+ TSortedArray aCellIdsForCopy;
+
+ GetIdsForCopy(anInputCellsUG,aPointIDS,aCellIdsForCopy);
+ nbCells = aCellIdsForCopy.size();
+
+ // copy cells to output
+ int aAllocMem = nbCells;
+ anOutput->Allocate(aAllocMem);
+ vtkIntArray* theOuputIDSArray = vtkIntArray::New();
+ theOuputIDSArray->SetName("VISU_CELLS_MAPPER");
+ theOuputIDSArray->SetNumberOfComponents(1);
+ theOuputIDSArray->SetNumberOfTuples(aAllocMem);
+
+ if(nbCells>0 && anInputCellsUG)
+ CopyElementsToOutput(anInputCellsUG,
+ nbCells,
+ aCellIdsForCopy,
+ aOldId2NewIdPointsMap,
+ theOuputIDSArray,
+ anOutput);
+
+ anOutput->GetCellData()->AddArray(theOuputIDSArray);
+
+ theOuputIDSArray->Delete();
+ aPointIdsForCopy->Delete();
+ }
+ }
+
+ }
+ else
+ anOutput->ShallowCopy(anInputProfileUG);
+ }
+}
--- /dev/null
+// File : VISU_CommonCellsFilter.hxx
+// Created : Tue Apr 3 16:16:53 2007
+// Author : Eugeny NIKOLAEV (enk)
+// Copyright : Open CASCADE
+
+
+#ifndef VISU_CommonCellsFilter_HeaderFile
+#define VISU_CommonCellsFilter_HeaderFile
+
+#include <vtkUnstructuredGridToUnstructuredGridFilter.h>
+
+class VISU_CommonCellsFilter: public vtkUnstructuredGridToUnstructuredGridFilter
+{
+public:
+ static VISU_CommonCellsFilter *New();
+ vtkTypeMacro(VISU_CommonCellsFilter,vtkUnstructuredGridToUnstructuredGridFilter);
+
+ // Description:
+ // Specify the Unstructured Grid which overview
+ // nodal profile.
+ void SetProfileUG(vtkUnstructuredGrid *input);
+ vtkUnstructuredGrid* GetProfileUG();
+
+ // Description:
+ // Specify the Unstructured Grid which overview
+ // cells data on CELL_ENTITY.
+ void SetCellsUG(vtkUnstructuredGrid *input);
+ vtkUnstructuredGrid* GetCellsUG();
+
+protected:
+ VISU_CommonCellsFilter();
+ ~VISU_CommonCellsFilter();
+
+ void Execute(); //generate output data
+
+private:
+ VISU_CommonCellsFilter(const VISU_CommonCellsFilter&); // Lock copy
+ void operator=(const VISU_CommonCellsFilter&); // Lock copy
+};
+
+#endif
#include "VTKViewer_AppendFilter.h"
#include "VISU_MergeFilter.hxx"
#include "VTKViewer_CellLocationsArray.h"
+#include "VISU_CommonCellsFilter.hxx"
#include <vtkPoints.h>
#include <vtkUnstructuredGrid.h>
return myIDMapper->GetElemCell(theObjID);
}
+ //---------------------------------------------------------------
+ TIDCommonCellsFilter
+ ::TIDCommonCellsFilter():
+ myIsSpecialKey(false)
+ {}
+
+ const TVTKCommonCellsFilter&
+ TIDCommonCellsFilter
+ ::GetFilter() const
+ {
+ if(!myFilter.GetPointer()){
+ myFilter = VISU_CommonCellsFilter::New();
+ myFilter->Delete();
+ myMergeFilter = VISU_MergeFilter::New();
+ myMergeFilter->Delete();
+ }
+ return myFilter;
+ }
+
+ TVTKOutput*
+ TIDCommonCellsFilter
+ ::GetVTKOutput()
+ {
+ if(!myFilter.GetPointer()){
+ const TVTKAppendFilter& anAppendFilter = myIDMapper->GetFilter();
+ TVTKOutput* aGeometry;
+
+ const TVTKSource& aSource = mySource.GetSource();
+ TDataSet* aDataSet;
+ const TVTKCommonCellsFilter& aFilter = GetFilter();
+
+ if(myIsSpecialKey){
+ PNamedIDMapperMap::iterator aIter;
+ aIter = myMappers.find(VISU::CELL_ENTITY);
+ if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput());
+ else {
+ aIter = myMappers.find(VISU::FACE_ENTITY);
+ if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput());
+ else {
+ aIter = myMappers.find(VISU::EDGE_ENTITY);
+ if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput());
+ }
+ }
+ }
+
+ aGeometry = anAppendFilter->GetOutput();
+ aDataSet = aSource.GetPointer();
+ aDataSet->ShallowCopy(aGeometry);
+
+ myMergeFilter->SetGeometry(aGeometry);
+ myMergeFilter->SetScalars(aDataSet);
+ myMergeFilter->SetVectors(aDataSet);
+ myMergeFilter->AddField("VISU_FIELD",aDataSet);
+ myMergeFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
+ myMergeFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
+
+ aFilter->SetProfileUG(myMergeFilter->GetOutput());
+ }
+ return myFilter->GetOutput();
+ }
//---------------------------------------------------------------
void
TValForTimeImpl
::TValForTimeImpl():
myGaussPtsIDFilter(new TGaussPtsIDFilter()),
- myIDMapperFilter(new TIDMapperFilter())
+ myIDMapperFilter(new TIDCommonCellsFilter())
{}
const TMeshValue&
const VISU::PMeshOnEntityImpl& theMeshOnEntity,
const VISU::PFieldImpl& theField,
const VISU::PValForTimeImpl& theValForTime,
- const VISU::PIDMapperFilter& theIDMapperFilter,
+ const VISU::PIDCommonCellsFilter& theIDMapperFilter,
const VISU::PProfileImpl& theProfile,
const VISU::TEntity& theEntity)
{
TVTKOutput* anOutput = NULL;
+#ifndef _DEXCEPT_
try{
+#endif
+ // load points if theMeshOnEntity->myEntity == NODE_ENTITY
+ // load all coordinates itc.
+
LoadMeshOnEntity(theMesh,theMeshOnEntity);
GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity);
if(GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile)){
+
+ bool isNeedInCells = false;
theIDMapperFilter->myIDMapper = theProfile;
- anOutput = theIDMapperFilter->GetVTKOutput();
- const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
- ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+
+ if(theMeshOnEntity->myEntity == VISU::NODE_ENTITY){
+
+ // add geometry elements to output,
+ // if timestamp on NODE_ENTITY and
+ // on profiles with status eAddPart
+ TGeom2SubProfile::const_iterator anIter = theProfile->myGeom2SubProfile.begin();
+ for(; anIter != (theProfile->myGeom2SubProfile).end(); anIter++){
+ const EGeometry aGeom = anIter->first;
+ const PSubProfileImpl aSubProfile = anIter->second;
+ if(aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1){
+ isNeedInCells = true;
+ break;
+ }
+ }
+ if(isNeedInCells){
+ theIDMapperFilter->myIsSpecialKey = true;
+ GetTimeStampOnNodalProfile(theMesh,theIDMapperFilter,theField,theValForTime,theEntity);
+ anOutput = theIDMapperFilter->GetVTKOutput();
+ }
+ }
+
+ if(!isNeedInCells){
+ anOutput = theIDMapperFilter->GetVTKOutput();
+ const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
+ ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+ }
}
+#ifndef _DEXCEPT_
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
return NULL;
}
+#endif
return anOutput;
}
+void
+VISU_Convertor_impl
+::GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh,
+ const VISU::PIDCommonCellsFilter& theIDMapperFilter,
+ const VISU::PFieldImpl& theField,
+ const VISU::PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity)
+{
+ INITMSG(MYDEBUG,"GetTimeStampOnNodalProfile");
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_iterator aIter = aMeshOnEntityMap.begin();
+ for(;aIter!=aMeshOnEntityMap.end();aIter++){
+ VISU::TEntity aEntity = aIter->first;
+ if(aEntity != NODE_ENTITY){
+ VISU::PNamedIDMapper aMapper = GetMeshOnEntity(theMesh->myName,aEntity);
+ if(aMapper)
+ theIDMapperFilter->myMappers[aEntity] = aMapper;
+ }
+ }
+
+ theIDMapperFilter->GetVTKOutput();
+ const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
+ ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+
+}
//---------------------------------------------------------------
VISU::PIDMapper
PFieldImpl aField = boost::get<3>(aFindTimeStamp);
//Main part of code
- PIDMapperFilter anIDMapperFilter = aValForTime->myIDMapperFilter;
+ PIDCommonCellsFilter anIDMapperFilter = aValForTime->myIDMapperFilter;
#ifndef _DEXCEPT_
try{
#endif
VISU_Convertor_impl::TFindMeshOnEntity
VISU_Convertor_impl
::FindMeshOnEntity(const string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity,
+ bool checkExists)
{
+ PMeshOnEntityImpl aMeshOnEntity;
PMeshImpl aMesh = FindMesh(theMeshName);
VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(theEntity);
- if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
- EXCEPTION(runtime_error,"FindMeshOnEntity >> There is no mesh on the entity - "<<theEntity<<"!!!");
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()){
+ if(!checkExists){
+ EXCEPTION(runtime_error,"FindMeshOnEntity >> There is no mesh on the entity - "<<theEntity<<"!!!");
+ } else {
+ return TFindMeshOnEntity(aMesh,aMeshOnEntity);
+ }
+ }
- PMeshOnEntityImpl aMeshOnEntity = aMeshOnEntityMapIter->second;
+ aMeshOnEntity = aMeshOnEntityMapIter->second;
return TFindMeshOnEntity(aMesh,
aMeshOnEntity);
class vtkUnstructuredGrid;
class VTKViewer_AppendFilter;
class VISU_MergeFilter;
+class VISU_CommonCellsFilter;
#include "VISU_Convertor.hxx"
#include "MED_SliceArray.hxx"
typedef vtkSmartPointer<TDataSet> TVTKSource;
typedef vtkSmartPointer<vtkPoints> TVTKPoints;
typedef vtkSmartPointer<VISU_MergeFilter> TVTKMergeFilter;
+ typedef vtkSmartPointer<VISU_CommonCellsFilter> TVTKCommonCellsFilter;
typedef vtkSmartPointer<VTKViewer_AppendFilter> TVTKAppendFilter;
TVTKOutput*
GetVTKOutput();
};
- typedef SharedPtr<TAppendFilter> PAppendFilter;
+ typedef SharedPtr<TMergeFilter> PMergeFilter;
//---------------------------------------------------------------
};
typedef SharedPtr<TIDMapperFilter> PIDMapperFilter;
+ typedef std::map<VISU::TEntity,VISU::PNamedIDMapper> PNamedIDMapperMap;
+ //---------------------------------------------------------------
+ //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
+ struct TIDCommonCellsFilter: virtual TIDMapperFilter
+ {
+ protected:
+ mutable TVTKCommonCellsFilter myFilter;
+ mutable TVTKMergeFilter myMergeFilter;
+ public:
+
+ TIDCommonCellsFilter();
+
+ //! This method allow to create corresponding VTK filter by demand (not at once)
+ const TVTKCommonCellsFilter&
+ GetFilter() const;
+
+ //! if false, TIDCommonCellsFilter - same as TIDMapperFilter
+ //! if true, TIDCommonCellsFilter - use VISU_CommonCellsFilter
+ bool myIsSpecialKey;
+
+ //! Vector of id mappers, which consist of meshonentity in next sequence:
+ //! CELL_ENTITY,FACE_ENTITY,EDGE_ENTITY
+ PNamedIDMapperMap myMappers;
+ //! Reimplement the TIDMapperFilter::GetVTKOutput
+ virtual
+ TVTKOutput*
+ GetVTKOutput();
+ };
+ typedef SharedPtr<TIDCommonCellsFilter> PIDCommonCellsFilter;
+
//---------------------------------------------------------------
struct TGaussImpl;
typedef SharedPtr<TGaussImpl> PGaussImpl;
struct TValForTimeImpl: virtual TValForTime
{
PGaussPtsIDFilter myGaussPtsIDFilter; //!< Keep VTK representation for mesh and data on Gauss Points
- PIDMapperFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data
+ PIDCommonCellsFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data
TGeom2Value myGeom2Value; //!< Keep value that is assigned to the mesh
TGeom2NbGauss myGeom2NbGauss; //!< Keep number of Gauss Points
typedef boost::tuple<VISU::PMeshImpl,VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
TFindMeshOnEntity
FindMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity,
+ bool checkExists=false);
//! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name
typedef boost::tuple<VISU::PMeshImpl,VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
const VISU::PMeshOnEntityImpl& theMeshOnEntity,
const VISU::PFieldImpl& theField,
const VISU::PValForTimeImpl& theValForTime,
- const VISU::PIDMapperFilter& theIDMapperFilter,
+ const VISU::PIDCommonCellsFilter& theIDMapperFilter,
const VISU::PProfileImpl& theProfile,
const VISU::TEntity& theEntity);
+
+ void
+ GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh,
+ const VISU::PIDCommonCellsFilter& theIDMapperFilter,
+ const VISU::PFieldImpl& theField,
+ const VISU::PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity);
+
protected:
//! To fill intermeiate representation of TMeshOnEntity from a MED source
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- TInt aNbElem = theGrilleInfo->GetNbCells();
+ TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
aMeshOnEntity->myNbCells += aNbElem;
aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
TMEDSubProfile
::GetElemObjID(vtkIdType theID) const
{
- if(myIsElemNum)
- return myElemNum[theID];
- else
- return theID;
+ if(mySubMeshID.empty())
+ if(myIsElemNum)
+ return myElemNum[theID];
+ else
+ return theID;
+ return mySubMeshID[theID];
}
vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
- TInt aNbElem = aGrilleInfo->GetNbCells();
+ TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells();
if(aNbElem > 0){
PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());