VISU_Convertor::TOutput* aDataSet =
aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- VISU::PProfile aProfile = aCon->GetProfile(aMeshName,anEntity,aFieldName,aTimeStamp);
+
+ VISU::PIDMapper aPIDMapper =
+ aCon->GetTimeStampOnMeshIDMapper(aMeshName,anEntity,aFieldName,aTimeStamp);
int aNbCells = aDataSet->GetNumberOfCells();
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
- int anObjID = aProfile->GetElemObjID(anCellId);
- int aVTKID = aProfile->GetElemVTKID(anObjID);
+ int anObjID = aPIDMapper->GetElemObjID(anCellId);
+ int aVTKID = aPIDMapper->GetElemVTKID(anObjID);
cout<<anObjID<<"; "<<aVTKID<<endl;
}
- goto OK;
+ //goto OK;
if(anEntity != VISU::NODE_ENTITY)
aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
else
}
//Import mesh on entity
+ cout << "\n\n ** TEST GetMeshOnEntityIDMapper ***" << endl;
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- aCon->GetMeshOnEntity(aMeshName,anEntity);
+ VISU_Convertor::TOutput* aDataSet = aCon->GetMeshOnEntity(aMeshName,anEntity);
+ //pkv f
+ {
+ int aNbCells, anCellId, anObjID, aVTKID;
+ //
+ VISU::PIDMapper aPIDMapper=aCon->GetMeshOnEntityIDMapper(aMeshName,anEntity);
+ aNbCells = aDataSet->GetNumberOfCells();
+ for(anCellId = 0; anCellId < aNbCells; anCellId++){
+ anObjID = aPIDMapper->GetElemObjID(anCellId);
+ aVTKID = aPIDMapper->GetElemVTKID(anObjID);
+ cout<<anObjID<<"; "<<aVTKID<<endl;
+ }
+ }
+ //pkv t
}
//continue;
struct TProfile;
typedef SharedPtr<TProfile> PProfile;
-
+ //pkv f
+ struct TIDMapper;
+ typedef SharedPtr<TIDMapper> PIDMapper;
+ // pkv t
struct TMeshOnEntity;
typedef SharedPtr<TMeshOnEntity> PMeshOnEntity;
struct TSubProfile: virtual TBaseStructure
{};
+ //pkv f
+ //---------------------------------------------------------------
+ // TIDMapper
+ //
+ struct TIDMapper: virtual TBaseStructure
+ {
+ virtual
+ vtkIdType
+ GetNodeObjID(vtkIdType theID) const = 0;
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID) const = 0;
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID) = 0;
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID) const = 0;
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID) const = 0;
+ virtual
+ vtkCell*
+ GetElemCell(vtkIdType theObjID) = 0;
+ };
+ //pkv t
+
//---------------------------------------------------------------
- struct TProfile: virtual TBaseStructure
+ struct TProfile: virtual TBaseStructure, virtual TIDMapper
{
+ //pkv f
+ /*
virtual
vtkIdType
GetNodeObjID(vtkIdType theID) const = 0;
virtual
vtkCell*
GetElemCell(vtkIdType theObjID) = 0;
+ */
+ //pkv t
};
typedef std::map<TName,PFamily> TFamilyMap;
typedef std::map<TName,PField> TFieldMap;
- struct TMeshOnEntity: virtual TBaseStructure
+ struct TMeshOnEntity: virtual TBaseStructure,
+ virtual TIDMapper //pkv ft
{
TGaussMeshMap myGaussMeshMap;
TProfileMap myProfileMap;
//---------------------------------------------------------------
- struct TFamily: virtual TIntId
+ struct TFamily: virtual TIntId,
+ virtual TIDMapper //pkv ft
{
TEntity myEntity;
TName myName;
//---------------------------------------------------------------
typedef std::set<PFamily> TFamilySet;
- struct TGroup: virtual TBaseStructure
+ struct TGroup: virtual TBaseStructure,
+ virtual TIDMapper //pkv ft
{
TFamilySet myFamilySet;
};
int theStampsNum) = 0;
virtual
- VISU::PProfile
- GetProfile(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum) = 0;
+ //pkv f
+ //VISU::PProfile
+ VISU::PIDMapper
+ //pkv t
+ GetTimeStampOnMeshIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum) = 0;
+ //pkv f
+ virtual
+ VISU::PIDMapper
+ GetFamilyOnEntityIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
+
+ virtual
+ VISU::PIDMapper
+ GetMeshOnEntityIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity) = 0;
+
+ virtual
+ VISU::PIDMapper
+ GetMeshOnGroupIDMapper(const std::string& theMeshName,
+ const std::string& theGroupName)=0;
+ //pkv t
virtual
TOutput*
{
return myNamedPointCoords->GetObjID(theID);
}
-
+
vtkIdType
TProfileImpl
::GetNodeVTKID(vtkIdType theID) const
vtkIdType aVtkID = GetElemVTKID(theObjID);
return GetFilter()->GetOutput()->GetCell(aVtkID);
}
-
+
//---------------------------------------------------------------
TGaussSubMeshImpl::TGaussSubMeshImpl():
//---------------------------------------------------------------
vtkCell*
TFamilyImpl
- ::GetElemCell(int theObjID)
+ ::GetElemCell(/*int*/vtkIdType theObjID) //pkv ft
{
vtkIdType aVtkID = GetElemVTKID(theObjID);
return GetSource()->GetCell(aVtkID);
}
-
+ //---------------------------------------------------------------
vtkIdType
TFamilyImpl
::GetElemVTKID(vtkIdType theID) const
}
return -1;
}
-
+ //---------------------------------------------------------------
vtkIdType
TFamilyImpl
::GetElemObjID(vtkIdType theID) const
{
return myMeshID[theID];
}
-
-
+ //modified by NIZNHY-PKV Thu Sep 1 14:55:37 2005f
+ //---------------------------------------------------------------
+ vtkIdType TFamilyImpl::GetNodeObjID(vtkIdType theID) const
+ {
+ return theID;
+ }
+ //---------------------------------------------------------------
+ vtkIdType TFamilyImpl::GetNodeVTKID(vtkIdType theID) const
+ {
+ return theID;
+ }
+ //---------------------------------------------------------------
+ float* TFamilyImpl::GetNodeCoord(vtkIdType )//theObjID)
+ {
+ return NULL;
+ }
+ //modified by NIZNHY-PKV Thu Sep 1 14:55:51 2005t
//---------------------------------------------------------------
TNbASizeCells
TGroupImpl
}
return make_pair(aNbCells,aCellsSize);
}
-
+ //---------------------------------------------------------------
vtkCell*
TGroupImpl
- ::GetElemCell(int theObjID)
+ ::GetElemCell(/*int*/vtkIdType theObjID) //pkv ft
{
vtkIdType aVtkID = GetElemVTKID(theObjID);
return GetFilter()->GetOutput()->GetCell(aVtkID);
}
-
+ //---------------------------------------------------------------
vtkIdType
TGroupImpl
::GetElemVTKID(vtkIdType theID) const
}
return -1;
}
-
+ //---------------------------------------------------------------
vtkIdType
TGroupImpl
::GetElemObjID(vtkIdType theID) const
const PFamilyImpl& aFamily = myFamilyArr[anInputID];
return aFamily->GetElemObjID(anID);
}
-
+ //modified by NIZNHY-PKV Thu Sep 1 15:07:34 2005f
+ //---------------------------------------------------------------
+ vtkIdType TGroupImpl::GetNodeObjID(vtkIdType theID) const
+ {
+ return theID;
+ }
+ //---------------------------------------------------------------
+ vtkIdType TGroupImpl::GetNodeVTKID(vtkIdType theID) const
+ {
+ return theID;
+ }
+ //---------------------------------------------------------------
+ float* TGroupImpl::GetNodeCoord(vtkIdType )//theObjID)
+ {
+ return NULL;
+ }
+ //modified by NIZNHY-PKV Thu Sep 1 15:07:50 2005t
//---------------------------------------------------------------
void
//---------------------------------------------------------------
-VISU::PProfile
-VISU_Convertor_impl
-::GetProfile(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+//pkv f
+//VISU::PProfile
+VISU::PIDMapper
+//pkv t
+VISU_Convertor_impl::GetTimeStampOnMeshIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
PProfileImpl aProfile = aValForTime->myProfile;
return aProfile;
}
+//modified by NIZNHY-PKV Thu Sep 1 15:38:49 2005f
+//---------------------------------------------------------------
+VISU::PIDMapper
+VISU_Convertor_impl::
+GetMeshOnGroupIDMapper(const std::string& theMeshName,
+ const std::string& theGroupName)
+{
+ TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
+ PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
+ PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
+ return aGroup;
+}
+//---------------------------------------------------------------
+VISU::PIDMapper
+VISU_Convertor_impl::
+GetMeshOnEntityIDMapper(const string& theMeshName,
+ const VISU::TEntity& theEntity)
+{
+ TFindMeshOnEntity aFindMeshOnEntity =
+ FindMeshOnEntity(theMeshName,theEntity);
+
+ PMeshImpl aMesh = boost::get<0>(aFindMeshOnEntity);;
+ PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity);
+ return aMeshOnEntity;
+}
+//---------------------------------------------------------------
+VISU::PIDMapper
+VISU_Convertor_impl::
+GetFamilyOnEntityIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
+{
+ TFindFamilyOnEntity aFindFamilyOnEntity =
+ FindFamilyOnEntity(theMeshName,theEntity,theFamilyName);
-
+ PMeshImpl aMesh = boost::get<0>(aFindFamilyOnEntity);;
+ PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindFamilyOnEntity);
+ PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
+ return aFamily;
+}
+//modified by NIZNHY-PKV Thu Sep 1 15:38:54 2005t
//---------------------------------------------------------------
VISU_Convertor::TOutput*
VISU_Convertor_impl
{
TProfileImpl();
bool myIsAll;
-
+
virtual
vtkIdType
GetNodeObjID(vtkIdType theID) const;
virtual
vtkCell*
GetElemCell(vtkIdType theObjID);
-
+
TID2ID myElemObj2VTKID;
TSubProfileArr mySubProfileArr;
PNamedPointCoords myNamedPointCoords;
struct TFamilyImpl: virtual TFamily, virtual TSource
{
+ // pkv f
+ vtkIdType
+ GetNodeObjID(vtkIdType theID) const ;
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID) const ;
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID) ;
+ //pkv t
+
virtual
vtkCell*
- GetElemCell(int theObjID);
+ GetElemCell(/*int*/vtkIdType theObjID);//pkv ft
virtual
vtkIdType
virtual
vtkCell*
- GetElemCell(int theObjID);
+ GetElemCell(/*int*/vtkIdType theObjID);//pkv ft
virtual
vtkIdType
vtkIdType
GetElemObjID(vtkIdType theID) const;
+ //pkv f
+ virtual
+ vtkIdType
+ GetNodeObjID(vtkIdType theID) const;
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID) const;
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID);
+ //pkv t
+
TID2ID myElemObj2VTKID;
TFamilyArr myFamilyArr;
PNamedPointCoords myNamedPointCoords;
const std::string& theFieldName,
int theStampsNum);
virtual
- VISU::PProfile
- GetProfile(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ //pkv f
+ //VISU::PProfile
+ VISU::PIDMapper
+ //pkv t
+ GetTimeStampOnMeshIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
+ //pkv f
+ virtual
+ VISU::PIDMapper
+ GetFamilyOnEntityIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
+ virtual
+ VISU::PIDMapper
+ GetMeshOnEntityIDMapper(const std::string& theMeshName,
+ const VISU::TEntity& theEntity);
+ virtual
+ VISU::PIDMapper
+ GetMeshOnGroupIDMapper(const std::string& theMeshName,
+ const std::string& theGroupName);
+ //pkv t
virtual
TOutput*
{
return NULL;
}
-
-
+//modified by NIZNHY-PKV Thu Sep 1 16:16:05 2005f
+//=======================================================================
+//function : VISU_PipeLine::SetIdMapper
+//purpose :
+//=======================================================================
+void VISU_PipeLine::SetIDMapper(const VISU::PIDMapper& theIDMapper)
+{
+ myIDMapper=theIDMapper;
+}
+//=======================================================================
+//function : VISU_PipeLine::GetIDMapper
+//purpose :
+//=======================================================================
+const VISU::PIDMapper& VISU_PipeLine::GetIDMapper()const
+{
+ return myIDMapper;
+}
+//modified by NIZNHY-PKV Thu Sep 1 16:16:15 2005t
#include <vtkSmartPointer.h>
#include <vector>
-
//pkv f
-class vtkCell;
+#include <VISU_Convertor.hxx>
//pkv t
+
+class vtkCell;
template <class T>
class TVTKSmartPtr: public vtkSmartPointer<T>
{
vtkCell*
GetElemCell(vtkIdType theObjID);
+ void SetIDMapper(const VISU::PIDMapper& theIDMapper);
+
+ const VISU::PIDMapper& GetIDMapper()const;
+
protected:
VISU_PipeLine();
VISU_PipeLine(const VISU_PipeLine&);
// Clipping planes
TVTKSmartPtr<SALOME_ExtractGeometry> myExtractGeometry;
+ //
+ //pkv f
+ VISU::PIDMapper myIDMapper;
+ //pkv t
};
#endif
void VISU_ScalarMapPL::Init(){
//SetSourceRange();
}
-
+//modified by NIZNHY-PKV Thu Sep 1 16:25:25 2005f
+/*
void
VISU_ScalarMapPL
::SetProfile(const VISU::PProfile& theProfile)
{
return myProfile;
}
-
+*/
+//modified by NIZNHY-PKV Thu Sep 1 16:25:30 2005t
vtkIdType
VISU_ScalarMapPL
::GetNodeObjID(vtkIdType theID)
{
vtkIdType anID = VISU_PipeLine::GetNodeObjID(theID);
- return myProfile->GetNodeObjID(anID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:26:06 2005f
+ //return myProfile->GetNodeObjID(anID);
+ return myIDMapper->GetNodeObjID(anID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:26:09 2005t
}
vtkIdType
VISU_ScalarMapPL
::GetNodeVTKID(vtkIdType theID)
{
- return myProfile->GetNodeVTKID(theID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:26:32 2005f
+ //return myProfile->GetNodeVTKID(theID);
+ return myIDMapper->GetNodeVTKID(theID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:26:34 2005t
}
float*
VISU_ScalarMapPL
::GetNodeCoord(int theObjID)
{
- return GetProfile()->GetNodeCoord(theObjID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:27:21 2005f
+ //return GetProfile()->GetNodeCoord(theObjID);
+ return myIDMapper->GetNodeCoord(theObjID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:27:24 2005t
}
vtkIdType
::GetElemObjID(vtkIdType theID)
{
vtkIdType anID = VISU_PipeLine::GetElemObjID(theID);
- return myProfile->GetElemObjID(anID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:27:52 2005f
+ //return myProfile->GetElemObjID(anID);
+ return myIDMapper->GetElemObjID(anID);return myIDMapper->GetElemObjID(anID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:27:54 2005t
}
vtkIdType
VISU_ScalarMapPL
::GetElemVTKID(vtkIdType theID)
{
- return myProfile->GetElemVTKID(theID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:28:32 2005f
+ // return myProfile->GetElemVTKID(theID);
+ return myIDMapper->GetElemVTKID(theID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:28:35 2005t
}
vtkCell*
VISU_ScalarMapPL::
GetElemCell(vtkIdType theObjID)
{
- return GetProfile()->GetElemCell(theObjID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:28:53 2005f
+ // return GetProfile()->GetElemCell(theObjID);
+ return myIDMapper->GetElemCell(theObjID);
+ //modified by NIZNHY-PKV Thu Sep 1 16:28:59 2005t
}
#include "VISU_PipeLine.hxx"
#include "VISU_ScalarBarActor.hxx"
-#include <VISU_Convertor.hxx>
-
-class vtkDataSet;
//pkv f
-class vtkCell;
+//#include <VISU_Convertor.hxx>
//pkv t
+class vtkDataSet;
+class vtkCell;
class VISU_Extractor;
class VISU_FieldTransform;
virtual void GetSourceRange(float theRange[2]);
virtual void SetSourceRange();
+ //pkv f
+ /*
void
SetProfile(const VISU::PProfile& theProfile);
const VISU::PProfile&
GetProfile()const;
-
+ */
+ //pkv t
virtual
vtkIdType
GetNodeObjID(vtkIdType theID);
VISU_LookupTable *myMapperTable, *myBarTable;
VISU_FieldTransform *myFieldTransform;
VISU_Extractor* myExtractor;
- VISU::PProfile myProfile;
+ //VISU::PProfile myProfile;//pkv ft
};
#endif
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
myScalarMapPL->SetInput(anOutput);
//pkv f
- myScalarMapPL->SetProfile(theResult->GetInput()->GetProfile(myMeshName,myEntity,myFieldName,myIteration));
+ //myScalarMapPL->SetProfile(theResult->GetInput()->GetProfile(myMeshName,myEntity,myFieldName,myIteration));
+ myScalarMapPL->SetIDMapper(theResult->GetInput()-> // i.e. the VISU_Convertor
+ GetTimeStampOnMeshIDMapper(myMeshName,myEntity,myFieldName,myIteration));
//pkv t
myScalarMapPL->Build();
}