#include "bbcreaMaracasVisuIRMViewer.h" #include "bbcreaMaracasVisuPackage.h" #include "wxMaracasIRMView.h" namespace bbcreaMaracasVisu { BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,IRMViewer) BBTK_BLACK_BOX_IMPLEMENTATION(IRMViewer,bbtk::WxBlackBox); void IRMViewer::Process() { wxMaracasIRMView* irmview = wxMaracasIRMView::getInstance(); std::vector tempvect; int i; if(irmview != NULL){ vtkRenderer* renderer = bbGetInputRenderer(); irmview->setRenderer(renderer); vtkProp3D* prop3D; tempvect.push_back(bbGetInputIn0()); tempvect.push_back(bbGetInputIn1()); tempvect.push_back(bbGetInputIn2()); tempvect.push_back(bbGetInputIn3()); tempvect.push_back(bbGetInputIn4()); for(i = 0; i < tempvect.size();i++){ prop3D = tempvect[i]; if(prop3D != NULL&&renderer != NULL){ irmview->addProp3D(prop3D); } } } } void IRMViewer::CreateWidget(wxWindow* parent) { std::string path = ""; #if defined(WIN32) char currentPath[_MAX_PATH]; HMODULE hand = GetModuleHandle("bbcreaMaracasVisu"); GetModuleFileName(hand, currentPath, _MAX_PATH); path = currentPath; path = path.substr(0,path.find_last_of("\\")); #else if defined(UNIX) pid_t pid = getpid(); char buf[10]; sprintf(buf,"%d",pid); std::string _link = "/proc/"; _link.append( buf ); _link.append( "/exe"); char proc[512]; int ch = readlink(_link.c_str(),proc,512); if (ch != -1) { proc[ch] = 0; path = proc; std::string::size_type t = path.find_last_of("/"); path = path.substr(0,t); } #endif std::cout << "Your application's directory is: " << path; wxMaracasIRMView* irmview = wxMaracasIRMView::getInstance(parent,path); //GetDllDirectory(_MAX_PATH, currentPath); //std::cout << "Your application's directory is: " << GetDllDirectory(_MAX_PATH, currentPath)<