2 #include "PlaneDirectionViewer.h"
4 /********************************************************************************************
5 ** Start of data viewmanagerData
6 *********************************************************************************************/
9 PlaneDirectionViewer* PlaneDirectionViewer::instance=NULL;
11 PlaneDirectionViewer::PlaneDirectionViewer(wxWindow* parent,int radio, double colour[3], int opacity)
14 manager = new PlaneDirectionManager(radio, colour, opacity);
15 wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
16 this->SetSizer(sizer);
17 this->SetAutoLayout(true);
22 PlaneDirectionViewer* PlaneDirectionViewer::getInstance(wxWindow* parent,int radio, double colour[3], int opacity){
24 instance = new PlaneDirectionViewer(parent,radio,colour,opacity);
29 PlaneDirectionViewer* PlaneDirectionViewer::getInstance(){
33 PlaneDirectionViewer::~PlaneDirectionViewer(){
37 void PlaneDirectionViewer::SetRenderer(vtkRenderer* render){
38 manager->SetRenderer(render);
40 void PlaneDirectionViewer::SetVectors( std::vector<double> lstPointsx, std::vector<double> lstPointsy, std::vector<double> lstPointsz){
41 manager->SetVectors(lstPointsx,lstPointsy,lstPointsz);
44 void PlaneDirectionViewer::UpdateDirections() throw (std::exception){
45 manager->UpdateDirections();
46 std::vector<PlaneDirectionManagerData*> vectdata = manager->GetPlanesData();
47 for(int i = 0; i < viewdata.size();i++){
48 this->GetSizer()->Remove(i);
49 viewdata[i]->Destroy();
52 for(int i = 0; i < vectdata.size(); i++){
53 PlaneDirectionViewerPanel* planedirview = new PlaneDirectionViewerPanel(this, vectdata[i],i);
54 viewdata.push_back(planedirview);
55 this->GetSizer()->Add(planedirview,1);
61 void PlaneDirectionViewer::addRemoveActor(int index, bool addremove){
62 manager->addRemoveActor(index, addremove);
65 void PlaneDirectionViewer::changeColor(int index,double r,double g,double b){
66 manager->changeColor(index, r,g,b);
69 void PlaneDirectionViewer::WriteInformation(std::string filename, double* spc){
70 manager->WriteInformation(filename,spc);
73 void PlaneDirectionViewer::SetArrowSize(int arrowsize){
74 manager->SetArrowSize(arrowsize);