]> Creatis software - creaVtk.git/commitdiff
2284 creaVtk Feature New Normal Plane Source 2014-02-03 16:49
authorctorres <carlos.torres@creatis.insa-lyon.fr>
Mon, 3 Feb 2014 15:50:13 +0000 (16:50 +0100)
committerctorres <carlos.torres@creatis.insa-lyon.fr>
Wed, 12 Feb 2014 16:29:05 +0000 (17:29 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx [new file with mode: 0644]
bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.h [new file with mode: 0644]

diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx
new file mode 100644 (file)
index 0000000..ff09f5d
--- /dev/null
@@ -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 (file)
index 0000000..1461d07
--- /dev/null
@@ -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<double>);
+       BBTK_DECLARE_INPUT(Normal,std::vector<double>);
+  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<double>,"");
+BBTK_INPUT(PlaneSource,Normal,"Normal",std::vector<double>,"");
+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__
+