wxMaracasSurfaceRendering Class Reference

#include <wxMaracasSurfaceRendering.h>

Collaboration diagram for wxMaracasSurfaceRendering:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxMaracasSurfaceRendering (wxWindow *parent, std::string path)
 ~wxMaracasSurfaceRendering ()
void setRenderer (vtkRenderer *renderer)
void setInteractor (vtkRenderWindowInteractor *interactor)
void changeOpacity (int propid, int value)
void changeIsoValue (int propid, double value)
void addRemoveActor (int propid, bool addremove)
void addRemoveSurfaceBox (int propid, bool addremove)
void changeColor (int propid, double red, double green, double blue)
void addProp3D (vtkProp3D *prop3D, std::string dataname="")
void addPropMHD (vtkImageData *imgdata, std::string dataname="")
void loadProp3D (wxString filename, wxString dataname)
void loadPropMHD (wxString filename, wxString dataname)
void onLoadImageFile ()
void addSurfaceRenderingPanel (wxMaracasSurfaceRenderingPanel *surrend, std::string dataname="")
std::string getPath ()
void deleteActor (int propid)
bool interactorSet ()

Static Public Member Functions

static wxMaracasSurfaceRenderinggetInstance (wxWindow *parent, std::string path="")
static wxMaracasSurfaceRenderinggetInstance ()

Private Member Functions

void createFileChooser ()

Private Attributes

wxMaracasSurfaceRenderingManagersurrendmanager
wxAuiManager * wxauimanager
wxToolBar * _toolb
std::string _path

Static Private Attributes

static wxMaracasSurfaceRenderinginstance = NULL

Detailed Description

Definition at line 31 of file wxMaracasSurfaceRendering.h.


Constructor & Destructor Documentation

wxMaracasSurfaceRendering::wxMaracasSurfaceRendering ( wxWindow *  parent,
std::string  path 
)

Definition at line 32 of file wxMaracasSurfaceRendering.cxx.

References _path, _toolb, createFileChooser(), surrendmanager, and wxauimanager.

Referenced by getInstance().

00033 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
00034 
00035         surrendmanager = new wxMaracasSurfaceRenderingManager();
00036 
00037         wxauimanager = new wxAuiManager(this);
00038 
00039         _path = path;
00040 
00041         std::string iconsdir = path;
00042         iconsdir+="/data/Icons";
00043         this->_toolb = new ToolBar(this,iconsdir);
00044         
00045         wxStaticText* txt = new wxStaticText(this, -1, wxString(_T("  Surface Rendering  ")));
00046         wxAuiPaneInfo paneinfo;
00047         wxauimanager->AddPane(txt,paneinfo.ToolbarPane().Top());
00048         wxauimanager->AddPane(_toolb,paneinfo.ToolbarPane().Top());
00049 
00050         wxauimanager->Update();
00051         createFileChooser();
00052 }

Here is the call graph for this function:

Here is the caller graph for this function:

wxMaracasSurfaceRendering::~wxMaracasSurfaceRendering (  ) 

Definition at line 53 of file wxMaracasSurfaceRendering.cxx.

References _toolb.

00053                                                       {
00054         delete _toolb;
00055 }


Member Function Documentation

void wxMaracasSurfaceRendering::addProp3D ( vtkProp3D *  prop3D,
std::string  dataname = "" 
)

Definition at line 209 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::addProp3D(), addSurfaceRenderingPanel(), and surrendmanager.

Referenced by loadProp3D().

