X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVVTK%2FVVTK_ImageWriter.cxx;h=079557b1a7f24fa564f450cf39f612eda636bcc4;hb=3f4152dedc1ae968267cfb8a079f261ec0088ed0;hp=9d04759878202e582e0d658e41de7e7b9b80376d;hpb=892670dfa63e3a10989e348fee2df55929bf12a5;p=modules%2Fvisu.git diff --git a/src/VVTK/VVTK_ImageWriter.cxx b/src/VVTK/VVTK_ImageWriter.cxx index 9d047598..079557b1 100755 --- a/src/VVTK/VVTK_ImageWriter.cxx +++ b/src/VVTK/VVTK_ImageWriter.cxx @@ -1,112 +1,112 @@ -// SALOME VTKViewer : build VTK viewer into Salome desktop -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : -// Author : -// Module : -// $Header$ - -#include "VVTK_ImageWriter.h" - -#include - -#include -#include -#include -#include - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - - -//---------------------------------------------------------------------------- -VVTK_ImageWriter -::VVTK_ImageWriter(QSemaphore* theSemaphore, - vtkImageData* theImageData, - const std::string& theName, - int theProgressive, - int theQuality): - mySemaphore(theSemaphore), - myImageData(theImageData), - myName(theName), - myProgressive(theProgressive), - myQuality(theQuality), - myConstraint16Flag(true) -{} - -//---------------------------------------------------------------------------- -VVTK_ImageWriter -::~VVTK_ImageWriter() -{ - if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "< anImageClip; - // - if(myConstraint16Flag){ - int uExtent[6]; - myImageData->GetUpdateExtent(uExtent); - unsigned int width = uExtent[1] - uExtent[0] + 1; - unsigned int height = uExtent[3] - uExtent[2] + 1; - width = (width / 16) * 16; - height= (height / 16) * 16; - uExtent[1] = uExtent[0] + width - 1; - uExtent[3] = uExtent[2] + height - 1; - // - anImageClip = vtkImageClip::New(); - anImageClip->Delete(); - - anImageClip->SetInput(myImageData); - anImageClip->SetOutputWholeExtent(uExtent); - anImageClip->ClipDataOn(); - anImageData = anImageClip->GetOutput(); - } - // - aWriter->WriteToMemoryOff(); - aWriter->SetFileName(myName.c_str()); - aWriter->SetQuality(myQuality); - aWriter->SetProgressive(myProgressive); - aWriter->SetInput(anImageData); - aWriter->Write(); - - aWriter->Delete(); - myImageData->Delete(); - - if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<< - "- this = "< + +#include +#include +#include +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + + +//---------------------------------------------------------------------------- +VVTK_ImageWriter +::VVTK_ImageWriter(QSemaphore* theSemaphore, + vtkImageData* theImageData, + const std::string& theName, + int theProgressive, + int theQuality): + mySemaphore(theSemaphore), + myImageData(theImageData), + myName(theName), + myProgressive(theProgressive), + myQuality(theQuality), + myConstraint16Flag(true) +{} + +//---------------------------------------------------------------------------- +VVTK_ImageWriter +::~VVTK_ImageWriter() +{ + if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "< anImageClip; + // + if(myConstraint16Flag){ + int uExtent[6]; + myImageData->GetUpdateExtent(uExtent); + unsigned int width = uExtent[1] - uExtent[0] + 1; + unsigned int height = uExtent[3] - uExtent[2] + 1; + width = (width / 16) * 16; + height= (height / 16) * 16; + uExtent[1] = uExtent[0] + width - 1; + uExtent[3] = uExtent[2] + height - 1; + // + anImageClip = vtkImageClip::New(); + anImageClip->Delete(); + + anImageClip->SetInput(myImageData); + anImageClip->SetOutputWholeExtent(uExtent); + anImageClip->ClipDataOn(); + anImageData = anImageClip->GetOutput(); + } + // + aWriter->WriteToMemoryOff(); + aWriter->SetFileName(myName.c_str()); + aWriter->SetQuality(myQuality); + aWriter->SetProgressive(myProgressive); + aWriter->SetInput(anImageData); + aWriter->Write(); + + aWriter->Delete(); + myImageData->Delete(); + + if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<< + "- this = "<