]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/InterpreterBBS.cxx
no message
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / InterpreterBBS.cxx
index 7213b187e38ca2fac776273732396011927225a6..20088210306a3ead5603396abfc1b52601d9b55f 100644 (file)
@@ -46,16 +46,16 @@ Version:   $Revision$
 namespace bbtk
 {
 
-       
-
+       //=========================================================================
        InterpreterBBS::Pointer InterpreterBBS::New( wxVtkSceneManager* sceneManager,  Factory::Pointer factory )
        {
                     return MakePointer( new InterpreterBBS( sceneManager, factory) );
        }
+       //=========================================================================
 
        
+       
        //=========================================================================
-
        InterpreterBBS::InterpreterBBS( wxVtkSceneManager* sceneManager, Factory::Pointer factory )
        {               
                _factory                = factory;
@@ -64,58 +64,84 @@ namespace bbtk
                _xGeneral               = 10;
                _yGeneral               = 10;
                _zGeneral               = 900;   //  ?????
-               
+
+               _complexbox = false;
                bbtk::InterpreterVirtual::Init();
                
        }
-
        //=========================================================================
 
+       
+       //=========================================================================
        InterpreterBBS::~InterpreterBBS()
        {
        }
-
        //=========================================================================
        
        
+       //=========================================================================
        /// Creates a new black box in current complex box
-    void InterpreterBBS::commandNew( const std::string& boxType, const std::string& boxName)
+    void InterpreterBBS::commandNew( const std::string& boxType, const std::string& boxName) // virtual
        {
+               printf("EED InterpreterBBS::New\n");
                std::string packagename = _factory->GetPackageNameOfaBlackBox(boxType);
+               
                int idBox                               = _sceneManager->createGBlackBox( 0,0, packagename ,boxType);
                _sceneManager->configGBlackBox(idBox, _xGeneral,_yGeneral,_zGeneral,boxName, false , _xGeneral+100, _yGeneral-10 , _zGeneral );
+               
                _yGeneral = _yGeneral + 30;
        }
+       //=========================================================================
+
        
+       //=========================================================================
        /// Connects the output boxOutput to the input boxInput
-    void InterpreterBBS::commandConnect (const std::string &boxfrom,
+    void InterpreterBBS::commandConnection (const std::string &boxfrom,
                                                                  const std::string &output,
                                                                  const std::string &boxto,
-                                                                 const std::string &input)
+                                                                 const std::string &input)                     // virtual
        {
                printf("EED InterpreterBBS::Connect\n");
+               _sceneManager->configGConnetion(_complexbox, boxfrom,output,boxto,input);
        }
+       //=========================================================================
        
        
+       //=========================================================================
        /// sets the input of the box with the value
-    void InterpreterBBS::commandSet (const std::string &box, 
-                                                         const std::string &input, 
-                                                         const std::string &value)
+       void InterpreterBBS::commandSet(const std::string &box,const std::string &input,const std::string &value) // virtual
        {
                printf("EED InterpreterBBS::Set\n");
+               GBlackBoxModel *bbMod = _sceneManager->findGBox(box);
+               bbMod->setValueToInput(input,"\""+value+"\"");                                  
        }
+       //=========================================================================
        
 
+       //=========================================================================     
+       void InterpreterBBS::commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename) // virtual
+       {
+               _complexbox=true;
+       }
+       //=========================================================================
+
        
-       /// Loads a package
-    void InterpreterBBS::commandLoad(const std::string &name )
+       //=========================================================================
+       void InterpreterBBS::commandEndDefine() // virtual
        {
+               _complexbox=false;
        }
+       //=========================================================================
+       
        
-    /// Unloads a package
-    void InterpreterBBS::commandInclude(const std::string &name )
+       //=========================================================================
+       void InterpreterBBS::commandExec(const std::string &word) // virtual 
        {
+               GBlackBoxModel *bbMod = _sceneManager->findGBox(word);
+               bbMod->setExecutable(true);                             
        }
+       //=========================================================================
+       
        
        
 }  // EO namespace bbtk