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();
46 for(int i = 0; i < viewdata.size();i++){
47 this->GetSizer()->Remove(i);
48 viewdata[i]->Destroy();
51 for(int i = 0; i < vectdata.size(); i++){
52 PlaneDirectionViewerPanel* planedirview = new PlaneDirectionViewerPanel(this, vectdata[i],i);
53 viewdata.push_back(planedirview);
54 this->GetSizer()->Add(planedirview,1);
59 void PlaneDirectionViewer::addRemoveActor(int index, bool addremove){
60 manager->addRemoveActor(index, addremove);
63 void PlaneDirectionViewer::changeColor(int index,double r,double g,double b){
64 manager->changeColor(index, r,g,b);
67 void PlaneDirectionViewer::WriteInformation(std::string filename, double* spc){
68 manager->WriteInformation(filename,spc);
71 void PlaneDirectionViewer::SetArrowSize(int arrowsize){
72 manager->SetArrowSize(arrowsize);