VTKViewer_AppendFilter::VTKViewer_AppendFilter()
{
- myDoMappingFlag=true;
+ myDoMappingFlag=false;//modified by NIZNHY-PKV Tue Aug 30 10:09:50 2005ft
}
VTKViewer_AppendFilter::~VTKViewer_AppendFilter()
myCellIds.clear();
myNodeRanges.clear();
myCellRanges.clear();
+ //modified by NIZNHY-PKV Tue Aug 30 10:09:35 2005f
+ myNodeMapObjIDVtkID.clear();
+ myCellMapObjIDVtkID.clear();
+ //modified by NIZNHY-PKV Tue Aug 30 10:09:39 2005t
}
void VTKViewer_AppendFilter::DoMapping()
{
- int i, j, i1, i2;
+ int i, j, i1, i2, iNodeCnt, iCellCnt;
+ IteratorOfDataMapOfIntegerInteger aMapIt;
vtkIdType aNbPnts, aNbCells, aId;
vtkDataSet *pDS;
//
Reset();
//
+ iNodeCnt=0;
+ iCellCnt=0;
for (i=0; i<NumberOfInputs; ++i) {
pDS=(vtkDataSet *)Inputs[i];
//
for(j=0; j<aNbPnts; ++j) {
aId=(vtkIdType)j;
myNodeIds.push_back(aId);
+ //
+ aMapIt=myNodeMapObjIDVtkID.find(aId);
+ if (aMapIt==myNodeMapObjIDVtkID.end()) {
+ // if not found
+ myNodeMapObjIDVtkID[aId]=iNodeCnt;
+ }
+ ++iNodeCnt;
}
//
// Cells
for(j=0; j<aNbCells; ++j) {
aId=(vtkIdType)j;
myCellIds.push_back(aId);
+ //
+ aMapIt=myCellMapObjIDVtkID.find(aId);
+ if (aMapIt==myCellMapObjIDVtkID.end()) {
+ // if not found
+ myCellMapObjIDVtkID[aId]=iCellCnt;
+ }
+ ++iCellCnt;
}
}
}
+//modified by NIZNHY-PKV Tue Aug 30 10:20:50 2005f
+int VTKViewer_AppendFilter::GetElemVtkID(int theObjID)
+{
+ int aVtkID=-1;
+ IteratorOfDataMapOfIntegerInteger aMapIt;
+ //
+ aMapIt=myCellMapObjIDVtkID.find(theObjID);
+ if (aMapIt!=myCellMapObjIDVtkID.end()) {
+ // found
+ PairOfDataMapOfIntegerInteger& aPair=(*aMapIt);
+ aVtkID=aPair.second;
+ }
+ return aVtkID;
+}
+
+int VTKViewer_AppendFilter::GetNodeVtkID(int theObjID)
+{
+ int aVtkID=-1;
+ IteratorOfDataMapOfIntegerInteger aMapIt;
+ //
+ aMapIt=myNodeMapObjIDVtkID.find(theObjID);
+ if (aMapIt!=myNodeMapObjIDVtkID.end()) {
+ // found
+ PairOfDataMapOfIntegerInteger& aPair=(*aMapIt);
+ aVtkID=aPair.second;
+ }
+ return aVtkID;
+}
+//modified by NIZNHY-PKV Tue Aug 30 10:20:54 2005t
int VTKViewer_AppendFilter::GetNodeObjId(int theVtkID,
int& theInputIndex)
#include <vtkAppendFilter.h>
#include <vector>
+//pkv f
+#include <map>
+using namespace std;
+//pkv t
+
/*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
*/
class VTKVIEWER_EXPORT VTKViewer_AppendFilter : public vtkAppendFilter
int GetNodeObjId(int theVtkID,
int& theInputIndex);
+
+ //pkv f
+ int GetElemVtkID(int theObjID);
+
+ int GetNodeVtkID(int theObjID);
+ //pkv t
//
protected:
/*! \fn VTKViewer_AppendFilter();
private:
typedef std::vector<vtkIdType> TVectorId;
typedef std::vector<int> VectorInt;
-
+ //pkv f
+ typedef std::map <int , int, less<int> > DataMapOfIntegerInteger;
+ typedef std::map < int, int, std::less<int> >::iterator IteratorOfDataMapOfIntegerInteger;
+ typedef std::map < int, int, std::less<int> >::value_type PairOfDataMapOfIntegerInteger;
+ //pkv t
private:
bool myDoMappingFlag;
TVectorId myNodeIds;
TVectorId myCellIds;
VectorInt myNodeRanges;
VectorInt myCellRanges;
-
+ //pkv f
+ DataMapOfIntegerInteger myNodeMapObjIDVtkID;
+ DataMapOfIntegerInteger myCellMapObjIDVtkID;
+ //pkv t
};
#endif