1 #include "bbcreaMaracasVisuPlaneDirection.h"
2 #include "bbcreaMaracasVisuPackage.h"
3 namespace bbcreaMaracasVisu
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,PlaneDirection)
7 BBTK_BLACK_BOX_IMPLEMENTATION(PlaneDirection,bbtk::WxBlackBox);
8 void PlaneDirection::Process()
12 int radio = bbGetInputArrowSize();
13 std::vector<int> lstPointsx = bbGetInputlstPointsX();
14 std::vector<int> lstPointsy = bbGetInputlstPointsY();
15 std::vector<int> lstPointsz = bbGetInputlstPointsZ();
16 std::vector<double> _lstPointsx;
17 std::vector<double> _lstPointsy;
18 std::vector<double> _lstPointsz;
19 vtkRenderer* render = bbGetInputRenderer();
20 vtkImageData* img = bbGetInputIn();
21 std::string filename = bbGetInputFilename();
23 _planedir->SetArrowSize(radio);
25 _planedir->SetRenderer(render);
28 if(lstPointsx.size()>0&&lstPointsy.size()>0&&lstPointsz.size()>0){
31 spc = img->GetSpacing();
39 for(int i = 0; i < lstPointsx.size();i++){
40 _lstPointsx.push_back(lstPointsx[i]*spc[0]);
41 _lstPointsy.push_back(lstPointsy[i]*spc[1]);
42 _lstPointsz.push_back(lstPointsz[i]*spc[2]);
45 _planedir->SetVectors(_lstPointsx, _lstPointsy, _lstPointsz);
46 _planedir->UpdateDirections();
47 if(filename.compare("")!=0){
48 _planedir->WriteInformation(filename,spc);
53 void PlaneDirection::CreateWidget(wxWindow* parent)
55 _planedir = PlaneDirectionViewer::getInstance(parent, radio, colour, opacity);
56 bbSetOutputWidget( _planedir );
58 void PlaneDirection::bbUserSetDefaultValues()
66 void PlaneDirection::bbUserInitializeProcessing()
68 std::vector<int> temp;
69 bbSetInputFilename("");
70 bbSetInputRenderer(0);
72 bbSetInputlstPointsX(temp);
73 bbSetInputlstPointsY(temp);
74 bbSetInputlstPointsZ(temp);
77 void PlaneDirection::bbUserFinalizeProcessing()
82 // EO namespace bbcreaMaracasVisu