VISU::TValField::const_iterator aValFieldIter = aValField.begin();
for(; aValFieldIter != aValField.end(); aValFieldIter++){
int aTimeStamp = aValFieldIter->first;
+
+ VISU_Convertor::TOutput* aDataSet =
+ aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ VISU::PProfile aProfile = aCon->GetProfile(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);
+ cout<<anObjID<<"; "<<aVTKID<<endl;
+ }
+
+ goto OK;
if(anEntity != VISU::NODE_ENTITY)
aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
else
aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- //goto OK;
}
}
}
}
}
+ OK:
MSG(MYDEBUG,"OK");
#ifndef _DEXCEPT_
}catch(std::exception& exc){
{
virtual
vtkIdType
- GetNodeObjID(int theVtkI) const = 0;
+ GetNodeObjID(vtkIdType theID) const = 0;
virtual
vtkIdType
- GetElemObjID(int theVtkI) const = 0;
+ GetNodeVTKID(vtkIdType theID) const = 0;
virtual
- vtkCell*
- GetElemCell(int theObjID) = 0;
+ float*
+ GetNodeCoord(vtkIdType theObjID) = 0;
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID) const = 0;
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID) const = 0;
virtual
- float*
- GetNodeCoord(int theObjID) = 0;
+ vtkCell*
+ GetElemCell(vtkIdType theObjID) = 0;
};
//---------------------------------------------------------------
TProfileImpl::TProfileImpl():
- myIsAll(true)
+ myIsAll(true),
+ myMeshOnEntity(NULL)
{}
vtkIdType
return myNamedPointCoords->GetObjID(theID);
}
+ vtkIdType
+ TProfileImpl
+ ::GetNodeVTKID(vtkIdType theID) const
+ {
+ return myNamedPointCoords->GetVTKID(theID);
+ }
+
+ float*
+ TProfileImpl
+ ::GetNodeCoord(vtkIdType theObjID)
+ {
+ if(myMeshOnEntity)
+ return myMeshOnEntity->GetNodeCoord(theObjID);
+
+ vtkIdType aVtkID = GetNodeVTKID(theObjID);
+ return GetFilter()->GetOutput()->GetPoint(aVtkID);
+ }
+
vtkIdType
TProfileImpl
::GetElemObjID(vtkIdType theID) const
{
+ if(myMeshOnEntity)
+ return myMeshOnEntity->GetElemObjID(theID);
+
vtkIdType anInputID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID);
TProfileImpl
::GetElemVTKID(vtkIdType theID) const
{
+ if(myMeshOnEntity)
+ return myMeshOnEntity->GetElemVTKID(theID);
+
if(myElemObj2VTKID.empty())
return theID;
else{
return -1;
}
- vtkIdType
- TProfileImpl
- ::GetNodeVTKID(vtkIdType theID) const
- {
- return myNamedPointCoords->GetVTKID(theID);
- }
-
vtkCell*
TProfileImpl
- ::GetElemCell(int theObjID)
+ ::GetElemCell(vtkIdType theObjID)
{
+ if(myMeshOnEntity)
+ return myMeshOnEntity->GetElemCell(theObjID);
+
vtkIdType aVtkID = GetElemVTKID(theObjID);
return GetFilter()->GetOutput()->GetCell(aVtkID);
}
- float*
- TProfileImpl
- ::GetNodeCoord(int theObjID)
- {
- vtkIdType aVtkID = GetNodeVTKID(theObjID);
- return GetFilter()->GetOutput()->GetPoint(aVtkID);
- }
-
//---------------------------------------------------------------
TGaussSubMeshImpl::TGaussSubMeshImpl():
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- VISU::TID2ID& anElemObj2VTKID = theProfile->myElemObj2VTKID;
if(theSubProfile->myStatus == eAddAll){
VISU::TCell2Connect::const_iterator anIter = aCell2Connect.begin();
for(vtkIdType anId = 0, aConnId = 0; anIter != aCell2Connect.end(); anIter++){
const TConnect& anArray = aCell2Connect[anId];
PrintCells(aConnId,aConnectivity,anArray);
aCellTypesArray->SetValue(anId,(unsigned char)aGeom);
-
- anElemObj2VTKID[theSubProfile->GetElemObjID(anId)] = anId;
-
aConnId += aNbNodes;
anId++;
}
const TConnect& anArray = aCell2Connect[aSubId];
PrintCells(aConnId,aConnectivity,anArray);
aCellTypesArray->SetValue(anId,(unsigned char)aGeom);
-
- anElemObj2VTKID[theSubProfile->GetElemObjID(anId)] = anId;
-
aConnId += aNbNodes;
anId++;
}
if(theProfile->myIsAll){
TDataSet* aDataSet = theMeshOnEntity->GetDataSet();
anAppendFilter->AddInput(aDataSet);
+ theProfile->myMeshOnEntity = theMeshOnEntity.get();
}else{
const TGeom2SubProfile& aGeom2SubProfile = theProfile->myGeom2SubProfile;
+
+ TID2ID& anElemObj2VTKID = theProfile->myElemObj2VTKID;
+
TSubProfileArr& aSubProfileArr = theProfile->mySubProfileArr;
aSubProfileArr.resize(aGeom2SubProfile.size());
+
TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
- for(vtkIdType anID = 0; anIter != aGeom2SubProfile.end(); anIter++){
+ for(vtkIdType anInputID = 0, aCellID = 0; anIter != aGeom2SubProfile.end(); anIter++){
PSubProfileImpl aSubProfile = anIter->second;
if(aSubProfile->myStatus == eRemoveAll)
continue;
const TVTKSource& aSource = aSubProfile->GetSource();
anAppendFilter->AddInput(aSource.GetPointer());
- aSubProfileArr[anID++] = aSubProfile;
+ vtkIdType aNbCells = aSource->GetNumberOfCells();
+ for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+ anElemObj2VTKID[aSubProfile->GetElemObjID(aCell)] = aCellID;
+ }
+
+ aSubProfileArr[anInputID++] = aSubProfile;
}
}
anAppendFilter->Update(); // Fix on VTK
//---------------------------------------------------------------
+ struct TMeshOnEntityImpl;
+
typedef std::map<vtkIdType,vtkIdType> TID2ID;
typedef TVector<PSubProfileImpl> TSubProfileArr;
typedef std::map<vtkIdType,PSubProfileImpl> TGeom2SubProfile;
virtual
vtkIdType
- GetNodeObjID(int theVtkI) const;
+ GetNodeObjID(vtkIdType theID) const;
virtual
vtkIdType
- GetElemObjID(int theVtkI) const;
+ GetNodeVTKID(vtkIdType theID) const;
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID);
virtual
vtkIdType
- GetElemVTKID(int theID) const;
+ GetElemObjID(vtkIdType theID) const;
virtual
vtkIdType
- GetNodeVTKID(int theID) const;
+ GetElemVTKID(vtkIdType theID) const;
virtual
vtkCell*
- GetElemCell(int theObjID);
-
- virtual
- float*
- GetNodeCoord(int theObjID);
+ GetElemCell(vtkIdType theObjID);
TID2ID myElemObj2VTKID;
TSubProfileArr mySubProfileArr;
PNamedPointCoords myNamedPointCoords;
+ TMeshOnEntityImpl* myMeshOnEntity;
TGeom2SubProfile myGeom2SubProfile;
};
}
//----------------------------------------------------------------------------
-int VISU_Actor::GetNodeObjId(int theVtkID){
- vtkIdType aID;
- //
- aID=myGeomFilter->GetNodeObjId(theVtkID);
- if (myIsShrunk) {
- aID= myShrinkFilter->GetNodeObjId(aID);
- }
- if (myPipeLine) {
- aID=myPipeLine->GetNodeObjID(aID);
- }
- return aID;
+vtkIdType
+VISU_Actor
+::GetNodeObjId(vtkIdType theID)
+{
+ vtkIdType anID = myGeomFilter->GetNodeObjId(theID);
+
+ if(myIsShrunk)
+ anID = myShrinkFilter->GetNodeObjId(anID);
+
+ return myPipeLine->GetNodeObjID(anID);
}
-//----------------------------------------------------------------------------
-int VISU_Actor::GetElemObjId(int theVtkID){
- vtkIdType aID;
- //
- aID=myGeomFilter->GetElemObjId(theVtkID);
- if (myIsShrunk) {
- aID= myShrinkFilter->GetElemObjId(aID);
- }
- if (myPipeLine) {
- aID=myPipeLine->GetElemObjID(aID);
- }
- return aID;
+vtkIdType
+VISU_Actor
+::GetNodeVTKID(vtkIdType theID)
+{
+ return myPipeLine->GetNodeVTKID(theID);
}
-//modified by NIZNHY-PKV Tue Aug 30 12:46:15 2005f
-//----------------------------------------------------------------------------
-vtkCell* VISU_Actor::GetElemCell(int theObjID)
+
+float*
+VISU_Actor
+::GetNodeCoord(int theObjID)
{
- return myPipeLine->GetElemCell(theObjID);
+ return myPipeLine->GetNodeCoord(theObjID);
}
+
+
//----------------------------------------------------------------------------
-float* VISU_Actor::GetNodeCoord(int theObjID)
+vtkIdType
+VISU_Actor
+::GetElemObjId(vtkIdType theID)
{
- return myPipeLine->GetNodeCoord(theObjID);
+ vtkIdType anID = myGeomFilter->GetElemObjId(theID);
+
+ if(myIsShrunk)
+ anID = myShrinkFilter->GetElemObjId(anID);
+
+ return myPipeLine->GetElemObjID(anID);
+}
+
+vtkIdType
+VISU_Actor
+::GetElemVTKID(vtkIdType theID)
+{
+ return myPipeLine->GetElemVTKID(theID);
+}
+
+vtkCell*
+VISU_Actor
+::GetElemCell(vtkIdType theObjID)
+{
+ return myPipeLine->GetElemCell(theObjID);
}
-//modified by NIZNHY-PKV Tue Aug 30 12:46:19 2005t
virtual void SetLineWidth(float theLineWidth);
virtual float GetLineWidth();
- virtual int GetNodeObjId(int theVtkID);
- virtual int GetElemObjId(int theVtkID);
- //pkv f
- virtual vtkCell* GetElemCell(int theObjID);
- virtual float* GetNodeCoord(int theObjID);
- //pkv t
+ virtual
+ vtkIdType
+ GetNodeObjId(vtkIdType theID);
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID);
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID);
+
+ virtual
+ vtkIdType
+ GetElemObjId(vtkIdType theID);
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID);
+
+ virtual
+ vtkCell*
+ GetElemCell(vtkIdType theObjID);
+
protected:
VISU_Actor();
return false;
}
-vtkIdType VISU_PipeLine::GetNodeObjID(vtkIdType theVtkID)
+vtkIdType
+VISU_PipeLine
+::GetNodeObjID(vtkIdType theID)
{
- return myExtractGeometry->GetNodeObjId(theVtkID);
+ return myExtractGeometry->GetNodeObjId(theID);
}
-vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theVtkID)
+vtkIdType
+VISU_PipeLine
+::GetNodeVTKID(vtkIdType theID)
{
- return myExtractGeometry->GetElemObjId(theVtkID);
+ return -1;
}
-//modified by NIZNHY-PKV Tue Aug 30 12:53:58 2005f
-vtkCell* VISU_PipeLine::GetElemCell(int )
+
+float*
+VISU_PipeLine
+::GetNodeCoord(int )
{
return NULL;
}
-float* VISU_PipeLine::GetNodeCoord(int )
+vtkIdType
+VISU_PipeLine
+::GetElemObjID(vtkIdType theID)
+{
+ return myExtractGeometry->GetElemObjId(theID);
+}
+
+vtkIdType
+VISU_PipeLine
+::GetElemVTKID(vtkIdType theID)
+{
+ return -1;
+}
+
+vtkCell*
+VISU_PipeLine
+::GetElemCell(int )
{
return NULL;
}
-//modified by NIZNHY-PKV Tue Aug 30 12:54:01 2005t
+
+
bool IsShrinkable() { return myIsShrinkable; }
- virtual vtkIdType GetNodeObjID(vtkIdType theVtkID);
- virtual vtkIdType GetElemObjID(vtkIdType theVtkID);
- //pkv f
- virtual vtkCell* GetElemCell(int theObjID);
- virtual float* GetNodeCoord(int theObjID);
- //pkv t
+ virtual
+ vtkIdType
+ GetNodeObjID(vtkIdType theID);
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID);
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID);
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID);
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID);
+
+ virtual
+ vtkCell*
+ GetElemCell(vtkIdType theObjID);
+
protected:
VISU_PipeLine();
VISU_PipeLine(const VISU_PipeLine&);
//SetSourceRange();
}
-void VISU_ScalarMapPL::SetProfile(const VISU::PProfile& theProfile)
+void
+VISU_ScalarMapPL
+::SetProfile(const VISU::PProfile& theProfile)
{
myProfile=theProfile;
}
-const VISU::PProfile& VISU_ScalarMapPL::GetProfile()const
+
+const VISU::PProfile&
+VISU_ScalarMapPL
+::GetProfile() const
{
return myProfile;
}
-vtkIdType VISU_ScalarMapPL::GetNodeObjID(vtkIdType theVtkID)
+vtkIdType
+VISU_ScalarMapPL
+::GetNodeObjID(vtkIdType theID)
{
- vtkIdType aIDx=-1;
- //
- if (!myProfile){
- return aIDx;
- }
- aIDx=VISU_PipeLine::GetNodeObjID(theVtkID);
- aIDx=myProfile->GetNodeObjID(aIDx);
- return aIDx;
+ vtkIdType anID = VISU_PipeLine::GetNodeObjID(theID);
+ return myProfile->GetNodeObjID(anID);
}
-vtkIdType VISU_ScalarMapPL::GetElemObjID(vtkIdType theVtkID)
+vtkIdType
+VISU_ScalarMapPL
+::GetNodeVTKID(vtkIdType theID)
{
- vtkIdType aIDx=-1;
- //
- if (!myProfile){
- return aIDx;
- }
- aIDx=VISU_PipeLine::GetElemObjID(theVtkID);
- aIDx=myProfile->GetElemObjID(aIDx);
- return aIDx;
+ return myProfile->GetNodeVTKID(theID);
}
-//modified by NIZNHY-PKV Tue Aug 30 12:13:53 2005f
-vtkCell* VISU_ScalarMapPL::GetElemCell(int theObjID)
+
+float*
+VISU_ScalarMapPL
+::GetNodeCoord(int theObjID)
{
- return GetProfile()->GetElemCell(theObjID);
+ return GetProfile()->GetNodeCoord(theObjID);
}
-float* VISU_ScalarMapPL::GetNodeCoord(int theObjID)
+
+vtkIdType
+VISU_ScalarMapPL
+::GetElemObjID(vtkIdType theID)
{
- return GetProfile()->GetNodeCoord(theObjID);
+ vtkIdType anID = VISU_PipeLine::GetElemObjID(theID);
+ return myProfile->GetElemObjID(anID);
+}
+
+vtkIdType
+VISU_ScalarMapPL
+::GetElemVTKID(vtkIdType theID)
+{
+ return myProfile->GetElemVTKID(theID);
+}
+
+vtkCell*
+VISU_ScalarMapPL::
+GetElemCell(vtkIdType theObjID)
+{
+ return GetProfile()->GetElemCell(theObjID);
}
-//modified by NIZNHY-PKV Tue Aug 30 12:13:55 2005t
void VISU_ScalarMapPL::Build() {
virtual void GetSourceRange(float theRange[2]);
virtual void SetSourceRange();
- virtual vtkIdType GetNodeObjID(vtkIdType theVtkID);
- virtual vtkIdType GetElemObjID(vtkIdType theVtkID);
-
- void SetProfile(const VISU::PProfile& theProfile);
- const VISU::PProfile& GetProfile()const;
- //pkv f
- vtkCell* GetElemCell(int theObjID);
- float* GetNodeCoord(int theObjID);
- //pkv t
+ void
+ SetProfile(const VISU::PProfile& theProfile);
+
+ const VISU::PProfile&
+ GetProfile()const;
+
+ virtual
+ vtkIdType
+ GetNodeObjID(vtkIdType theID);
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID);
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID);
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID);
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID);
+
+ virtual
+ vtkCell*
+ GetElemCell(vtkIdType theObjID);
+
protected:
typedef vtkDataSet THook;
virtual THook* DoHook();