Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
04c85e54
Commit
04c85e54
authored
Aug 13, 2004
by
Ken Martin
Browse files
fix memory leak
parent
886bed71
Changes
16
Hide whitespace changes
Inline
Side-by-side
Filtering/vtkImplicitDataSet.cxx
View file @
04c85e54
...
...
@@ -16,10 +16,11 @@
#include "vtkCell.h"
#include "vtkDataSet.h"
#include "vtkGarbageCollector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
vtkCxxRevisionMacro
(
vtkImplicitDataSet
,
"1.2
3
"
);
vtkCxxRevisionMacro
(
vtkImplicitDataSet
,
"1.2
4
"
);
vtkStandardNewMacro
(
vtkImplicitDataSet
);
vtkCxxSetObjectMacro
(
vtkImplicitDataSet
,
DataSet
,
vtkDataSet
);
...
...
@@ -183,3 +184,27 @@ void vtkImplicitDataSet::PrintSelf(ostream& os, vtkIndent indent)
os
<<
indent
<<
"Data Set: (none)
\n
"
;
}
}
//----------------------------------------------------------------------------
void
vtkImplicitDataSet
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
// These filters share our input and are therefore involved in a
// reference loop.
collector
->
ReportReference
(
this
->
DataSet
,
"DataSet"
);
#endif
}
//----------------------------------------------------------------------------
void
vtkImplicitDataSet
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
DataSet
)
{
this
->
DataSet
->
Delete
();
this
->
DataSet
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Filtering/vtkImplicitDataSet.h
View file @
04c85e54
...
...
@@ -86,6 +86,9 @@ protected:
vtkImplicitDataSet
();
~
vtkImplicitDataSet
();
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
vtkDataSet
*
DataSet
;
double
OutValue
;
double
OutGradient
[
3
];
...
...
Filtering/vtkImplicitWindowFunction.cxx
View file @
04c85e54
...
...
@@ -13,9 +13,11 @@
=========================================================================*/
#include "vtkImplicitWindowFunction.h"
#include "vtkGarbageCollector.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkImplicitWindowFunction
,
"1.1
7
"
);
vtkCxxRevisionMacro
(
vtkImplicitWindowFunction
,
"1.1
8
"
);
vtkStandardNewMacro
(
vtkImplicitWindowFunction
);
vtkCxxSetObjectMacro
(
vtkImplicitWindowFunction
,
ImplicitFunction
,
vtkImplicitFunction
);
...
...
@@ -130,3 +132,28 @@ void vtkImplicitWindowFunction::PrintSelf(ostream& os, vtkIndent indent)
<<
", "
<<
this
->
WindowValues
[
1
]
<<
")
\n
"
;
}
//----------------------------------------------------------------------------
void
vtkImplicitWindowFunction
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
// These filters share our input and are therefore involved in a
// reference loop.
collector
->
ReportReference
(
this
->
ImplicitFunction
,
"ImplicitFunction"
);
#endif
}
//----------------------------------------------------------------------------
void
vtkImplicitWindowFunction
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
ImplicitFunction
)
{
this
->
ImplicitFunction
->
Delete
();
this
->
ImplicitFunction
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Filtering/vtkImplicitWindowFunction.h
View file @
04c85e54
...
...
@@ -78,6 +78,9 @@ protected:
vtkImplicitWindowFunction
();
~
vtkImplicitWindowFunction
();
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
vtkImplicitFunction
*
ImplicitFunction
;
double
WindowRange
[
2
];
double
WindowValues
[
2
];
...
...
Filtering/vtkScalarTree.cxx
View file @
04c85e54
...
...
@@ -15,9 +15,10 @@
#include "vtkScalarTree.h"
#include "vtkDataSet.h"
#include "vtkGarbageCollector.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkScalarTree
,
"1.
29
"
);
vtkCxxRevisionMacro
(
vtkScalarTree
,
"1.
30
"
);
vtkCxxSetObjectMacro
(
vtkScalarTree
,
DataSet
,
vtkDataSet
);
// Instantiate scalar tree with maximum level of 20 and branching
...
...
@@ -49,3 +50,24 @@ void vtkScalarTree::PrintSelf(ostream& os, vtkIndent indent)
os
<<
indent
<<
"Build Time: "
<<
this
->
BuildTime
.
GetMTime
()
<<
"
\n
"
;
}
//----------------------------------------------------------------------------
void
vtkScalarTree
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
collector
->
ReportReference
(
this
->
DataSet
,
"DataSet"
);
#endif
}
//----------------------------------------------------------------------------
void
vtkScalarTree
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
DataSet
)
{
this
->
DataSet
->
Delete
();
this
->
DataSet
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Filtering/vtkScalarTree.h
View file @
04c85e54
...
...
@@ -83,6 +83,9 @@ protected:
vtkTimeStamp
BuildTime
;
//time at which tree was built
double
ScalarValue
;
//current scalar value for traversal
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
private:
vtkScalarTree
(
const
vtkScalarTree
&
);
// Not implemented.
void
operator
=
(
const
vtkScalarTree
&
);
// Not implemented.
...
...
Imaging/vtkImageCacheFilter.cxx
View file @
04c85e54
...
...
@@ -19,7 +19,7 @@
#include "vtkPointData.h"
#include "vtkCachedStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro
(
vtkImageCacheFilter
,
"1.2
2
"
);
vtkCxxRevisionMacro
(
vtkImageCacheFilter
,
"1.2
3
"
);
vtkStandardNewMacro
(
vtkImageCacheFilter
);
//----------------------------------------------------------------------------
...
...
@@ -29,15 +29,19 @@ vtkImageCacheFilter::vtkImageCacheFilter()
this
->
Data
=
NULL
;
this
->
Times
=
NULL
;
vtkExecutive
*
exec
=
this
->
CreateDefaultExecutive
();
this
->
SetExecutive
(
exec
);
exec
->
Delete
();
this
->
SetCacheSize
(
10
);
this
->
SetExecutive
(
this
->
CreateDefaultExecutive
());
this
->
vtkSource
::
SetNthOutput
(
0
,
vtkImageData
::
New
());
}
//----------------------------------------------------------------------------
vtkImageCacheFilter
::~
vtkImageCacheFilter
()
{
#ifndef VTK_USE_EXECUTIVES
this
->
SetCacheSize
(
0
);
#endif
}
//----------------------------------------------------------------------------
...
...
@@ -128,7 +132,7 @@ void vtkImageCacheFilter::SetCacheSize(int size)
#ifdef VTK_USE_EXECUTIVES
//----------------------------------------------------------------------------
// This method simply copies by reference the input data to the output.
void
vtkImageCacheFilter
::
ExecuteData
(
vtkDataObject
*
outObject
)
void
vtkImageCacheFilter
::
ExecuteData
(
vtkDataObject
*
)
{
}
#else
...
...
Parallel/vtkMemoryLimitImageDataStreamer.cxx
View file @
04c85e54
...
...
@@ -24,7 +24,7 @@
#include "vtkPipelineSize.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro
(
vtkMemoryLimitImageDataStreamer
,
"1.
9
"
);
vtkCxxRevisionMacro
(
vtkMemoryLimitImageDataStreamer
,
"1.
10
"
);
vtkStandardNewMacro
(
vtkMemoryLimitImageDataStreamer
);
//----------------------------------------------------------------------------
...
...
@@ -200,6 +200,7 @@ int vtkMemoryLimitImageDataStreamer::ProcessUpstreamRequest(
// undo the last *2
this
->
NumberOfStreamDivisions
=
this
->
NumberOfStreamDivisions
/
2
;
sizer
->
Delete
();
}
return
this
->
Superclass
::
ProcessUpstreamRequest
(
request
,
...
...
Rendering/vtkEncodedGradientEstimator.cxx
View file @
04c85e54
...
...
@@ -14,14 +14,15 @@
=========================================================================*/
#include "vtkEncodedGradientEstimator.h"
#include "vtkGarbageCollector.h"
#include "vtkImageData.h"
#include "vtkMultiThreader.h"
#include "vtkRecursiveSphereDirectionEncoder.h"
#include "vtkTimerLog.h"
#include "vtkImageData.h"
#include <math.h>
vtkCxxRevisionMacro
(
vtkEncodedGradientEstimator
,
"1.3
4
"
);
vtkCxxRevisionMacro
(
vtkEncodedGradientEstimator
,
"1.3
5
"
);
vtkCxxSetObjectMacro
(
vtkEncodedGradientEstimator
,
Input
,
vtkImageData
);
...
...
@@ -368,3 +369,26 @@ void vtkEncodedGradientEstimator::PrintSelf(ostream& os, vtkIndent indent)
// << this->InputAspect << endl;
}
//----------------------------------------------------------------------------
void
vtkEncodedGradientEstimator
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
collector
->
ReportReference
(
this
->
Input
,
"Input"
);
#endif
}
//----------------------------------------------------------------------------
void
vtkEncodedGradientEstimator
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
Input
)
{
this
->
Input
->
Delete
();
this
->
Input
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Rendering/vtkEncodedGradientEstimator.h
View file @
04c85e54
...
...
@@ -169,6 +169,9 @@ protected:
vtkEncodedGradientEstimator
();
~
vtkEncodedGradientEstimator
();
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
// The number of threads to use when encoding normals
int
NumberOfThreads
;
...
...
Rendering/vtkVolumeMapper.cxx
View file @
04c85e54
...
...
@@ -14,11 +14,12 @@
=========================================================================*/
#include "vtkVolumeMapper.h"
#include "vtkGarbageCollector.h"
#include "vtkImageClip.h"
#include "vtkImageData.h"
#include "vtkDataSet.h"
vtkCxxRevisionMacro
(
vtkVolumeMapper
,
"1.5
2
"
);
vtkCxxRevisionMacro
(
vtkVolumeMapper
,
"1.5
3
"
);
// Construct a vtkVolumeMapper with empty scalar input and clipping off.
vtkVolumeMapper
::
vtkVolumeMapper
()
...
...
@@ -42,7 +43,11 @@ vtkVolumeMapper::vtkVolumeMapper()
vtkVolumeMapper
::~
vtkVolumeMapper
()
{
this
->
ImageClipper
->
Delete
();
if
(
this
->
ImageClipper
)
{
this
->
ImageClipper
->
Delete
();
this
->
ImageClipper
=
0
;
}
}
void
vtkVolumeMapper
::
ConvertCroppingRegionPlanesToVoxels
()
...
...
@@ -157,3 +162,29 @@ void vtkVolumeMapper::PrintSelf(ostream& os, vtkIndent indent)
<<
(
this
->
UseImageClipper
?
"On
\n
"
:
"Off
\n
"
);
}
//----------------------------------------------------------------------------
void
vtkVolumeMapper
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
// These filters share our input and are therefore involved in a
// reference loop.
if
(
this
->
UseImageClipper
)
{
collector
->
ReportReference
(
this
->
ImageClipper
,
"ImageClipper"
);
}
#endif
}
//----------------------------------------------------------------------------
void
vtkVolumeMapper
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
ImageClipper
)
{
this
->
ImageClipper
->
Delete
();
this
->
ImageClipper
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Rendering/vtkVolumeMapper.h
View file @
04c85e54
...
...
@@ -122,6 +122,9 @@ protected:
vtkVolumeMapper
();
~
vtkVolumeMapper
();
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
// Cropping variables, and a method for converting the world
// coordinate cropping region planes to voxel coordinates
int
Cropping
;
...
...
Rendering/vtkVolumeRayCastMapper.cxx
View file @
04c85e54
...
...
@@ -18,6 +18,7 @@
#include "vtkEncodedGradientEstimator.h"
#include "vtkEncodedGradientShader.h"
#include "vtkFiniteDifferenceGradientEstimator.h"
#include "vtkGarbageCollector.h"
#include "vtkGraphicsFactory.h"
#include "vtkImageData.h"
#include "vtkMath.h"
...
...
@@ -34,7 +35,7 @@
#include <math.h>
vtkCxxRevisionMacro
(
vtkVolumeRayCastMapper
,
"1.10
4
"
);
vtkCxxRevisionMacro
(
vtkVolumeRayCastMapper
,
"1.10
5
"
);
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
...
...
@@ -1994,3 +1995,26 @@ void vtkVolumeRayCastMapper::PrintSelf(ostream& os, vtkIndent indent)
}
//----------------------------------------------------------------------------
void
vtkVolumeRayCastMapper
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
// These filters share our input and are therefore involved in a
// reference loop.
collector
->
ReportReference
(
this
->
GradientEstimator
,
"GradientEstimator"
);
#endif
}
//----------------------------------------------------------------------------
void
vtkVolumeRayCastMapper
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
GradientEstimator
)
{
this
->
GradientEstimator
->
Delete
();
this
->
GradientEstimator
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Rendering/vtkVolumeRayCastMapper.h
View file @
04c85e54
...
...
@@ -189,6 +189,9 @@ protected:
vtkEncodedGradientEstimator
*
GradientEstimator
;
vtkEncodedGradientShader
*
GradientShader
;
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
// The distance between sample points along the ray
double
SampleDistance
;
double
ImageSampleDistance
;
...
...
Rendering/vtkVolumeTextureMapper.cxx
View file @
04c85e54
...
...
@@ -16,12 +16,13 @@
#include "vtkEncodedGradientShader.h"
#include "vtkFiniteDifferenceGradientEstimator.h"
#include "vtkGarbageCollector.h"
#include "vtkImageData.h"
#include "vtkRenderer.h"
#include "vtkVolume.h"
#include "vtkVolumeProperty.h"
vtkCxxRevisionMacro
(
vtkVolumeTextureMapper
,
"1.2
8
"
);
vtkCxxRevisionMacro
(
vtkVolumeTextureMapper
,
"1.2
9
"
);
vtkVolumeTextureMapper
::
vtkVolumeTextureMapper
()
{
...
...
@@ -262,3 +263,27 @@ void vtkVolumeTextureMapper::PrintSelf(ostream& os, vtkIndent indent)
// this->DataSpacing is a temporary variable that should not be printed
// this->DataOrigin is a temporary variable that should not be printed
}
//----------------------------------------------------------------------------
void
vtkVolumeTextureMapper
::
ReportReferences
(
vtkGarbageCollector
*
collector
)
{
this
->
Superclass
::
ReportReferences
(
collector
);
#ifdef VTK_USE_EXECUTIVES
// These filters share our input and are therefore involved in a
// reference loop.
collector
->
ReportReference
(
this
->
GradientEstimator
,
"GradientEstimator"
);
#endif
}
//----------------------------------------------------------------------------
void
vtkVolumeTextureMapper
::
RemoveReferences
()
{
#ifdef VTK_USE_EXECUTIVES
if
(
this
->
GradientEstimator
)
{
this
->
GradientEstimator
->
Delete
();
this
->
GradientEstimator
=
0
;
}
#endif
this
->
Superclass
::
RemoveReferences
();
}
Rendering/vtkVolumeTextureMapper.h
View file @
04c85e54
...
...
@@ -96,6 +96,9 @@ protected:
void
InitializeRender
(
vtkRenderer
*
ren
,
vtkVolume
*
vol
);
virtual
void
ReportReferences
(
vtkGarbageCollector
*
);
virtual
void
RemoveReferences
();
// Objects / variables needed for shading / gradient magnitude opacity
vtkEncodedGradientEstimator
*
GradientEstimator
;
vtkEncodedGradientShader
*
GradientShader
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment