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);
20 PlaneDirectionViewer* PlaneDirectionViewer::getInstance(wxWindow* parent,int radio, double colour[3], int opacity){
22 instance = new PlaneDirectionViewer(parent,radio,colour,opacity);
27 PlaneDirectionViewer* PlaneDirectionViewer::getInstance(){
31 PlaneDirectionViewer::~PlaneDirectionViewer(){
35 void PlaneDirectionViewer::SetRenderer(vtkRenderer* render){
36 manager->SetRenderer(render);
39 void PlaneDirectionViewer::SetVectors( std::vector<double> lstPointsx, std::vector<double> lstPointsy, std::vector<double> lstPointsz){
40 manager->SetVectors(lstPointsx,lstPointsy,lstPointsz);
43 void PlaneDirectionViewer::UpdateDirections() throw (std::exception){
44 manager->UpdateDirections();
45 std::vector<PlaneDirectionManagerData*> vectdata = manager->GetPlanesData();
47 for(i = 0; i < (int)viewdata.size();i++){
48 this->GetSizer()->Remove(i);
49 viewdata[i]->Destroy();
52 for(i = 0; i < (int)vectdata.size(); i++){
53 PlaneDirectionViewerPanel* planedirview = new PlaneDirectionViewerPanel(this, vectdata[i],i);
54 viewdata.push_back(planedirview);
55 this->GetSizer()->Add(planedirview,1);
60 void PlaneDirectionViewer::addRemoveActor(int index, bool addremove){
61 manager->addRemoveActor(index, addremove);
64 void PlaneDirectionViewer::changeColor(int index,double r,double g,double b){
65 manager->changeColor(index, r,g,b);
68 void PlaneDirectionViewer::WriteInformation(std::string filename, double* spc){
69 manager->WriteInformation(filename,spc);
72 void PlaneDirectionViewer::SetArrowSize(int arrowsize){
73 manager->SetArrowSize(arrowsize);