]> Creatis software - bbtk.git/commitdiff
Feature #1654 Added a box refreshing a renderer.
authorClaire Mouton <Claire.Mouton@creatis.insa-lyon.fr>
Mon, 8 Oct 2012 15:05:55 +0000 (15:05 +0000)
committerClaire Mouton <Claire.Mouton@creatis.insa-lyon.fr>
Mon, 8 Oct 2012 15:05:55 +0000 (15:05 +0000)
packages/vtk/src/bbvtkUpdateRender.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkUpdateRender.h [new file with mode: 0644]

diff --git a/packages/vtk/src/bbvtkUpdateRender.cxx b/packages/vtk/src/bbvtkUpdateRender.cxx
new file mode 100644 (file)
index 0000000..4900b8a
--- /dev/null
@@ -0,0 +1,31 @@
+
+#include "bbvtkUpdateRender.h"
+#include "bbvtkPackage.h"
+namespace bbvtk {
+
+    BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk, UpdateRender)
+    BBTK_BLACK_BOX_IMPLEMENTATION(UpdateRender, bbtk::AtomicBlackBox);
+
+    void UpdateRender::Process() {
+         std::cout << "CM creaInteraction vtkUpdateRender::Process before if" << std::endl;
+         if(bbGetInputActive()){
+         std::cout << "CM creaInteraction vtkUpdateRender::Process within if" << std::endl;
+         bbGetInputRenderer()->GetRenderWindow()->Render();
+       }
+    }
+
+    void UpdateRender::bbUserSetDefaultValues() {
+        bbSetInputActive(false);
+    }
+
+    void UpdateRender::bbUserInitializeProcessing() {
+
+    }
+
+    void UpdateRender::bbUserFinalizeProcessing() {
+
+    }
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkUpdateRender.h b/packages/vtk/src/bbvtkUpdateRender.h
new file mode 100644 (file)
index 0000000..6c04c18
--- /dev/null
@@ -0,0 +1,44 @@
+
+#ifndef __bbvtkUpdateRender_h_INCLUDED__
+#define __bbvtkUpdateRender_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkRenderer.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h" 
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT UpdateRender
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(UpdateRender,bbtk::AtomicBlackBox);
+  BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
+  BBTK_DECLARE_INPUT(Active,bool);
+  
+  
+  BBTK_PROCESS(Process);
+  void Process();
+
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(UpdateRender,bbtk::AtomicBlackBox);
+BBTK_NAME("UpdateRender");
+BBTK_AUTHOR("JLGR");
+BBTK_DESCRIPTION("refresh 3d scene");
+BBTK_CATEGORY("");
+BBTK_INPUT(UpdateRender,Renderer,"Render to update",vtkRenderer*,"");
+BBTK_INPUT(UpdateRender,Active,"Enable render update (default is false).",bool,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(UpdateRender);
+
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkUpdateRender_h_INCLUDED__
+