View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000793VTK(No Category)public2004-04-23 17:572011-01-13 17:00
ReporterMathieu Malaterre 
Assigned ToMathieu Malaterre 
PriorityurgentSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000793: vtkCutter + quadratic cells + invalid heap allocation size
DescriptionHi all,

I am getting a memory exception cutting quadratic hexes after rotating the plane widget for a few seconds.

There is some unusual behaviour in the following code :

void vtkQuadraticHexahedron::Subdivide(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId)
{
  …..
  //Copy point and cell attribute data
  this->PointData->CopyAllocate(inPd,27);

Each time the point data is copied, the number of arrays in the field increases by 1. So after cutting 32 hexes I get 34 arrays (only 2 of these are in the input data). This number keeps growing as the plane is moved.

I don’t think this is helping. Has anybody any suggestions for a solution?

The particular version of vtkQuadraticHexahedron is 1.21.

Apologies in advance if this has already been resolved.
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0000971)
Mathieu Malaterre (developer)
2004-04-23 17:58

PointData / CellData needs to be reset within the Subdivide call.

Patch:

Index: vtkQuadraticHexahedron.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Common/vtkQuadraticHexahedron.cxx,v
retrieving revision 1.23
diff -u -3 -p -r1.23 vtkQuadraticHexahedron.cxx
--- vtkQuadraticHexahedron.cxx 20 Feb 2004 20:13:32 -0000 1.23
+++ vtkQuadraticHexahedron.cxx 23 Apr 2004 21:55:19 -0000
@@ -127,7 +127,9 @@ void vtkQuadraticHexahedron::Subdivide(v
   double weights[20];
   double x[3];
  
- //Copy point and cell attribute data
+ //Copy point and cell attribute data, first make sure it's empty:
+ this->PointData->Initialize();
+ this->CellData->Initialize();
   this->PointData->CopyAllocate(inPd,27);
   this->CellData->CopyAllocate(inCd,8);
   for (i=0; i<20; i++)
Index: vtkQuadraticPyramid.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Common/vtkQuadraticPyramid.cxx,v
retrieving revision 1.11
diff -u -3 -p -r1.11 vtkQuadraticPyramid.cxx
--- vtkQuadraticPyramid.cxx 31 Mar 2004 14:56:39 -0000 1.11
+++ vtkQuadraticPyramid.cxx 23 Apr 2004 21:55:19 -0000
@@ -311,7 +311,9 @@ void vtkQuadraticPyramid::Subdivide(vtkP
   double weights[13];
   double x[3];
  
- //Copy point and cell attribute data
+ //Copy point and cell attribute data, first make sure it's empty:
+ this->PointData->Initialize();
+ this->CellData->Initialize();
   this->PointData->CopyAllocate(inPd,14);
   this->CellData->CopyAllocate(inCd,5);
   for (i=0; i<13; i++)
Index: vtkQuadraticQuad.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Common/vtkQuadraticQuad.cxx,v
retrieving revision 1.21
diff -u -3 -p -r1.21 vtkQuadraticQuad.cxx
--- vtkQuadraticQuad.cxx 17 Dec 2003 18:28:48 -0000 1.21
+++ vtkQuadraticQuad.cxx 23 Apr 2004 21:55:19 -0000
@@ -202,6 +202,9 @@ void vtkQuadraticQuad::InterpolateAttrib
                                              vtkIdType cellId,
                                              double *weights)
 {
+ //Copy point and cell attribute data, first make sure it's empty:
+ this->PointData->Initialize();
+ this->CellData->Initialize();
   this->PointData->CopyAllocate(inPd,9);
   this->CellData->CopyAllocate(inCd,4);
    
Index: vtkQuadraticWedge.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Common/vtkQuadraticWedge.cxx,v
retrieving revision 1.8
diff -u -3 -p -r1.8 vtkQuadraticWedge.cxx
--- vtkQuadraticWedge.cxx 20 Feb 2004 20:13:32 -0000 1.8
+++ vtkQuadraticWedge.cxx 23 Apr 2004 21:55:19 -0000
@@ -298,7 +298,9 @@ void vtkQuadraticWedge::Subdivide(vtkPoi
   double weights[15];
   double x[3];
  
- //Copy point and cell attribute data
+ //Copy point and cell attribute data, first make sure it's empty:
+ this->PointData->Initialize();
+ this->CellData->Initialize();
   this->PointData->CopyAllocate(inPd,18);
   this->CellData->CopyAllocate(inCd,6);
   for (i=0; i<15; i++)


Thanks to john platt for patch.

 Issue History
Date Modified Username Field Change
2010-11-29 17:59 Mathieu Malaterre Source_changeset_attached => VTK master 376c4084
2011-01-13 17:00 Source_changeset_attached => VTK master a2bd8391
2011-01-13 17:00 Source_changeset_attached => VTK master 020ef709
2011-06-16 13:11 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team