MantisBT - VTK
View Issue Details
0004330VTK(No Category)public2007-01-17 18:002016-08-12 09:54
john platt 
Will Schroeder 
lowminoralways
closedmoved 
 
 
0004330: vtkBandedPolyDataContourFilter : VTK_SCALAR_MODE_VALUE is not honoured for verts & lines
vtkBandedPolyDataContourFilter

1. VTK_SCALAR_MODE_VALUE is not honoured for verts & lines.
2. outScalars not deleted if polydata contains only lines.


The following edits have been tested on version 4.2.

vtkBandedPolyDataContourFilter.cxx
----------------------------------

At about line 300, after

  outPD->SetScalars(outScalars);

insert

  outScalars->Delete();


At about line 330, replace

      for (i=0; i<npts; i++)
        {
        newVerts->InsertNextCell(1,pts+i);
        idx = this->ComputeScalarIndex(inScalars->GetTuple1(pts[i]));
        newScalars->InsertTuple1(cellId++,idx);
        }

by

      for (i=0; i<npts; i++)
        {
        cellId = this->InsertCell( newVerts, 1, pts+i, cellId, inScalars->GetTuple1( pts[i] ), newScalars );
        }


At about line 400, replace


      for (i=0; i<(npts-1); i++)
        {
        v = pts[i];
        vR = pts[i+1];

        newLines->InsertNextCell(2);

        newScalars->InsertTuple1(cellId++,
                    this->ComputeScalarIndex(outScalars->GetTuple1(v)));
        newLines->InsertCellPoint(v);

        if ( (intLoc=edgeTable->IsEdge(v,vR)) != -1 )
          {
          intList->GetCell(intLoc,numIntPts,intPts);
          if ( v < vR ) {intsIdx = 0; intsInc=1;} //order of the edge
          else {intsIdx=numIntPts-1; intsInc=(-1);}

          for ( ; intsIdx >= 0 && intsIdx < numIntPts; intsIdx += intsInc )
            {
            newLines->InsertCellPoint(intPts[intsIdx]);
            newLines->InsertNextCell(2);

            newScalars->InsertTuple1(cellId++, this->ComputeScalarIndex(
              outScalars->GetTuple1(intPts[intsIdx])));
            newLines->InsertCellPoint(intPts[intsIdx]);
            }
          }
        newLines->InsertCellPoint(vR);
        }
      }

by

      for (i=0; i<(npts-1); i++)
        {
        v = pts[i];
        vR = pts[i+1];

        vtkIdType newLineIds[2];
        newLineIds[0] = v;
        if ( (intLoc=edgeTable->IsEdge(v,vR)) != -1 )
          {
          intList->GetCell(intLoc,numIntPts,intPts);
          if ( v < vR ) {intsIdx = 0; intsInc=1;} //order of the edge
          else {intsIdx=numIntPts-1; intsInc=(-1);}

          for ( ; intsIdx >= 0 && intsIdx < numIntPts; intsIdx += intsInc )
            {
            newLineIds[1] = intPts[ intsIdx ];
            cellId = this->InsertCell( newLines, 2, newLineIds, cellId,
                                       outScalars->GetTuple1( newLineIds[0] ), newScalars );
            newLineIds[0] = newLineIds[1];
            }
          }
        newLineIds[1] = vR;
        cellId = this->InsertCell( newLines, 2, newLineIds, cellId,
                                   outScalars->GetTuple1( newLineIds[0] ), newScalars );
        }



At about line 800, delete

    outScalars->Delete();
No tags attached.
Issue History
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036899
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0036899)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.