]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectsMVCFactory.cxx
Connection with BBTK and capturing black bbox descriptor
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsVtkGUIEditorGraphic / GObjectsMVCFactory.cxx
index a03ae69faab6ca4d9b7107828503f6f607f5721e..9a32bfe61573f323e1afc7c6ab17ce5b36dcccba 100644 (file)
@@ -44,8 +44,14 @@ namespace bbtk
 
        GObjectsMVCFactory* GObjectsMVCFactory:: instance = NULL;
        GObjectsMVCFactory::GObjectsMVCFactory()
-       {
-               
+       {               
+               _interpreter =Interpreter::New();
+               _interpreter->SetCommandLine(true);
+               std::stringstream* buf = new std::stringstream;
+               *buf << "exec freeze_no_error" << std::endl;
+               *buf << "message max 0" << std::endl; 
+               *buf << "include *" << std::endl;
+               _interpreter->InterpretBuffer(buf);     
        }
 
        //=========================================================================
@@ -55,7 +61,15 @@ namespace bbtk
        }
        //=========================================================================
 
+       BlackBoxDescriptor::Pointer GObjectsMVCFactory::getBlackBoxDescriptor(std::string packageName, std::string boxName)
+       {                       
+               Factory::Pointer factory = _interpreter->GetExecuter()->GetFactory();
+               Package::Pointer k = factory->GetPackage(packageName);
+               std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc = k->GetDescriptorMap();
+               return mapDesc[boxName];
+       }
 
+       //=========================================================================
        GObjectsMVCFactory* GObjectsMVCFactory :: getInstance()
        {
                if(instance == NULL){