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;
_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