PlaneDirectionViewer.cxx
Go to the documentation of this file.00001
00002 #include "PlaneDirectionViewer.h"
00003
00004
00005
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 int i;
00047 for(i = 0; i < (int)viewdata.size();i++){
00048 this->GetSizer()->Remove(i);
00049 viewdata[i]->Destroy();
00050 }
00051 viewdata.clear();
00052 for(i = 0; i < (int)vectdata.size(); i++){
00053 PlaneDirectionViewerPanel* planedirview = new PlaneDirectionViewerPanel(this, vectdata[i],i);
00054 viewdata.push_back(planedirview);
00055 this->GetSizer()->Add(planedirview,1);
00056 }
00057 this->Layout();
00058 }
00059
00060 void PlaneDirectionViewer::addRemoveActor(int index, bool addremove){
00061 manager->addRemoveActor(index, addremove);
00062 }
00063
00064 void PlaneDirectionViewer::changeColor(int index,double r,double g,double b){
00065 manager->changeColor(index, r,g,b);
00066 }
00067
00068 void PlaneDirectionViewer::WriteInformation(std::string filename, double* spc){
00069 manager->WriteInformation(filename,spc);
00070 }
00071
00072 void PlaneDirectionViewer::SetArrowSize(int arrowsize){
00073 manager->SetArrowSize(arrowsize);
00074 }
00075