]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.h
MeshManager
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPointPicker.h
1 //===== 
2 // 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)
3 //===== 
4 #ifndef __bbcreaVtkPointPicker_h_INCLUDED__
5 #define __bbcreaVtkPointPicker_h_INCLUDED__
6 #include "bbcreaVtk_EXPORT.h"
7 #include "bbtkAtomicBlackBox.h"
8 #include "iostream"
9
10 #include "vtkCommand.h"
11 #include "vtkRenderer.h"
12 #include "vtkProp3D.h"
13 #include <vtkRenderWindowInteractor.h>
14
15
16 namespace bbcreaVtk
17 {
18
19 class PointPicker;
20
21 //---------------------------------------------
22 class creaVtkCallbackPointPicker : public vtkCommand
23 {
24         
25         public:
26                 creaVtkCallbackPointPicker();
27                 
28                 static creaVtkCallbackPointPicker *New() { return new creaVtkCallbackPointPicker; }
29                 void Delete() { delete this; }
30                 virtual void Execute(vtkObject *caller, unsigned long, void*);
31                 void setBox(PointPicker *box);
32         private:
33                 PointPicker *boxPointPicker;            
34                 
35 };
36
37
38 //---------------------------------------------
39 //---------------------------------------------
40 //---------------------------------------------
41
42 typedef  long int longInt;
43
44 class bbcreaVtk_EXPORT PointPicker
45  : 
46    public bbtk::AtomicBlackBox
47 {
48   BBTK_BLACK_BOX_INTERFACE(PointPicker,bbtk::AtomicBlackBox);
49 //===== 
50 // 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)
51 //===== 
52     BBTK_DECLARE_INPUT(Active,bool);
53     BBTK_DECLARE_INPUT(TypeEvent,int );
54     BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
55     BBTK_DECLARE_INPUT(Prop3D,vtkProp3D*);
56     BBTK_DECLARE_INPUT(DefaultPointId,longInt);
57     BBTK_DECLARE_INPUT(DefaultPoint,std::vector<double>);
58     BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
59     BBTK_DECLARE_OUTPUT(Mesh,vtkProp3D*);
60     BBTK_DECLARE_OUTPUT(PointId,longInt);
61     BBTK_DECLARE_OUTPUT(CellId,longInt);
62     BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
63     BBTK_PROCESS(Process);
64     void Process();
65
66     bool firsttime;
67     creaVtkCallbackPointPicker *callPicker;
68   
69 //===== 
70 // 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)
71 //===== 
72 };
73
74 BBTK_BEGIN_DESCRIBE_BLACK_BOX(PointPicker,bbtk::AtomicBlackBox);
75     BBTK_NAME("PointPicker");
76     BBTK_AUTHOR("InfoDev");
77     BBTK_DESCRIPTION("No Description.");
78     BBTK_CATEGORY("empty");
79
80     BBTK_INPUT(PointPicker,Active,"(true default)  true/false",bool,"");
81     BBTK_INPUT(PointPicker,TypeEvent,"(0 default) 0:NOTHING,  1:MouseMoveEvent  2:LeftButtonPressEvent  3:LeftButtonDoubleClickEvent",int,"");
82     BBTK_INPUT(PointPicker,Renderer,"vtk Renderer",vtkRenderer*,"");
83     BBTK_INPUT(PointPicker,Prop3D,"vtkProp3D de reference. If this parameter is empty all actors in the render are used",vtkProp3D*,"");
84     BBTK_INPUT(PointPicker,DefaultPointId,"Default Point Id",longInt,"");
85     BBTK_INPUT(PointPicker,DefaultPoint,"Default Point",std::vector<double>,"");
86
87     BBTK_OUTPUT(PointPicker,Point,"Point [x,y,z])",std::vector<double>,"");
88     BBTK_OUTPUT(PointPicker,Mesh,"Mesh",vtkProp3D*,"");
89     BBTK_OUTPUT(PointPicker,PointId,"Mesh point Id",longInt,"");
90     BBTK_OUTPUT(PointPicker,CellId,"Mesh cell Id",longInt,"");
91     BBTK_OUTPUT(PointPicker,Normal,"Normal [nx,ny,nz]",std::vector<double>,"");
92
93 BBTK_END_DESCRIBE_BLACK_BOX(PointPicker);
94 //===== 
95 // 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)
96 //===== 
97 }
98 // EO namespace bbcreaVtk
99
100 #endif // __bbcreaVtkPointPicker_h_INCLUDED__
101