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()
10 int radio = bbGetInputArrowSize();
11 std::vector<int> lstPointsx = bbGetInputlstPointsX();
12 std::vector<int> lstPointsy = bbGetInputlstPointsY();
13 std::vector<int> lstPointsz = bbGetInputlstPointsZ();
14 std::vector<double> _lstPointsx;
15 std::vector<double> _lstPointsy;
16 std::vector<double> _lstPointsz;
17 vtkRenderer* render = bbGetInputRenderer();
18 vtkImageData* img = bbGetInputIn();
19 std::string filename = bbGetInputFilename();
21 _planedir->SetArrowSize(radio);
23 _planedir->SetRenderer(render);
26 if(lstPointsx.size()>0&&lstPointsy.size()>0&&lstPointsz.size()>0){
29 spc = img->GetSpacing();
37 for(int i = 0; i < lstPointsx.size();i++){
38 _lstPointsx.push_back(lstPointsx[i]*spc[0]);
39 _lstPointsy.push_back(lstPointsy[i]*spc[1]);
40 _lstPointsz.push_back(lstPointsz[i]*spc[2]);
43 _planedir->SetVectors(_lstPointsx, _lstPointsy, _lstPointsz);
44 _planedir->UpdateDirections();
45 if(filename.compare("")!=0){
46 _planedir->WriteInformation(filename,spc);
51 void PlaneDirection::CreateWidget(wxWindow* parent)
53 _planedir = PlaneDirectionViewer::getInstance(parent, radio, colour, opacity);
54 bbSetOutputWidget( _planedir );
57 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