--- /dev/null
+//=====
+// 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)
+//=====
+#include "bbcreaVtkStreamTracer.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,StreamTracer)
+BBTK_BLACK_BOX_IMPLEMENTATION(StreamTracer,bbtk::AtomicBlackBox);
+//=====
+// 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)
+//=====
+void StreamTracer::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+ creavtkstreamtracer.SetActive( bbGetInputActive() );
+ creavtkstreamtracer.SetDataObject( bbGetInputIn() );
+ creavtkstreamtracer.SetSourcePoints( bbGetInputSource() ); // source
+ creavtkstreamtracer.Process();
+ bbSetOutputOut( creavtkstreamtracer.GetPolyData() );
+
+}
+//=====
+// 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)
+//=====
+void StreamTracer::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputActive(true);
+ bbSetInputIn(NULL);
+ bbSetInputSource(NULL);
+
+}
+//=====
+// 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)
+//=====
+void StreamTracer::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// 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)
+//=====
+void StreamTracer::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/null
+//=====
+// 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)
+//=====
+#ifndef __bbcreaVtkStreamTracer_h_INCLUDED__
+#define __bbcreaVtkStreamTracer_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkDataObject.h"
+#include "vtkDataSet.h"
+#include "vtkPolyData.h"
+
+#include "creaVtkStreamTracer.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT StreamTracer
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(StreamTracer,bbtk::AtomicBlackBox);
+//=====
+// 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(Active,bool);
+ BBTK_DECLARE_INPUT(In,vtkDataObject*);
+ BBTK_DECLARE_INPUT(Source,vtkDataSet*);
+ BBTK_DECLARE_OUTPUT(Out,vtkPolyData*);
+ BBTK_PROCESS(Process);
+ void Process();
+
+private:
+ creaVtkStreamTracer creavtkstreamtracer;
+
+//=====
+// 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_BEGIN_DESCRIBE_BLACK_BOX(StreamTracer,bbtk::AtomicBlackBox);
+ BBTK_NAME("StreamTracer");
+ BBTK_AUTHOR("InfoDev Creatis");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(StreamTracer,Active,"Active true/false (default true)",bool,"");
+ BBTK_INPUT(StreamTracer,In,"(needed) vtkDataObject. (Example vtkDataObject<-vtkDataSet<-vtkPointSet<-vtkPolyData (parrent class) )",vtkDataObject*,"");
+ BBTK_INPUT(StreamTracer,Source,"(needed) vtkDataSet. (Example vtkPointSource->GetOutput() )",vtkDataSet*,"");
+ BBTK_OUTPUT(StreamTracer,Out,"vtkPolyData output",vtkPolyData*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(StreamTracer);
+//=====
+// 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)
+//=====
+}
+// EO namespace bbcreaVtk
+
+#endif // __bbcreaVtkStreamTracer_h_INCLUDED__
+
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sante)
+# 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 "creaVtkStreamTracer.h"
+
+//-----------------------------------------------------------------------------
+creaVtkStreamTracer::creaVtkStreamTracer()
+{
+ _source = vtkPointSource::New();
+ _streamer = vtkStreamTracer::New();
+}
+
+//-----------------------------------------------------------------------------
+creaVtkStreamTracer::~creaVtkStreamTracer()
+{
+}
+
+
+//------------------------------------------------------------------------
+void creaVtkStreamTracer::SetActive(bool active)
+{
+ _active = active;
+}
+
+//------------------------------------------------------------------------
+void creaVtkStreamTracer::SetDataObject(vtkDataObject* dataobject)
+{
+ _dataobject = dataobject;
+}
+
+//---------------------------------------------
+vtkPolyData* creaVtkStreamTracer::GetPolyData()
+{
+ return _streamer->GetOutput();
+}
+
+//---------------------------------------------
+void creaVtkStreamTracer::SetSourcePoints( vtkDataSet* sourcepoints)
+{
+ _sourcePoints = sourcepoints;
+}
+
+//-----------------------------------------------------------------------------
+void creaVtkStreamTracer::Process()
+{
+ if (_active==true)
+ {
+// if (_firsttime==true)
+// {
+// _firsttime=false;
+// _vPointWidget->AllOff();
+// _vPointWidget->PlaceWidget();
+// _vPointWidget->SetInteractor( GetRenderer()->GetRenderWindow()->GetInteractor() );
+// _source->SetNumberOfPoints(1000);
+// _source->SetRadius(5.0);
+// }
+//EED1 _vPointWidget->On();
+// double c[3];
+// _vPointWidget->GetPosition(c);
+// _source->SetCenter( c );
+// _source->Update();
+
+ _streamer->SetInput( _dataobject );
+//EED1 _streamer->SetSource( _source->GetOutput() );
+ _streamer->SetSource( _sourcePoints );
+ _streamer->SetIntegratorTypeToRungeKutta45();
+ _streamer->SetMaximumPropagation(500);
+//EED _streamer->SetMaximumPropagationUnitToTimeUnit();
+ _streamer->SetInitialIntegrationStep (0.001);
+//EED _streamer->SetInitialIntegrationStepUnitToCellLengthUnit();
+ _streamer->SetIntegrationDirectionToBoth();
+//EED streamer->ComputeVorticityOn ();
+ _streamer->Update();
+
+// _streamer->Print(std::cout);
+// _streamer->GetOutput()->Print(std::cout);
+
+ } // active
+}
+
+
+
+//---------------------------------------------
+//Method template
+//---------------------------------------------
+/*
+void creaVtkStreamTracer::FunctionName(int& parameterA)
+{
+ parameterA = 2 * parameterA;
+ return;
+}
+*/
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sante)
+# 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.
+# ------------------------------------------------------------------------
+*/
+
+#ifndef _CREAVTKSTREAMTRACER_H_
+#define _CREAVTKSTREAMTRACER_H_
+
+//---------------------------------------------
+// Class Name: creaVtkStreamTracer
+// [classdescription]
+//---------------------------------------------
+
+#include "vtkDataSet.h"
+#include "vtkPointSource.h"
+#include "vtkPointWidget.h"
+#include "vtkStreamTracer.h"
+
+class creaVtkStreamTracer
+{
+
+//---------------------------------------------
+//Methods and attributes exposed to other classes
+//---------------------------------------------
+public :
+ creaVtkStreamTracer();
+ ~creaVtkStreamTracer();
+
+ void SetActive(bool active);
+ void SetDataObject(vtkDataObject* dataobject);
+ void SetSourcePoints(vtkDataSet* sourcepoints);
+ void Process();
+
+ vtkPolyData* GetPolyData();
+
+//--Method template----------------------------
+// void FunctionName(int& parameterA);
+
+
+//---------------------------------------------
+//Methods and attributes exposed only to classes
+//that are derived from this class
+//---------------------------------------------
+protected:
+
+//---------------------------------------------
+//Methods and attributes only visible by this class
+//---------------------------------------------
+private:
+
+ bool _active;
+ vtkDataObject *_dataobject;
+ vtkDataSet *_sourcePoints;
+ vtkPointSource *_source;
+ vtkStreamTracer *_streamer;
+
+
+};
+
+//-end of _CREAVTKSTREAMTRACER_H_------------------------------------------------------
+#endif