#ifdef _DEBUG_
static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 1;
+static int MYDEBUGWITHFILES = 0;
#else
static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
#endif
-#define _DEXCEPT_
+//#define _DEXCEPT_
namespace VISU
{
{
vtkIdType anInputID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType aID = anAppendFilter->GetElemObjId(theID,anInputID);
+ vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID);
const TSubProfileImpl& aSubProfileImpl = mySubProfileArr[anInputID];
return aSubProfileImpl.GetElemObjID(aID);
}
if(myElemObj2VTKID.empty())
return theID;
else{
- TElemObj2VTKID::const_iterator anIter = myElemObj2VTKID.find(theID);
+ TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
if(anIter != myElemObj2VTKID.end())
return anIter->second;
}
TGaussPointID
TGaussMeshImpl
- ::GetObjID(int theVtkI) const
+ ::GetObjID(int theID) const
{
- TGaussPointID aRetVID;
- int aID, anIndexDS;
- vtkIdType aVID;//, aRetVID=-1;
- //
const TVTKAppendFilter& anAppendFilter = GetFilter();
- aID=anAppendFilter->GetElemObjId(theVtkI, anIndexDS);
- //
- const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anIndexDS];
- aVID=(vtkIdType)aID;
- aRetVID=aSubMeshImpl.GetObjID(aVID);
- return aRetVID;
+ vtkIdType anInputDataSetID;
+ vtkIdType anInputID = anAppendFilter->GetCellInputID(theID,anInputDataSetID);
+ const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anInputDataSetID];
+ return aSubMeshImpl.GetObjID(anInputID);
}
//---------------------------------------------------------------
- vtkIdType
- TSubMeshImpl
- ::GetElemVTKID(vtkIdType theID) const
- {
- return theID;
- }
-
vtkIdType
TSubMeshImpl
::GetElemObjID(vtkIdType theID) const
//---------------------------------------------------------------
+ vtkCell*
+ TMeshOnEntityImpl
+ ::GetElemCell(int theObjID)
+ {
+ vtkIdType aVtkID = GetElemVTKID(theObjID);
+ return GetFilter()->GetOutput()->GetCell(aVtkID);
+ }
+
vtkIdType
TMeshOnEntityImpl
::GetElemVTKID(vtkIdType theID) const
{
- return theID;
+ if(myElemObj2VTKID.empty())
+ return theID;
+ else{
+ TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
+ if(anIter != myElemObj2VTKID.end())
+ return anIter->second;
+ }
+ return -1;
}
vtkIdType
{
vtkIdType anInputID;
const TVTKAppendFilter& anAppendFilter = GetFilter();
- vtkIdType aID = anAppendFilter->GetElemObjId(theID,anInputID);
+ vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID);
const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID];
return aSubMesh->GetElemObjID(aID);
}
//---------------------------------------------------------------
void
GetCellsOnSubMesh(const TVTKSource& theSource,
+ const PMeshOnEntityImpl& theMeshOnEntity,
const PSubMeshImpl& theSubMesh,
const vtkIdType theGeom)
{
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
+ VISU::TID2ID& anElemObj2VTKID = theMeshOnEntity->myElemObj2VTKID;
for(vtkIdType anID = 0; anID < aNbCells; anID++){
PrintCells(anID,aConnectivity,anArray[anID]);
aCellTypesArray->SetValue(anID,(unsigned char)theGeom);
+ anElemObj2VTKID[theSubMesh->GetElemObjID(anID)] = anID;
}
vtkIdType *pts = 0, npts = 0;
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- VISU::TElemObj2VTKID& anElemObj2VTKID = theProfile->myElemObj2VTKID;
+ 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 TVTKSource& aSource = aSubProfile->GetSource();
anAppendFilter->AddInput(aSource.GetPointer());
- aSubProfileArr[anID] = aSubProfile;
+ aSubProfileArr[anID] = aSubProfile;
}
}
anAppendFilter->Update(); // Fix on VTK
+ theProfile->myNamedPointCoords = theMesh->myNamedPointCoords;
theProfile->myIsVTKDone = true;
}
PSubMeshImpl aSubMesh = anIter->second;
const TVTKSource& aSource = aSubMesh->GetSource();
aSource->SetPoints(GetPoints(aMesh));
- GetCellsOnSubMesh(aSource,aSubMesh,aGeom);
+ GetCellsOnSubMesh(aSource,aMeshOnEntity,aSubMesh,aGeom);
anAppendFilter->AddInput(aSource.GetPointer());
+
aSubMeshArr[anID] = aSubMesh;
}
+ aMeshOnEntity->myNamedPointCoords = aMesh->myNamedPointCoords;
aMeshOnEntity->myIsVTKDone = true;
#include <boost/tuple/tuple.hpp>
-
-
+class vtkCell;
class vtkPoints;
class VTKViewer_AppendFilter;
class vtkUnstructuredGrid;
-//pkv f
-class vtkCell;
-//pkv t
+
#include "VISU_Convertor.hxx"
#include "MED_SliceArray.hxx"
//---------------------------------------------------------------
- typedef std::map<vtkIdType,vtkIdType> TElemObj2VTKID;
+ typedef std::map<vtkIdType,vtkIdType> TID2ID;
typedef TVector<PSubProfileImpl> TSubProfileArr;
typedef std::map<vtkIdType,PSubProfileImpl> TGeom2SubProfile;
float*
GetNodeCoord(int theObjID);
- TElemObj2VTKID myElemObj2VTKID;
+ TID2ID myElemObj2VTKID;
+ TSubProfileArr mySubProfileArr;
PNamedPointCoords myNamedPointCoords;
- TSubProfileArr mySubProfileArr;
TGeom2SubProfile myGeom2SubProfile;
};
typedef SharedPtr<TProfileImpl> PProfileImpl;
struct TSubMeshImpl: virtual TSource
{
- TCell2Connect myCell2Connect;
-
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const;
-
virtual
vtkIdType
GetElemObjID(vtkIdType theID) const;
+
+ TCell2Connect myCell2Connect;
};
typedef SharedPtr<TSubMeshImpl> PSubMeshImpl;
struct TMeshOnEntityImpl: virtual TMeshOnEntity, virtual TAppendFilter, virtual TSizeCounter
{
+ virtual
+ vtkCell*
+ GetElemCell(int theObjID);
+
virtual
vtkIdType
GetElemVTKID(vtkIdType theID) const;
vtkIdType
GetElemObjID(vtkIdType theID) const;
+ TID2ID myElemObj2VTKID;
TSubMeshArr mySubMeshArr;
+ PNamedPointCoords myNamedPointCoords;
+
TGeom2SubMesh myGeom2SubMesh;
};
typedef SharedPtr<TMeshOnEntityImpl> PMeshOnEntityImpl;