00209                                                                               {
00210         try{
00211                 int id = surrendmanager->addProp3D(-1, prop3D,dataname);
00212                 if(id!=-1){
00213                         wxMaracasSurfaceRenderingPanel* controlpan = new wxMaracasSurfaceRenderingProp3D(this, id, false, -1);
00214                         addSurfaceRenderingPanel(controlpan, dataname);
00215                 }
00216         }catch(char* str){
00217                 std::cout << "Exception : " << str << '\n';
00218                 wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
00219                 diag->ShowModal();
00220                 delete diag;
00221         }
00222 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::addPropMHD ( vtkImageData *  imgdata,
std::string  dataname = "" 
)

Definition at line 178 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::addPropMHD(), addSurfaceRenderingPanel(), wxMaracasSurfaceRenderingManager::getMaxIsoValue(), and surrendmanager.

Referenced by loadPropMHD().

00178                                                                                    {
00179         try{
00180                 int id = surrendmanager->addPropMHD(-1, imgdata,dataname);
00181                 if(id!=-1){
00182 
00183                         wxMaracasSurfaceRenderingPanel* controlpan = new wxMaracasSurfaceRenderingProp3DMHD(this, id, false, -1);
00184                         int maxiso = surrendmanager->getMaxIsoValue(id);
00185                         ((wxMaracasSurfaceRenderingProp3DMHD*)controlpan)->createControls(maxiso);
00186                         addSurfaceRenderingPanel(controlpan, dataname);
00187                 }
00188 
00189         }catch(char* str){
00190 
00191                 std::cout << "Exception : " << str << '\n';
00192                 wxMessageDialog* diag = new wxMessageDialog(this, wxString( str,wxConvUTF8 ), wxString( str,wxConvUTF8 ), wxICON_ERROR);
00193                 diag->ShowModal();
00194                 delete diag;
00195         }
00196 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::addRemoveActor ( int  propid,
bool  addremove 
)

Definition at line 84 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::addRemoveActor(), and surrendmanager.

Referenced by wxMaracasSurfaceRenderingProp3D::onCheckBoxChange().

00084                                                                         {
00085         try{
00086                 surrendmanager->addRemoveActor(propid, addremove);
00087         }
00088         catch(char* str){
00089                 std::cout << "Exception : " << str << '\n';
00090                 wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
00091                 diag->ShowModal();
00092                 delete diag;
00093         }
00094 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::addRemoveSurfaceBox ( int  propid,
bool  addremove 
)

Definition at line 95 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::addRemoveSurfaceBox(), and surrendmanager.

Referenced by wxMaracasSurfaceRenderingProp3D::onCheckBoxSurfaceChange().

00095                                                                              {
00096         try{
00097                 surrendmanager->addRemoveSurfaceBox(propid, addremove);
00098         }
00099         catch(char* str){
00100                 std::cout << "Exception : " << str << '\n';
00101                 wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
00102                 diag->ShowModal();
00103                 delete diag;
00104         }
00105 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::addSurfaceRenderingPanel ( wxMaracasSurfaceRenderingPanel surrend,
std::string  dataname = "" 
)

Definition at line 223 of file wxMaracasSurfaceRendering.cxx.

References wxauimanager.

Referenced by addProp3D(), and addPropMHD().

00223                                                                                                                    {
00224 
00225         wxString s(dataname.c_str(),wxConvUTF8 );
00226         wxAuiPaneInfo paneinfo;
00227         wxauimanager->AddPane(surrend, paneinfo.DefaultPane().Centre().DestroyOnClose().Caption(s));
00228         wxauimanager->Update();
00229 }

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::changeColor ( int  propid,
double  red,
double  green,
double  blue 
)

Definition at line 132 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::changeColor(), and surrendmanager.

Referenced by wxMaracasSurfaceRenderingProp3D::onColorChange().

00132                                                                                             {
00133         try{
00134                 surrendmanager->changeColor(propid, red, green, blue);
00135 
00136         }catch(char* str){
00137 
00138                 wxString s( str,wxConvUTF8 );
00139                 wxMessageDialog* diag = new wxMessageDialog(this, s, s, wxICON_ERROR);
00140                 diag->ShowModal();
00141                 delete diag;
00142         }
00143 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::changeIsoValue ( int  propid,
double  value 
)

Definition at line 120 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::changeIsoValue(), and surrendmanager.

Referenced by wxMaracasSurfaceRenderingProp3DMHD::onIsoValueRelease().

00120                                                                       {
00121         try{
00122                 surrendmanager->changeIsoValue(propid, value);
00123         }
00124         catch(char* str){
00125                 std::cout << "Exception : " << str << '\n';
00126                 wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
00127                 diag->ShowModal();
00128                 delete diag;
00129         }
00130 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::changeOpacity ( int  propid,
int  value 
)

Definition at line 108 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::changeOpacity(), and surrendmanager.

Referenced by wxMaracasSurfaceRenderingProp3D::onOpacityRelease().

00108                                                                    {
00109         try{
00110                 surrendmanager->changeOpacity(_propid,value);
00111         }
00112         catch(char* str){
00113                 std::cout << "Exception : " << str << '\n';
00114                 wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
00115                 diag->ShowModal();
00116                 delete diag;
00117         }
00118 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::createFileChooser (  )  [private]

Definition at line 61 of file wxMaracasSurfaceRendering.cxx.

Referenced by wxMaracasSurfaceRendering().

00061                                                  {
00062 
00063 }

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::deleteActor ( int  propid  ) 

Definition at line 231 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::deleteActor(), and surrendmanager.

00231                                                      {
00232         try{
00233                 surrendmanager->deleteActor(propid);
00234         }catch(char* str){
00235                 //CPR
00236                 std::cout << "Exception : " << str << '\n';
00237                 wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
00238                 diag->ShowModal();
00239                 delete diag;
00240         }
00241 }

Here is the call graph for this function:

wxMaracasSurfaceRendering * wxMaracasSurfaceRendering::getInstance (  )  [static]
wxMaracasSurfaceRendering * wxMaracasSurfaceRendering::getInstance ( wxWindow *  parent,
std::string  path = "" 
) [static]

Definition at line 65 of file wxMaracasSurfaceRendering.cxx.

References instance, and wxMaracasSurfaceRendering().

00065                                                                                                 {
00066         if(instance==NULL){
00067                 instance = new wxMaracasSurfaceRendering(parent,path);
00068         }
00069         return instance;
00070 }

Here is the call graph for this function:

std::string wxMaracasSurfaceRendering::getPath (  ) 

Definition at line 57 of file wxMaracasSurfaceRendering.cxx.

References _path.

00057                                             {
00058         return _path;
00059 }

bool wxMaracasSurfaceRendering::interactorSet (  ) 

Definition at line 243 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::interactorSet(), and surrendmanager.

00243                                              {
00244         return surrendmanager->interactorSet();
00245 }

Here is the call graph for this function:

void wxMaracasSurfaceRendering::loadProp3D ( wxString  filename,
wxString  dataname 
)

Definition at line 198 of file wxMaracasSurfaceRendering.cxx.

References addProp3D(), wxMaracasSurfaceRenderingManager::getProp3D(), and surrendmanager.

Referenced by onLoadImageFile().

00198                                                                               {
00199         std::string s = std::string(filename.mb_str());
00200         vtkProp3D* prop3D = surrendmanager->getProp3D(s);
00201         if(prop3D != NULL){
00202                 s = std::string(dataname.mb_str() );
00203                 this->addProp3D(prop3D,s);
00204         }else{
00205                 //TODO msj to the user indicating error in file
00206         }
00207 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::loadPropMHD ( wxString  filename,
wxString  dataname 
)

Definition at line 168 of file wxMaracasSurfaceRendering.cxx.

References addPropMHD(), wxMaracasSurfaceRenderingManager::getImageData(), and surrendmanager.

Referenced by onLoadImageFile().

00168                                                                                {
00169 
00170         std::string s = std::string(filename.mb_str());
00171         vtkImageData* img = surrendmanager->getImageData(s);
00172         if(img!=NULL){
00173                 s = std::string(dataname.mb_str());
00174                 addPropMHD(img, s);
00175         }
00176 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::onLoadImageFile (  ) 

Definition at line 145 of file wxMaracasSurfaceRendering.cxx.

References loadProp3D(), and loadPropMHD().

Referenced by ToolBarEventHandler::onLoadImageFile().

00145                                                {
00146 
00147         wxString mhd(_T("mhd"));
00148         wxString stl(_T("stl"));
00149 
00150         wxFileDialog* fildial = new wxFileDialog(this, wxString(_T("Select a STL file")),wxString(_T("")),
00151                 wxString(_T("")),wxString(_T("STL files (*.stl)|*.stl|MHD files (*.mhd)|*.mhd")) );
00152 
00153         if(fildial->ShowModal()==wxID_OK){
00154         wxString filename = fildial->GetFilename();
00155                 wxString pathfile(fildial->GetDirectory() + _T("/") + filename);
00156 
00157                 if(filename.EndsWith(mhd))
00158                 {
00159                         loadPropMHD(pathfile,filename);
00160                 }
00161                 else if(filename.EndsWith(stl)){
00162             loadProp3D(pathfile,filename);
00163                 }
00164         }
00165         delete fildial;
00166 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxMaracasSurfaceRendering::setInteractor ( vtkRenderWindowInteractor *  interactor  ) 

Definition at line 80 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::setInteractor(), and surrendmanager.

00080                                                                                    {
00081         surrendmanager->setInteractor(interactor);
00082 }

Here is the call graph for this function:

void wxMaracasSurfaceRendering::setRenderer ( vtkRenderer *  renderer  ) 

Definition at line 76 of file wxMaracasSurfaceRendering.cxx.

References wxMaracasSurfaceRenderingManager::setRenderer(), and surrendmanager.

00076                                                                  {
00077         surrendmanager->setRenderer(renderer);
00078 }

Here is the call graph for this function:


Member Data Documentation

std::string wxMaracasSurfaceRendering::_path [private]

Definition at line 83 of file wxMaracasSurfaceRendering.h.

Referenced by getPath(), and wxMaracasSurfaceRendering().

wxToolBar* wxMaracasSurfaceRendering::_toolb [private]

Definition at line 75 of file wxMaracasSurfaceRendering.h.

Referenced by getInstance().

wxAuiManager* wxMaracasSurfaceRendering::wxauimanager [private]

The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1