From 6fb1c620eccfd59eec46c64c57480587b5c8df30 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 30 Nov 2006 15:19:20 +0000 Subject: [PATCH] To implement GetMemorySize method for the other VISU presentations --- src/OBJECT/VISU_MeshAct.cxx | 16 +++++++++--- src/OBJECT/VISU_VectorsAct.cxx | 14 ++++++++++ src/OBJECT/VISU_VectorsAct.h | 5 ++++ src/PIPELINE/VISU_DeformedShapePL.cxx | 13 +++++----- src/PIPELINE/VISU_IsoSurfacesPL.cxx | 20 ++++++++++++++ src/PIPELINE/VISU_IsoSurfacesPL.hxx | 5 ++++ .../VISU_ScalarMapOnDeformedShapePL.cxx | 26 +++++++++++++++++++ .../VISU_ScalarMapOnDeformedShapePL.hxx | 5 ++++ src/PIPELINE/VISU_StreamLinesPL.cxx | 23 ++++++++++++++++ src/PIPELINE/VISU_StreamLinesPL.hxx | 5 ++++ src/PIPELINE/VISU_VectorsPL.cxx | 26 +++++++++++++++++++ src/PIPELINE/VISU_VectorsPL.hxx | 5 ++++ 12 files changed, 154 insertions(+), 9 deletions(-) diff --git a/src/OBJECT/VISU_MeshAct.cxx b/src/OBJECT/VISU_MeshAct.cxx index c7a09833..e98f3019 100644 --- a/src/OBJECT/VISU_MeshAct.cxx +++ b/src/OBJECT/VISU_MeshAct.cxx @@ -232,18 +232,28 @@ unsigned long int VISU_MeshAct ::GetMemorySize() { + vtkDataSet* aDataSet; unsigned long int aSize = Superclass::GetMemorySize(); { - vtkDataSet* aDataSet = mySurfaceActor->GetMapper()->GetInput(); + aDataSet = mySurfaceActor->GetInput(); aSize += aDataSet->GetActualMemorySize() * 1024; + + aDataSet = mySurfaceActor->GetMapper()->GetInput(); + aSize += aDataSet->GetActualMemorySize() * 1024 * 2; } { - vtkDataSet* aDataSet = myEdgeActor->GetMapper()->GetInput(); + aDataSet = myEdgeActor->GetInput(); aSize += aDataSet->GetActualMemorySize() * 1024; + + aDataSet = myEdgeActor->GetMapper()->GetInput(); + aSize += aDataSet->GetActualMemorySize() * 1024 * 2; } { - vtkDataSet* aDataSet = myNodeActor->GetMapper()->GetInput(); + aDataSet = myNodeActor->GetInput(); aSize += aDataSet->GetActualMemorySize() * 1024; + + aDataSet = myNodeActor->GetMapper()->GetInput(); + aSize += aDataSet->GetActualMemorySize() * 1024 * 2; } return aSize; } diff --git a/src/OBJECT/VISU_VectorsAct.cxx b/src/OBJECT/VISU_VectorsAct.cxx index 6fc38567..9666b568 100644 --- a/src/OBJECT/VISU_VectorsAct.cxx +++ b/src/OBJECT/VISU_VectorsAct.cxx @@ -105,3 +105,17 @@ VISU_VectorsAct } vtkLODActor::SetMapper(theMapper); } + + +//---------------------------------------------------------------------------- +unsigned long int +VISU_VectorsAct +::GetMemorySize() +{ + vtkDataSet* aDataSet; + unsigned long int aSize = Superclass::GetMemorySize(); + + aSize += GetPipeLine()->GetMemorySize(); + + return aSize; +} diff --git a/src/OBJECT/VISU_VectorsAct.h b/src/OBJECT/VISU_VectorsAct.h index d4c4ce77..06436cc4 100644 --- a/src/OBJECT/VISU_VectorsAct.h +++ b/src/OBJECT/VISU_VectorsAct.h @@ -59,6 +59,11 @@ class VTKOCC_EXPORT VISU_VectorsAct : public VISU_ScalarMapAct void SetMapper(vtkMapper* theMapper); + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + protected: VISU_VectorsAct(); ~VISU_VectorsAct(); diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index c714e076..8a8cc06d 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -140,13 +140,14 @@ unsigned long int VISU_DeformedShapePL ::GetMemorySize() { - vtkDataSet* aDataSet = myWarpVector->GetOutput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; + unsigned long int aSize = 0; + if(vtkDataSet* aDataSet = myWarpVector->GetInput()) + if(vtkDataSet* aDataSet = myWarpVector->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; - if(myCellDataToPointData->GetInput()){ - aDataSet = myCellDataToPointData->GetOutput(); - aSize += aDataSet->GetActualMemorySize() * 1024; - } + if(myCellDataToPointData->GetInput()) + if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput()) + aSize += aDataSet->GetActualMemorySize() * 1024; aSize += Superclass::GetMemorySize(); diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 2d0be6cc..aa932005 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -142,6 +142,26 @@ VISU_IsoSurfacesPL VISU_ScalarMapPL::Update(); } +//---------------------------------------------------------------------------- +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; + } + + aSize += Superclass::GetMemorySize(); + + return aSize; +} + + +//---------------------------------------------------------------------------- void VISU_IsoSurfacesPL ::SetMapScale(vtkFloatingPointType theMapScale) diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index 2049a761..1ecc5ed0 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -85,6 +85,11 @@ public: void Update(); + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + virtual THook* DoHook(); diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 16759ec6..ec75b087 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -151,6 +151,32 @@ VISU_ScalarMapOnDeformedShapePL VISU_PipeLine::Update(); } +//---------------------------------------------------------------------------- +unsigned long int +VISU_ScalarMapOnDeformedShapePL +::GetMemorySize() +{ + vtkDataSet* aDataSet = myDeformVectors->GetOutput(); + unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; + + aDataSet = myExtractorScalars->GetOutput(); + aSize += aDataSet->GetActualMemorySize() * 1024; + + aDataSet = myMergeFilter->GetOutput(); + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(myCellDataToPointData->GetInput()){ + aDataSet = myCellDataToPointData->GetOutput(); + aSize += aDataSet->GetActualMemorySize() * 1024; + } + + aSize += Superclass::GetMemorySize(); + + return aSize; +} + + +//---------------------------------------------------------------------------- /*! * Update scalars method. * Put scalars to merge filter. diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index 6abcf103..fa990596 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -98,6 +98,11 @@ public: void Update(); + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + //! Update scalars. void UpdateScalars(); diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index ac9d8c7f..03298fcc 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -522,6 +522,29 @@ VISU_StreamLinesPL VISU_ScalarMapPL::Update(); } +//---------------------------------------------------------------------------- +unsigned long int +VISU_StreamLinesPL +::GetMemorySize() +{ + vtkDataSet* aDataSet = myStream->GetOutput(); + unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; + + aDataSet = myGeomFilter->GetOutput(); + aSize += aDataSet->GetActualMemorySize() * 1024; + + if(myCellDataToPointData->GetInput()){ + aDataSet = myCellDataToPointData->GetOutput(); + aSize += aDataSet->GetActualMemorySize() * 1024; + } + + aSize += Superclass::GetMemorySize(); + + return aSize; +} + + +//---------------------------------------------------------------------------- void VISU_StreamLinesPL ::SetMapScale(vtkFloatingPointType theMapScale) diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index 67c6ab3f..5ea3455b 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -140,6 +140,11 @@ public: void Update(); + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0); diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 2cc28805..f6976ad3 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -249,6 +249,32 @@ VISU_VectorsPL } +//---------------------------------------------------------------------------- +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; + + if(myCellDataToPointData->GetInput()){ + aDataSet = myCellDataToPointData->GetOutput(); + aSize += aDataSet->GetActualMemorySize() * 1024; + } + + aSize += Superclass::GetMemorySize(); + + return aSize; +} + + +//---------------------------------------------------------------------------- void VISU_VectorsPL ::SetMapScale(vtkFloatingPointType theMapScale) diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index 8c3f4d78..38f8baaa 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -96,6 +96,11 @@ public: void Update(); + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + vtkDataSet* GetOutput(); -- 2.39.2