From 5cc6adc4fe970f6ebfcc26625c8bf8e206f883a1 Mon Sep 17 00:00:00 2001 From: ctorres Date: Mon, 3 Feb 2014 16:50:13 +0100 Subject: [PATCH] 2284 creaVtk Feature New Normal Plane Source 2014-02-03 16:49 --- bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx | 77 +++++++++++++++++++ bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h | 49 ++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx new file mode 100644 index 0000000..ff09f5d --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx @@ -0,0 +1,77 @@ +//===== +// 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 "bbcreaVtkPlaneSource.h" +#include "bbcreaVtkPackage.h" +#include "vtkPlaneSource.h" +#include "vtkDataSet.h" +#include "iostream" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneSource) +BBTK_BLACK_BOX_IMPLEMENTATION(PlaneSource,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 PlaneSource::Process() +{ + vtkPlaneSource *plane; + plane = vtkPlaneSource::New(); + double p0[3]; + p0[0]=0; + p0[1]=0; + p0[2]=0; + double p1[3]; + p1[0]=0; + p1[1]=0; + p1[2]=0; + double p2[3]; + p2[0]=0; + p2[1]=0; + p2[2]=0; + double c[3]; + c[0]=bbGetInputCenter()[0]; + c[1]=bbGetInputCenter()[1]; + c[2]=bbGetInputCenter()[2]; + + plane->SetResolution( 100, 100); + plane->SetOrigin( p0 ); + plane->SetPoint1( p1 ); + plane->SetPoint2( p2 ); + plane->Update( ); + plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); + plane->Update( ); + plane->SetCenter( c ); + plane->Update( ); + bbSetOutputPlane( (vtkDataSet*)plane ); + std::cout << "CFT End of Process() CFT" << std::endl; + +} +//===== +// 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 PlaneSource::bbUserSetDefaultValues() +{ + +} +//===== +// 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 PlaneSource::bbUserInitializeProcessing() +{ + + +} +//===== +// 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 PlaneSource::bbUserFinalizeProcessing() +{ + + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h new file mode 100644 index 0000000..1461d07 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h @@ -0,0 +1,49 @@ +//===== +// 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 __bbcreaVtkPlaneSource_h_INCLUDED__ +#define __bbcreaVtkPlaneSource_h_INCLUDED__ +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" +#include "vtkPlaneSource.h" +#include "vtkDataSet.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT PlaneSource + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(PlaneSource,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(Center,std::vector); + BBTK_DECLARE_INPUT(Normal,std::vector); + BBTK_DECLARE_OUTPUT(Plane,vtkDataSet*); + BBTK_PROCESS(Process); + void Process(); +//===== +// 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(PlaneSource,bbtk::AtomicBlackBox); +BBTK_NAME("PlaneSource"); +BBTK_AUTHOR("carlos torres"); +BBTK_DESCRIPTION("No Description."); +BBTK_CATEGORY("empty"); +BBTK_INPUT(PlaneSource,Center,"Center",std::vector,""); +BBTK_INPUT(PlaneSource,Normal,"Normal",std::vector,""); +BBTK_OUTPUT(PlaneSource,Plane,"Plane",vtkDataSet*,""); +BBTK_END_DESCRIBE_BLACK_BOX(PlaneSource); +//===== +// 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 // __bbcreaVtkPlaneSource_h_INCLUDED__ + -- 2.47.1