X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=packages%2Fvtk%2Fsrc%2FbbvtkPolyDataWriterPlus.cxx;h=0c9de87efec7a95e78e6eb5bfc4eaaeca3defc14;hb=d19c5512748aa8e2dd5c3d01d9ec680ded1f17ce;hp=969254d528e986ff84c83822170cc7233d890231;hpb=5383f06c991adc435baefd87d970100b9cf6042e;p=bbtk.git diff --git a/packages/vtk/src/bbvtkPolyDataWriterPlus.cxx b/packages/vtk/src/bbvtkPolyDataWriterPlus.cxx index 969254d..0c9de87 100755 --- a/packages/vtk/src/bbvtkPolyDataWriterPlus.cxx +++ b/packages/vtk/src/bbvtkPolyDataWriterPlus.cxx @@ -1,3 +1,30 @@ +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + #include "bbvtkPolyDataWriterPlus.h" #include "bbvtkPackage.h" namespace bbvtk @@ -12,7 +39,7 @@ void PolyDataWriterPlus::Process() if (!HasObserver(OBS_PRE_WRITER_1) && bbGetInputInPrePersistObs1() != NULL) AddObserver(OBS_PRE_WRITER_1, bbGetInputInPrePersistObs1()); - + /// \TODO fix warning: NULL used in arithmetic // JPR if (!HasObserver(OBS_POST_WRITER_1) == NULL && bbGetInputInPostPersistObs1() != NULL) AddObserver(OBS_POST_WRITER_1, bbGetInputInPostPersistObs1()); @@ -60,7 +87,14 @@ void PolyDataWriterPlus::Process() vtkDataSetSurfaceFilter* surfaceFilter = vtkDataSetSurfaceFilter::New(); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 surfaceFilter->SetInput(entrada); +#else + surfaceFilter->SetInputData(entrada); +#endif + surfaceFilter->Update(); //vtkPolyData* polydata = surfaceFilter->GetOutput(); entrada = surfaceFilter->GetOutput(); @@ -68,7 +102,14 @@ void PolyDataWriterPlus::Process() if (extension.compare("vtk") == 0) { vtkPolyDataWriter* writer = vtkPolyDataWriter::New(); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 writer->SetInput(entrada); +#else + writer->SetInputData(entrada); +#endif + writer->SetFileName(nuevo_nombre.data()); writer->Write(); writer->Delete(); @@ -78,7 +119,14 @@ void PolyDataWriterPlus::Process() { vtkXMLPolyDataWriter* writer = vtkXMLPolyDataWriter::New(); writer->SetFileName ( nuevo_nombre.data() ); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 writer->SetInput ( entrada ); +#else + writer->SetInputData ( entrada ); +#endif + writer->Write(); writer->Delete(); } @@ -87,13 +135,19 @@ void PolyDataWriterPlus::Process() { vtkSTLWriter* writer = vtkSTLWriter::New(); writer->SetFileName ( nuevo_nombre.data() ); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 writer->SetInput ( entrada ); +#else + writer->SetInputData ( entrada ); +#endif + writer->Write(); writer->Print(std::cout); writer->Delete(); } - std::cout << "Saving Ok!" << std::endl; InvokeEvent(OBS_POST_WRITER_1);