- 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];
- //
- // Nodes
- if (!myPoints.GetPointer()) {
- aNbPnts=pDS->GetNumberOfPoints();
- i1=myNodeIds.size();
- i2=i1+aNbPnts-1;
- myNodeRanges.push_back(i1);
- myNodeRanges.push_back(i2);
- //
- 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
- aNbCells=pDS->GetNumberOfCells();
- i1=myCellIds.size();
- i2=i1+aNbCells-1;
- myCellRanges.push_back(i1);
- myCellRanges.push_back(i2);
- 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;
- }
+ inline
+ vtkIdType
+ GetOutputID(vtkIdType theInputID,
+ vtkIdType theInputDataSetID,
+ const VTKViewer_AppendFilter::TVectorIds& theRanges)
+ {
+ theInputID = theInputDataSetID = -1;
+
+ vtkIdType aNbInputs = theRanges.size();
+ if(theInputDataSetID < 0 || theInputDataSetID >= aNbInputs)
+ return -1;
+
+ vtkIdType aStartId = theRanges[theInputDataSetID];
+ return aStartId + theInputID;