From: apo Date: Thu, 18 Jan 2007 08:03:02 +0000 (+0000) Subject: To improve memory size calculation X-Git-Tag: WP1_2_3_19-02-2007_Bug_fixing~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=953ef7e82ce934128da2acbe15bb8f6ed4328d35;p=modules%2Fvisu.git To improve memory size calculation --- diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index e96225c5..2a6f8a51 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -220,7 +220,7 @@ unsigned long int VISU_ColoredPL ::GetMemorySize() { - unsigned long int aSize = 0; + unsigned long int aSize = Superclass::GetMemorySize(); if(vtkDataSet* aDataSet = myExtractor->GetInput()) aSize = aDataSet->GetActualMemorySize() * 1024; @@ -228,8 +228,6 @@ VISU_ColoredPL if(vtkDataSet* aDataSet = myFieldTransform->GetInput()) aSize += aDataSet->GetActualMemorySize() * 1024; - aSize += Superclass::GetMemorySize(); - return aSize; } diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 80e3a329..ea2b5647 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -152,16 +152,15 @@ unsigned long int VISU_CutPlanesPL ::GetMemorySize() { - vtkDataSet* aDataSet = myAppendPolyData->GetOutput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; + unsigned long int aSize = Superclass::GetMemorySize(); + + if(vtkDataSet* aDataSet = myAppendPolyData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; int anEnd = myAppendPolyData->GetNumberOfInputs(); - for(int anId = 0; anId < anEnd; anId++){ - aDataSet = myAppendPolyData->GetInput(anId); - aSize += aDataSet->GetActualMemorySize() * 1024; - } - - aSize += Superclass::GetMemorySize(); + for(int anId = 0; anId < anEnd; anId++) + if(vtkDataSet* aDataSet = myAppendPolyData->GetInput(anId)) + aSize += aDataSet->GetActualMemorySize() * 1024; return aSize; } diff --git a/src/PIPELINE/VISU_DataSetMapperHolder.cxx b/src/PIPELINE/VISU_DataSetMapperHolder.cxx index 65a3caad..7ead8b37 100644 --- a/src/PIPELINE/VISU_DataSetMapperHolder.cxx +++ b/src/PIPELINE/VISU_DataSetMapperHolder.cxx @@ -101,14 +101,12 @@ unsigned long int VISU_DataSetMapperHolder ::GetMemorySize() { - unsigned long int aSize = 0; + unsigned long int aSize = Superclass::GetMemorySize(); if(myExtractGeometry->GetInput()) if(vtkDataSet* aDataSet = myExtractGeometry->GetOutput()) aSize = aDataSet->GetActualMemorySize() * 1024; - aSize += Superclass::GetMemorySize(); - return aSize; } diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 4c9fbe95..2c21bf18 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -159,7 +159,8 @@ unsigned long int VISU_DeformedShapePL ::GetMemorySize() { - unsigned long int aSize = 0; + unsigned long int aSize = Superclass::GetMemorySize(); + if(myWarpVector->GetInput()) if(vtkDataSet* aDataSet = myWarpVector->GetOutput()) aSize += aDataSet->GetActualMemorySize() * 1024; @@ -168,8 +169,6 @@ VISU_DeformedShapePL if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) aSize += aDataSet->GetActualMemorySize() * 1024; - aSize += Superclass::GetMemorySize(); - return aSize; } diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 343bedb2..9373d497 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -265,7 +265,7 @@ unsigned long int VISU_GaussPointsPL ::GetMemorySize() { - unsigned long int aSize = 0; + unsigned long int aSize = Superclass::GetMemorySize(); if(GetIsDeformed()) if(vtkDataSet* aDataSet = myWarpVector->GetOutput()) diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index d812182c..950330c2 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -183,15 +183,14 @@ unsigned long int VISU_IsoSurfacesPL ::GetMemorySize() { - vtkDataSet* aDataSet = myContourFilter->GetOutput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; - - if(myCellDataToPointData->GetInput()){ - aDataSet = myCellDataToPointData->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; - } + unsigned long int aSize = Superclass::GetMemorySize(); - aSize += Superclass::GetMemorySize(); + if(vtkDataSet* aDataSet = myContourFilter->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(myCellDataToPointData->GetInput()) + if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; return aSize; } diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index 42724887..f1b9c6ff 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -250,7 +250,8 @@ unsigned long int VISU_Plot3DPL ::GetMemorySize() { - unsigned long int aSize = 0; + unsigned long int aSize = Superclass::GetMemorySize(); + if(vtkDataSet* aDataSet = myGeometryFilter->GetInput()) aSize += aDataSet->GetActualMemorySize() * 1024; @@ -270,8 +271,6 @@ VISU_Plot3DPL aSize += aDataSet->GetActualMemorySize() * 1024; } - aSize += Superclass::GetMemorySize(); - return aSize; } diff --git a/src/PIPELINE/VISU_PolyDataMapperHolder.cxx b/src/PIPELINE/VISU_PolyDataMapperHolder.cxx index 4a8c2e39..2045f712 100644 --- a/src/PIPELINE/VISU_PolyDataMapperHolder.cxx +++ b/src/PIPELINE/VISU_PolyDataMapperHolder.cxx @@ -101,13 +101,11 @@ unsigned long int VISU_PolyDataMapperHolder ::GetMemorySize() { - unsigned long int aSize = 0; + unsigned long int aSize = Superclass::GetMemorySize(); if(myExtractPolyDataGeometry->GetInput()) if(vtkDataSet* aDataSet = myExtractPolyDataGeometry->GetOutput()) aSize = aDataSet->GetActualMemorySize() * 1024; - - aSize += Superclass::GetMemorySize(); return aSize; } diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 583642a3..dad8e547 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -162,21 +162,20 @@ unsigned long int VISU_ScalarMapOnDeformedShapePL ::GetMemorySize() { - vtkDataSet* aDataSet = myDeformVectors->GetOutput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; - - aDataSet = myExtractorScalars->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; + unsigned long int aSize = Superclass::GetMemorySize(); - aDataSet = myMergeFilter->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; + if(vtkDataSet* aDataSet = myDeformVectors->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(vtkDataSet* aDataSet = myExtractorScalars->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; - if(myCellDataToPointData->GetInput()){ - aDataSet = myCellDataToPointData->GetOutput(); + if(vtkDataSet* aDataSet = myMergeFilter->GetOutput()) aSize += aDataSet->GetActualMemorySize() * 1024; - } - aSize += Superclass::GetMemorySize(); + if(myCellDataToPointData->GetInput()) + if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; return aSize; } diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index e47a0f38..cd46cdb8 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -666,18 +666,17 @@ unsigned long int VISU_StreamLinesPL ::GetMemorySize() { - vtkDataSet* aDataSet = myStream->GetOutput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; - - aDataSet = myGeomFilter->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; + unsigned long int aSize = Superclass::GetMemorySize(); - if(myCellDataToPointData->GetInput()){ - aDataSet = myCellDataToPointData->GetOutput(); + if(vtkDataSet* aDataSet = myStream->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(vtkDataSet* aDataSet = myGeomFilter->GetOutput()) aSize += aDataSet->GetActualMemorySize() * 1024; - } - aSize += Superclass::GetMemorySize(); + if(myCellDataToPointData->GetInput()) + if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; return aSize; } diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 43afae0a..66ad29fa 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -289,21 +289,20 @@ unsigned long int VISU_VectorsPL ::GetMemorySize() { - vtkDataSet* aDataSet = myBaseGlyph->GetOutput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; - - aDataSet = myTransformedGlyph->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; - - aDataSet = myCenters->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; + unsigned long int aSize = Superclass::GetMemorySize(); - if(myCellDataToPointData->GetInput()){ - aDataSet = myCellDataToPointData->GetOutput(); + if(vtkDataSet* aDataSet = myBaseGlyph->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(vtkDataSet* aDataSet = myTransformedGlyph->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(vtkDataSet* aDataSet = myCenters->GetOutput()) aSize += aDataSet->GetActualMemorySize() * 1024; - } - aSize += Superclass::GetMemorySize(); + if(myCellDataToPointData->GetInput()) + if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; return aSize; }