From: apo Date: Tue, 6 Dec 2005 06:35:17 +0000 (+0000) Subject: To introduce caching for textures X-Git-Tag: TG-D5-38-2003_D2005-20-12~64 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f94808c3f863a601d94ae5b0798d81a426ea9c4;p=modules%2Fvisu.git To introduce caching for textures --- diff --git a/src/PIPELINE/VISUPipeLine.cxx b/src/PIPELINE/VISUPipeLine.cxx index b985bde6..d1ac8fe3 100644 --- a/src/PIPELINE/VISUPipeLine.cxx +++ b/src/PIPELINE/VISUPipeLine.cxx @@ -43,6 +43,7 @@ typedef VISU_GaussPointsPL TPresent; #include #include +#include #include #include #include @@ -141,7 +142,8 @@ int main(int argc, char** argv){ strcat( anAlphaTexture, "/share/salome/resources/sprite_alpha.vti" ); //cout << anAlphaTexture << endl; - aPresent->SetImageData( VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ) ); + vtkSmartPointer aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); + aPresent->SetImageData( aTextureValue.GetPointer() ); aPresent->Update(); diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 3c180fa7..c0a86dc9 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -616,7 +616,7 @@ VISU_GaussPointsPL } //---------------------------------------------------------------------------- -vtkImageData* +vtkSmartPointer VISU_GaussPointsPL ::MakeTexture( const char* theMainTexture, const char* theAlphaTexture ) @@ -641,8 +641,10 @@ VISU_GaussPointsPL if(aMainImageSize[0] != anAlphaImageSize[0] || aMainImageSize[1] != anAlphaImageSize[1]) return NULL; + vtkSmartPointer aCompositeImageData = vtkImageData::New(); + aCompositeImageData->Delete(); + int aNbCompositeComponents = 4; - vtkImageData* aCompositeImageData = vtkImageData::New(); aCompositeImageData->SetDimensions(aMainImageSize); aCompositeImageData->SetScalarTypeToUnsignedChar(); aCompositeImageData->SetNumberOfScalarComponents(aNbCompositeComponents); diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 86d63dc9..b342ab56 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -251,7 +251,7 @@ public: * Second parameter - texture for alpha mask. */ static - vtkImageData* + vtkSmartPointer MakeTexture( const char* theMainTexture, const char* theAlphaTexture );