From a78b6f257f3dcf81430779e8c8710b1685008775 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 30 Nov 2018 15:00:49 +0100 Subject: [PATCH] #3233 creaVtk Feature New Normal - GetCameraInfo SetCameraInfo ScreenShot --- bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg | 2 ++ bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs | 1 + bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx | 14 +++++++++----- bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg index 90ba0a5..0958f47 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg @@ -17,6 +17,8 @@ ISEXEC:FALSE 7.157864:7.257698:-900.000000 PORT FileName:"ScreenShot.png" +PORT +Scale:"2 2" FIN_BOX BOX vtk:LoadHola:Box01 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs index 34ea539..062ab04 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs @@ -19,6 +19,7 @@ category "" new creaVtk:ScreenShot Box00 set Box00.FileName "ScreenShot.png" + set Box00.Scale "2 2" new vtk:LoadHola Box01 diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx index 35a5998..4ee0b66 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx @@ -37,17 +37,21 @@ void ScreenShot::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <GetVTKWindow()->SetSize( bbGetInputSize()[0], bbGetInputSize()[1] ); + } wif->SetInput( bbGetInputvtkRenderer()->GetVTKWindow() ); wif->SetMagnification( bbGetInputScale()[0] ); // wif->SetScale( bbGetInputScale()[0], bbGetInputScale()[1] ); wif->SetInputBufferTypeToRGB(); wif->ReadFrontBufferOff(); wif->Update(); - vtkPNGWriter *writer = vtkPNGWriter::New(); - writer->SetFileName( bbGetInputFileName().c_str() ); - writer->SetInput(wif->GetOutput()); - writer->Write(); + vtkPNGWriter *writer = vtkPNGWriter::New(); + writer->SetFileName( bbGetInputFileName().c_str() ); + writer->SetInput(wif->GetOutput()); + writer->Write(); /* vtkFFMPEGWriter *writer2 = vtkFFMPEGWriter::New(); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h index 307d8f7..3f37cfb 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h @@ -21,6 +21,7 @@ class bbcreaVtk_EXPORT ScreenShot // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_DECLARE_INPUT(Size,std::vector); BBTK_DECLARE_INPUT(Scale,std::vector); BBTK_DECLARE_INPUT(vtkRenderer,vtkRenderer*); // BBTK_DECLARE_OUTPUT(Out,double); @@ -36,6 +37,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ScreenShot,bbtk::AtomicBlackBox); BBTK_AUTHOR("InfoDev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); + BBTK_INPUT(ScreenShot,Size,"[sX,sY] size of the render window. Default [actual window sX, actual window sY]",std::vector,""); BBTK_INPUT(ScreenShot,Scale,"[scaleX,scaleY] default [1,1]",std::vector,""); BBTK_INPUT(ScreenShot,FileName,"File Name Default:ScreenShot-BBTK.png",std::string,""); BBTK_INPUT(ScreenShot,vtkRenderer,"First input",vtkRenderer*,""); -- 2.47.1