-/*=========================================================================
+/*=========================================================================
Program: bbtk
Module: $RCSfile$
Language: C++
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
*
-* This software is governed by the CeCILL-B license under French law and
-* abiding by the rules of distribution of free software. You can use,
-* modify and/ or redistribute the software under the terms of the CeCILL-B
-* license as circulated by CEA, CNRS and INRIA at the following URL
-* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+* This software is governed by the CeCILL-B license under French law and
+* abiding by the rules of distribution of free software. You can use,
+* modify and/ or redistribute the software under the terms of the CeCILL-B
+* license as circulated by CEA, CNRS and INRIA at the following URL
+* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
-* liability.
+* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
-* ------------------------------------------------------------------------ */
+* ------------------------------------------------------------------------ */
/**
-* \file
-* \brief Class bbtk::InterpreterBBS
+* \file
+* \brief Class bbtk::InterpreterBBS
*/
}
//=========================================================================
-
-
+
+
//=========================================================================
InterpreterBBS::InterpreterBBS( wxVtkSceneManager* sceneManager, Factory::Pointer factory )
- {
+ {
_factory = factory;
_sceneManager = sceneManager;
-
+
_xGeneral = -100;
_yGeneral = 100;
_zGeneral = 900; // ?????
_countOutputs = 0;
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) // virtual
{
- _yGeneral = _yGeneral - 30;
+ _yGeneral = _yGeneral - 30;
std::string packagename = _factory->GetPackageNameOfaBlackBox(boxType);
int idBox = _sceneManager->createGBlackBox( 0,0, packagename ,boxType);
_countBoxes++;
double px = _xGeneral + (_countBoxes%2)*100;
double py = _yGeneral;
-
- _sceneManager->configGBlackBox(idBox, px,py,_zGeneral,boxName, false , px+100, py-10 , _zGeneral );
+
+ _sceneManager->configGBlackBox(idBox, px,py,_zGeneral,boxName, false , px+100, py-10 , _zGeneral );
}
//=========================================================================
-
+
//=========================================================================
/// Connects the output boxOutput to the input boxInput
void InterpreterBBS::commandConnection (const std::string &boxfrom,
_sceneManager->configGConnetion( boxfrom,output,boxto,input);
}
//=========================================================================
-
-
+
+
//=========================================================================
void InterpreterBBS::commandInput(const std::string &name,const std::string &box,const std::string &input,const std::string &help)
{
double xIn = -100+50+_countInputs*50;
- double yIn = 100;
- double zIn = 900;
+ double yIn = 100;
+ double zIn = 900;
_sceneManager->configGComBoxInputOutputPort(true,name,xIn,yIn,zIn);
_sceneManager->configGConnetion( name,name,box,input);
_countInputs++;
-
- printf("EED InterpreterBBS::commandInput what to do with help information ..???? \n ");
+
+ printf("EED InterpreterBBS::commandInput what to do with help information ..???? \n ");
}
//=========================================================================
-
+
//=========================================================================
void InterpreterBBS::commandOutput(const std::string &name,const std::string &box,const std::string &output,const std::string &help)
{
- _yGeneral = _yGeneral - 30;
+ _yGeneral = _yGeneral - 30;
double xIn = -100+_countOutputs*30;
- double yIn = _yGeneral;
- double zIn = 900;
+ double yIn = _yGeneral;
+ double zIn = 900;
_sceneManager->configGComBoxInputOutputPort(false,name,xIn,yIn,zIn);
_sceneManager->configGConnetion( box,output,name,name);
_countOutputs++;
-
- printf("EED InterpreterBBS::commandInput what to do with help information ..???? \n ");
+
+ printf("EED InterpreterBBS::commandInput what to do with help information ..???? \n ");
}
//=========================================================================
-
-
+
+
//=========================================================================
/// sets the input of the box with the value
void InterpreterBBS::commandSet(const std::string &box,const std::string &input,const std::string &value) // virtual
{
GBlackBoxModel *bbMod = (GBlackBoxModel *)_sceneManager->findGBox(box);
- bbMod->setValueToInput(input,"\""+value+"\"");
+ bbMod->setValueToInput(input,"\""+value+"\"");
}
//=========================================================================
-
- //=========================================================================
+
+ //=========================================================================
void InterpreterBBS::commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename) // virtual
{
_sceneManager->setComplexBox(true);
-
+ _sceneManager->SetCbName(name);
+ _sceneManager->SetCbPackageName(pack);
}
//=========================================================================
-
+
//=========================================================================
void InterpreterBBS::commandEndDefine() // virtual
{
}
//=========================================================================
-
-
+
+
//=========================================================================
- void InterpreterBBS::commandExec(const std::string &word) // virtual
+ void InterpreterBBS::commandExec(const std::string &word) // virtual
{
GBlackBoxModel *bbMod = (GBlackBoxModel *)_sceneManager->findGBox(word);
- bbMod->setExecutable(true);
+ bbMod->setExecutable(true);
}
//=========================================================================
-
+
//=========================================================================
- void InterpreterBBS::commandAuthor(const std::string &author) // virtual
+ void InterpreterBBS::commandAuthor(const std::string &author) // virtual
{
- printf("EED InterpreterBBS::commandAuthor Warning !!!!! method not implemented.. \n");
+ _sceneManager->SetAuthor(author);
}
//=========================================================================
-
+
//=========================================================================
void InterpreterBBS::commandCategory(const std::string &categorytype) // virtual
{
- printf("EED InterpreterBBS::commandCategory Warning !!!!! method not implemented.. \n");
+ _sceneManager->SetCategory(categorytype);
}
//=========================================================================
-
+
//=========================================================================
void InterpreterBBS::commandDescription(const std::string &description) // virtual
{
- printf("EED InterpreterBBS::commandDescription Warning !!!!! method not implemented.. \n");
+ _sceneManager->SetDescription(description);
}
//=========================================================================
-
-
-
-
-
+
+
+
+
+
} // EO namespace bbtk
// EOF
wxString fileName = openFileDialog->GetPath( );
- _tabsMgr->addNewTab();
+ _tabsMgr->addNewTab( openFileDialog->GetFilename() );
bbtk::InterpreterBBS::Pointer I = bbtk::InterpreterBBS::New( this->_tabsMgr->getActualTabPanel()->getSceneManager() , _pkgBrowser->GetFactory());
std::string content="";
// writing file header
content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.1 BBS BlackBox Script\n";
+ content += "# - BBTKGEditor v 1.2 BBS BlackBox Script\n";
content += "# - ";
content += filename;
content += "\n";
}
- //=========================================================================
+ void wxGUIEditorGraphicBBS::AskComplexBoxConfiguration()
+ {
+ std::string cbName = _tabsMgr->GetCbName();
+ std::string paName = _tabsMgr->GetCbPackageName();
- void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename)
- {
wxTextEntryDialog *cbNameDialog = new wxTextEntryDialog(this,wxT("Complex Box name"));
- cbNameDialog->SetValue(_T("BBBBoxName"));
- std::string cbName="";
+ wxTextEntryDialog *paNameDialog = new wxTextEntryDialog(this,wxT("Package name"));
+
+ cbNameDialog->SetValue( wxString(cbName.c_str(),wxConvUTF8) );
+ paNameDialog->SetValue( wxString(paName.c_str(),wxConvUTF8) );
+
if (cbNameDialog->ShowModal() == wxID_OK)
{
wxString complexboxname = cbNameDialog->GetValue();
cbName=(const char*) (complexboxname.mb_str());
}
- wxTextEntryDialog *paNameDialog = new wxTextEntryDialog(this,wxT("Package name"));
- paNameDialog->SetValue(_T("PPPPackageName"));
- std::string paName="";
+
if (paNameDialog->ShowModal() == wxID_OK)
{
wxString packagename = paNameDialog->GetValue();
paName=(const char*) (packagename.mb_str());
}
- if( (!cbName.empty()) || (!paName.empty()) )
- {
+ _tabsMgr->SetCbName(cbName);
+ _tabsMgr->SetCbPackageName(paName);
+ }
- ofstream file;
- file.open( filename.c_str() );
-
- std::string content="";
-
- // writing file header
- content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.1 BBS BlackBox Script (Complex Box)\n";
- content += "# - ";
- content += filename;
- content += "\n";
- content += "# ----------------------------------\n";
- content += "\n";
- content += _tabsMgr->getActualComplexBoxBBS(cbName,paName);
- file << content;
- file.close();
- }
+ //=========================================================================
+ void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename)
+ {
+ ofstream file;
+ file.open( filename.c_str() );
+
+ std::string content="";
+ // writing file header
+ content += "# ----------------------------------\n";
+ content += "# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)\n";
+ content += "# - ";
+ content += filename;
+ content += "\n";
+ content += "# ----------------------------------\n";
+ content += "\n";
+ content += _tabsMgr->getActualComplexBoxBBS();
+ file << content;
+ file.close();
}
//=========================================================================
// writing file header
content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.1 BBG BlackBox Diagram file\n";
+ content += "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file\n";
content += "# - ";
content += filename;
wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual diagram"),wxEmptyString,wxT("NewDiagram"),wxT("*.bbg"),wxSAVE|wxOVERWRITE_PROMPT);
if (saveFileDialog->ShowModal() == wxID_OK)
{
- wxString fileName = saveFileDialog->GetPath();
- std::string filename = (const char*) (fileName.mb_str());
- std::string filenamebbs = filename;
- filenamebbs[filename.length()-1]='s';
+ _tabsMgr->SetNameTabPanel( saveFileDialog->GetFilename() );
+
+ wxString pathfileName = saveFileDialog->GetPath();
+ std::string pathfilename = (const char*) (pathfileName.mb_str());
+ std::string pathfilenamebbs = pathfilename;
+ pathfilenamebbs[pathfilenamebbs.length()-1]='s';
- SaveActualDiagram( filename );
if (_tabsMgr->isActualDiagramComplexBox()==false)
{
- SaveActualBBS(filenamebbs);
+ SaveActualDiagram( pathfilename );
+ SaveActualBBS(pathfilenamebbs);
} else {
- SaveActualComplexBox(filenamebbs);
+ AskComplexBoxConfiguration();
+ SaveActualDiagram( pathfilename );
+ SaveActualComplexBox(pathfilenamebbs);
} //if isActualDiagramComplexBox
} // if saveFileDialog
}
{
wxString fileName = openFileDialog->GetPath();
ifstream inputStream;
-//EED inputStream.open(fileName.c_str());
- inputStream.open( (const char*) (fileName.mb_str()) );
- _tabsMgr->addNewTab();
+ std::string fName=(const char*) (fileName.mb_str());
+ inputStream.open( fName.c_str() );
+ _tabsMgr->addNewTab( openFileDialog->GetFilename() );
+
_tabsMgr->loadDiagram(inputStream);
inputStream.close();
void refreshGUIControls();
void SaveActualBBS(std::string filename);
+ void AskComplexBoxConfiguration();
void SaveActualComplexBox(std::string filename);
void SaveActualDiagram(std::string filename);
//=========================================================================
- std::string wxGEditorTabPanel::saveComplexBoxBBS(std::string cbName, std::string paName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+ std::string wxGEditorTabPanel::saveComplexBoxBBS()
{
- return _sceneManager->saveComplexBoxBBS(cbName,paName,cbAuthor,cbCategory,cbDescription);
+ return _sceneManager->saveComplexBoxBBS();
}
//=========================================================================
return _sceneManager;
}
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetCbName()
+ {
+ return _sceneManager->GetCbName();
+ }
+
+
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetCbPackageName()
+ {
+ return _sceneManager->GetCbPackageName();
+ }
+
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetAuthor()
+ {
+ return _sceneManager->GetAuthor();
+ }
+
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetDescription()
+ {
+ return _sceneManager->GetDescription();
+ }
+
+ //=========================================================================
+ std::string wxGEditorTabPanel::GetCategory()
+ {
+ return _sceneManager->GetCategory();
+ }
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetCbName(std::string cbName)
+ {
+ _sceneManager->SetCbName( cbName );
+ }
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetCbPackageName(std::string packagename)
+ {
+ _sceneManager->SetCbPackageName( packagename );
+ }
+
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetAuthor(std::string author)
+ {
+ _sceneManager->SetAuthor( author );
+ }
+
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetCategory(std::string category)
+ {
+ _sceneManager->SetCategory( category );
+ }
+
+
+ //=========================================================================
+ void wxGEditorTabPanel::SetDescription(std::string description)
+ {
+ _sceneManager->SetDescription( description );
+ }
+
+
+
+
+
+
+
} // EO namespace bbtk
// Saves the actual BBS as complex box
// RaC TOFIX It must be included the package of the complex box
- std::string saveComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+ std::string saveComplexBoxBBS();
// Shows the dialog to edit black box parameters
void editBlackBox(GBlackBoxModel *bbmodel);
// Receives the string from a drag and drop source as for example the BBTK Package Browser
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
-
wxVtkSceneManager* getSceneManager();
+
+
+ void SetCbName(std::string cbName);
+ void SetCbPackageName(std::string packagename);
+ void SetAuthor(std::string author);
+ void SetCategory(std::string category);
+ void SetDescription(std::string description);
+ std::string GetCbName();
+ std::string GetCbPackageName();
+ std::string GetAuthor();
+ std::string GetDescription();
+ std::string GetCategory();
+
+
+
//=========================================================================
private:
}
//=========================================================================
- void wxTabPanelsManager::addNewTab()
+ void wxTabPanelsManager::addNewTab(wxString tabName)
{
_lastId++;
wxGEditorTabPanel *newPanel = new wxGEditorTabPanel(_notebook,_lastId);
newPanel->setPanelsManager(this);
_panels[_lastId] = newPanel;
_actual = newPanel;
- _notebook->AddPage(newPanel,_T("Diagram"),true);
+ _notebook->AddPage(newPanel, tabName ,true);
}
//=========================================================================
//=========================================================================
- std::string wxTabPanelsManager::getActualComplexBoxBBS(std::string cbName, std::string paName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+ std::string wxTabPanelsManager::getActualComplexBoxBBS()
{
- return _actual->saveComplexBoxBBS(cbName,paName,cbAuthor,cbCategory,cbDescription);
+ return _actual->saveComplexBoxBBS();
}
//=========================================================================
void wxTabPanelsManager::OnTabChanged(wxAuiNotebookEvent& event)
{
-printf("wxTabPanelsManager::OnTabChanged \n");
int index = event.GetSelection();
wxGEditorTabPanel* tab = (wxGEditorTabPanel*)_notebook->GetPage(index);
int id = tab->getPanelId();
}
//=========================================================================
+ std::string wxTabPanelsManager::GetCbName()
+ {
+ return _actual->GetCbName();
+ }
+
+ void wxTabPanelsManager::SetNameTabPanel(wxString tabpanelname)
+ {
+ int id = _notebook->GetSelection();
+ _notebook->SetPageText( id , tabpanelname );
+ }
+
+
+
+ //=========================================================================
+ std::string wxTabPanelsManager::GetCbPackageName()
+ {
+ return _actual->GetCbPackageName();
+ }
+
+ //=========================================================================
+ std::string wxTabPanelsManager::GetAuthor()
+ {
+ return _actual->GetAuthor();
+ }
+
+ //=========================================================================
+ std::string wxTabPanelsManager::GetDescription()
+ {
+ return _actual->GetDescription();
+ }
+
+ //=========================================================================
+ std::string wxTabPanelsManager::GetCategory()
+ {
+ return _actual->GetCategory();
+ }
+
+ //=========================================================================
+ void wxTabPanelsManager::SetCbName(std::string cbName)
+ {
+ _actual->SetCbName( cbName );
+ }
+
+ //=========================================================================
+ void wxTabPanelsManager::SetCbPackageName(std::string packagename)
+ {
+ _actual->SetCbPackageName( packagename );
+ }
+
+
+ //=========================================================================
+ void wxTabPanelsManager::SetAuthor(std::string author)
+ {
+ _actual->SetAuthor( author );
+ }
+
+
+ //=========================================================================
+ void wxTabPanelsManager::SetCategory(std::string category)
+ {
+ _actual->SetCategory( category );
+ }
+
+
+ //=========================================================================
+ void wxTabPanelsManager::SetDescription(std::string description)
+ {
+ _actual->SetDescription( description );
+ }
+
+
+
+
+
+
+
wxTabPanelsManager(wxGUIEditorGraphicBBS *parent);
~wxTabPanelsManager();
- void addNewTab();
+ void addNewTab(wxString tabName=_T("<void>"));
wxAuiNotebook* getAuiNotebook();
wxGEditorTabPanel* getActualTabPanel();
void updateStatusBar(std::string textStatus);
std::string getActualDiagramBBS(bool wln=false);
- std::string getActualComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+ std::string getActualComplexBoxBBS();
void editBlackBox(GBlackBoxModel *bbmodel);
void deleteAllBoxesActualDiagram();
void OnTabChanged(wxAuiNotebookEvent& event);
void VerifyLastTabPanel();
+ void SetCbName(std::string cbName);
+ void SetCbPackageName(std::string packagename);
+ void SetAuthor(std::string author);
+ void SetCategory(std::string category);
+ void SetDescription(std::string description);
+ std::string GetCbName();
+ std::string GetCbPackageName();
+ std::string GetAuthor();
+ std::string GetDescription();
+ std::string GetCategory();
+
+ void SetNameTabPanel(wxString tabpanelname);
+
+
+
private:
// Private Attributes
//=========================================================================
wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView,int idManager)
{
+ _cbName = "ComplexBoxName";
+ _cbPackageName = "PackageName";
+ _Author = "Author ??";
+ _Category = "<VOID>";
+ _Description = "Description ??";
+
_parent = parent;
_numBoxes = 0;
_idManager = idManager;
script+=LineNumber(wln,lnNmbr);
script+="\n";
+
+//ups2
+
+ script+=LineNumber(wln,lnNmbr);
+ script+="author \"";
+ script+=_Author;
+ script+="\"\n";
+
+ script+=LineNumber(wln,lnNmbr);
+ script+="description \"";
+ script+=_Description;
+ script+="\"\n";
+
+ script+=LineNumber(wln,lnNmbr);
+ script+="category \"";
+ script+=_Category;
+ script+="\"\n";
+
+ script+=LineNumber(wln,lnNmbr);
+ script+="\n";
+
+
// script+="include std\n"; // JPR
for(i = 0; i < (int)boxes.size();i++)
//=========================================================================
- std::string wxVtkSceneManager::saveComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+ std::string wxVtkSceneManager::saveComplexBoxBBS()
{
-
std::vector<std::string> packages;
std::vector<int> boxes;
std::vector<int> connections;
}
script+="\n";
+
// Definition of a complex box
script+="define ";
- script+=cbName+" "+paName;
+ script+=_cbName+" "+_cbPackageName;
script+="\n";
script+="\n";
- script+="author \" ";
- script+=cbAuthor;
+ script+="author \"";
+ script+=_Author;
script+="\"\n";
- script+="description \" ";
- script+=cbDescription;
+ script+="description \"";
+ script+=_Description;
script+="\"\n";
script+="\n";
+ script+="category \"";
+ script+=_Category;
+ script+="\"\n";
+ script+="\n";
+
+
// Create boxes
for(i = 0; i<(int)boxes.size();i++)
{
{
char buffer [50];
+ content+="CATEGORY:";
+ content+=GetCategory();
+ content+="\n";
+
+ content+="DESCRIPTION:";
+ content+=GetDescription();
+ content+="\n";
+
+ content+="AUTHOR:";
+ content+=GetAuthor();
+ content+="\n";
+
+
//Print info IF COMPLEX BOX
content+="COMPLEXBOX:";
if(_isComplexBox)
{
content+="TRUE\n";
+//ups1
+ content+="COMPLEXBOXNAME:";
+ content+=GetCbName();
+ content+="\n";
+
+ content+="PACKAGENAME:";
+ content+=GetCbPackageName();
+ content+="\n";
//Print info complex input ports
std::vector<int> inputs = getComplexInputPorts();
void wxVtkSceneManager::loadDiagram(ifstream &inputStream)
{
- std::string version;
+ std::string version="<void>";
std::string line="";
char delims[] = ":";
char *result = NULL;
if (line=="# - BBTKGEditor v 1.0 BBG BlackBox Diagram file")
{
version=line.substr(18,3);
- printf("EED wxVtkSceneManager::loadDiagram version=%s\n",version.c_str());
}
-
+ if (line=="# - BBTKGEditor v 1.1 BBG BlackBox Diagram file")
+ {
+ version=line.substr(18,3);
+ }
+ if (line=="# - BBTKGEditor v 1.2 BBG BlackBox Diagram file")
+ {
+ version=line.substr(18,3);
+ }
}
else if(line=="APP_START")
{
}
}
+ printf("EED wxVtkSceneManager::loadDiagram version=%s\n",version.c_str());
+
if(start)
{
+ if ((version!="1.0") && (version!="1.1"))
+ {
+ getline(inputStream,line);//CATEGORY:<category of the box>
+ char categoryTmp[30];
+ strcpy( categoryTmp, line.c_str() );
+ result = strtok( categoryTmp, delims );
+ result = strtok( NULL, delims );
+ SetCategory(result);
+
+ getline(inputStream,line);//DESCRIPTION:<description of the box>
+ char descriptionTmp[1024];
+ strcpy( descriptionTmp, line.c_str() );
+ result = strtok( descriptionTmp, delims );
+ result = strtok( NULL, delims );
+ SetDescription(result);
+
+ getline(inputStream,line);//AUTHOR:<author>
+ char authorTmp[255];
+ strcpy( authorTmp, line.c_str() );
+ result = strtok( authorTmp, delims );
+ result = strtok( NULL, delims );
+ SetAuthor(result);
+ }
+
//----------
getline(inputStream,line);//COMPLEX_BOX:TRUE|FALSE
- char complex[30];
- strcpy( complex, line.c_str() );
- result = strtok( complex, delims );
+ char complexTmp[30];
+ strcpy( complexTmp, line.c_str() );
+ result = strtok( complexTmp, delims );
result = strtok( NULL, delims );
std::string isComplexBox(result);
{
_isComplexBox=true;
+ if ((version!="1.0") && (version!="1.1"))
+ {
+ getline(inputStream,line);//COMPLEXNAME:<name of the complex box>
+ char complexboxnameTmp[255];
+ strcpy( complexboxnameTmp, line.c_str() );
+ result = strtok( complexboxnameTmp, delims );
+ result = strtok( NULL, delims );
+ SetCbName(result);
+
+ getline(inputStream,line);//PACKAGENAME:<name of the package of the box>
+ char packagenameTmp[255];
+ strcpy( packagenameTmp, line.c_str() );
+ result = strtok( packagenameTmp, delims );
+ result = strtok( NULL, delims );
+ SetCbPackageName(result);
+ }
+
+
//-----------------------
//- COMPLEX INPUT PORTS
//-----------------------
//=========================================================================
- void wxVtkSceneManager::SetComplexBoxName(std::string cbName)
+ void wxVtkSceneManager::SetCbName(std::string cbName)
+ {
+ _cbName=cbName;
+ if (_cbName=="")
+ {
+ _cbName="<complex box name>";
+ }
+ }
+
+ //=========================================================================
+ std::string wxVtkSceneManager::GetCbName()
+ {
+ return _cbName;
+ }
+
+ //=========================================================================
+ void wxVtkSceneManager::SetCbPackageName(std::string packagename)
{
- _complexBoxName=cbName;
+ _cbPackageName=packagename;
+ if (_cbPackageName=="")
+ {
+ _cbPackageName="<package name of the complex box>";
+ }
}
//=========================================================================
- std::string wxVtkSceneManager::GetComplexBoxName()
+ std::string wxVtkSceneManager::GetCbPackageName()
{
- return _complexBoxName;
+ return _cbPackageName;
}
+ //=========================================================================
+ void wxVtkSceneManager::SetAuthor(std::string author)
+ {
+ _Author=author;
+ if (_Author=="")
+ {
+ _Author="<author of the box>";
+ }
+ }
//=========================================================================
- void wxVtkSceneManager::SetPackageName(std::string paName)
+ std::string wxVtkSceneManager::GetAuthor()
{
- _packageName=paName;
+ return _Author;
}
//=========================================================================
- std::string wxVtkSceneManager::GetPackageName()
+ void wxVtkSceneManager::SetCategory(std::string category)
{
- return _packageName;
+ _Category=category;
+ if (_Category=="")
+ {
+ _Category="<category of the box>";
+ }
}
//=========================================================================
+ std::string wxVtkSceneManager::GetCategory()
+ {
+ return _Category;
+ }
+
+ //=========================================================================
+ void wxVtkSceneManager::SetDescription(std::string description)
+ {
+ _Description=description;
+ if (_Description=="")
+ {
+ _Description="<description of the box>";
+ }
+ }
+
+ //=========================================================================
+ std::string wxVtkSceneManager::GetDescription()
+ {
+ return _Description;
+ }
+
+ //=========================================================================
+
+
+
+
+
} // EO namespace bbtk
std::string getDiagramBBS(bool wln=false);
//Returns a string with the BBS script of the complex box.
- std::string saveComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+ std::string saveComplexBoxBBS();
//Delete the object in the list of controllers with the id given by parameter.
void deleteObject(int id);
std::string findANewNameForABox();
//-------
- void SetComplexBoxName(std::string cbName);
- void SetPackageName(std::string paName);
- std::string GetComplexBoxName();
- std::string GetPackageName();
+ void SetCbName(std::string cbNane);
+ void SetCbPackageName(std::string packagename);
+ void SetAuthor(std::string author);
+ void SetCategory(std::string category);
+ void SetDescription(std::string description);
+
+ std::string GetCbName();
+ std::string GetCbPackageName();
+ std::string GetAuthor();
+ std::string GetCategory();
+ std::string GetDescription();
private:
- std::string _complexBoxName;
- std::string _packageName;
+ std::string _cbName;
+ std::string _cbPackageName;
+ std::string _Author;
+ std::string _Category;
+ std::string _Description;
//wxPanel that uses the manager
wxGEditorTabPanel *_parent;