PlaneDirectionViewer.cxx

Go to the documentation of this file.
00001 
00002 #include "PlaneDirectionViewer.h"
00003 
00004 /********************************************************************************************
00005 ** Start of data viewmanagerData
00006 *********************************************************************************************/
00007 
00008 
00009 PlaneDirectionViewer* PlaneDirectionViewer::instance=NULL;
00010 
00011 PlaneDirectionViewer::PlaneDirectionViewer(wxWindow* parent,int radio, double colour[3], int opacity)
00012 :wxPanel(parent)
00013 {
00014         manager = new PlaneDirectionManager(radio, colour, opacity);    
00015         wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
00016         this->SetSizer(sizer);
00017         this->SetAutoLayout(true);
00018 }
00019 
00020 PlaneDirectionViewer* PlaneDirectionViewer::getInstance(wxWindow* parent,int radio, double colour[3], int opacity){
00021         if(instance==NULL){
00022                 instance = new PlaneDirectionViewer(parent,radio,colour,opacity);
00023         }
00024         return instance;
00025 }
00026 
00027 PlaneDirectionViewer* PlaneDirectionViewer::getInstance(){
00028         return instance;
00029 }
00030 
00031 PlaneDirectionViewer::~PlaneDirectionViewer(){
00032         delete manager;
00033 }
00034 
00035 void PlaneDirectionViewer::SetRenderer(vtkRenderer* render){
00036         manager->SetRenderer(render);
00037 }
00038 
00039 void PlaneDirectionViewer::SetVectors( std::vector<double> lstPointsx, std::vector<double> lstPointsy, std::vector<double> lstPointsz){
00040         manager->SetVectors(lstPointsx,lstPointsy,lstPointsz);
00041 }
00042 
00043 void PlaneDirectionViewer::UpdateDirections() throw (std::exception){
00044         manager->UpdateDirections();
00045         std::vector<PlaneDirectionManagerData*> vectdata = manager->GetPlanesData();
00046         for(int i = 0; i < viewdata.size();i++){
00047                 this->GetSizer()->Remove(i);
00048                 viewdata[i]->Destroy();
00049         }
00050         viewdata.clear();       
00051         for(int i = 0; i < vectdata.size(); i++){
00052                 PlaneDirectionViewerPanel* planedirview = new PlaneDirectionViewerPanel(this, vectdata[i],i);
00053                 viewdata.push_back(planedirview);
00054                 this->GetSizer()->Add(planedirview,1);
00055         }
00056         this->Layout(); 
00057 }
00058 
00059 void PlaneDirectionViewer::addRemoveActor(int index, bool addremove){
00060         manager->addRemoveActor(index, addremove);
00061 }
00062 
00063 void PlaneDirectionViewer::changeColor(int index,double r,double g,double b){
00064         manager->changeColor(index, r,g,b);
00065 }
00066 
00067 void PlaneDirectionViewer::WriteInformation(std::string  filename, double* spc){
00068     manager->WriteInformation(filename,spc);
00069 }
00070 
00071 void PlaneDirectionViewer::SetArrowSize(int arrowsize){
00072         manager->SetArrowSize(arrowsize);
00073 }
00074 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1