std::string wxVtkSceneManager::generateANewNameForABox()
{
- _numBoxes++;
std::stringstream boxname;
if(_numBoxes<10)
{
}else{
boxname << "Box" << _numBoxes;
}
+ _numBoxes++;
return boxname.str();
}
}
//=========================================================================
+//ups1 eed
+ void wxVtkSceneManager::configGBlackBox(int idBox, double xIn, double yIn, double zIn, std::string name, bool boxExecutable,double xEn,double yEn,double zEn)
+ {
+ GObjectController *cont = _controllers[idBox];
+ GBlackBoxModel *bbmod = (GBlackBoxModel*)cont->getModel();
+ bbmod->setBBTKName(name);
+ bbmod->setInicPoint(xIn,yIn,zIn);
+ bbmod->setFinalPoint(xEn,yEn,zEn);
+ bbmod->setExecutable(boxExecutable);
+
+ bbmod->notifyObservers(_idManager);
- int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, std::string boxType)
+ }
+
+
+ //=========================================================================
+
+ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, std::string boxType)
{
_worldState = NOTHING_HAPPENS;
- int windowWidth = _baseView->GetRenWin()->GetSize()[0];
+//EED int windowWidth = _baseView->GetRenWin()->GetSize()[0];
int windowHeight = _baseView->GetRenWin()->GetSize()[1];
int type = GBLACKBOX;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
model->setInicPoint(xx,yy,zz);
-//EED Borrame _numBoxes++;
std::stringstream stream;
- str:string newBoxName = findANewNameForABox();
+ std::string newBoxName;
+ newBoxName = findANewNameForABox();
+
+
stream << newBoxName;
-/* EED Borrame
- if(_numBoxes<10)
- {
- stream << "Box0" << _numBoxes;
- }
- else
- {
- stream << "Box" << _numBoxes;
- }
-*/
+
std::string arraystring = stream.str();
model->setBBTKName(arraystring);
int wxVtkSceneManager::createGComplexBoxInputPort(std::string inputName)
{
- int windowWidth=_baseView->GetRenWin()->GetSize()[0];
+//EED int windowWidth=_baseView->GetRenWin()->GetSize()[0];
int windowHeight=_baseView->GetRenWin()->GetSize()[1];
- int type = GCOMPLEXINPUTPORT;
+ int type = GCOMPLEXINPUTPORT;
//Create the MVC Objects
- GComplexBoxPortModel *model = (GComplexBoxPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
- vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
- GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+ GComplexBoxPortModel *model = (GComplexBoxPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
//Prepares the initial model
- double xx = 5;
- double yy = windowHeight-5;
+ double xx = 5;
+ double yy = windowHeight-5;
//z value is not important yet, because it is only used a parallel projection
- double zz = 900;
+ double zz = 900;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
model->setInicPoint(xx,yy,zz);
int wxVtkSceneManager::createGComplexBoxOutputPort(std::string outputName)
{
- int windowWidth=_baseView->GetRenWin()->GetSize()[0];
+//EED int windowWidth=_baseView->GetRenWin()->GetSize()[0];
int windowHeight=_baseView->GetRenWin()->GetSize()[1];
- int type = GCOMPLEXOUTPUTPORT;
+ int type = GCOMPLEXOUTPUTPORT;
//Create the MVC Objects
- GComplexBoxPortModel *model = (GComplexBoxPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
- vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
- GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
+ GComplexBoxPortModel *model = (GComplexBoxPortModel*)GObjectsMVCFactory::getInstance()->createGObjectModel(type);
+ vtkGObjectView *view = GObjectsMVCFactory::getInstance()->createGObjectView(type);
+ GObjectController* controller = GObjectsMVCFactory::getInstance()->createGObjectController(type);
//Prepares the initial model
- double xx = 5;
- double yy = windowHeight-5;
+ double xx = 5;
+ double yy = windowHeight-5;
//z value is not important yet, because it is only used a parallel projection
- double zz = 900;
+ double zz = 900;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
model->setInicPoint(xx,yy,zz);
{
if(command == ADD_TO_SELECTED)
{
- GObjectController* cont = _controllers[idController];
+//EED GObjectController* cont = _controllers[idController];
bool foundID=false;
- for (int i=0; i<_selectedObjects.size() && foundID==false; i++)
+ for (int i=0; i<(int)_selectedObjects.size() && foundID==false; i++)
{
int id = _selectedObjects[i];
if(id==idController)
if(_worldState == DRAG_OBJECTS)
{
- for (int i=0; i<_selectedObjects.size(); i++)
+ for (int i=0; i<(int)_selectedObjects.size(); i++)
{
int id = _selectedObjects[i];
GObjectController* cont = _controllers[id];
_worldState = DRAG_OBJECTS;
_startDragging = true;
- for (int i = 0; i < _selectedObjects.size(); i++)
+ for (int i = 0; i < (int)_selectedObjects.size(); i++)
{
int id = _selectedObjects[i];
GObjectController* cont = _controllers[id];
{
_worldState = NOTHING_HAPPENS;
- for (int i = 0; i < _selectedObjects.size(); i++)
+ for (int i = 0; i < (int)_selectedObjects.size(); i++)
{
int id = _selectedObjects[i];
GObjectController* cont = _controllers[id];
}
- for (int i = 0; i < _selectedObjects.size(); i++)
+ for (int i = 0; i < (int)_selectedObjects.size(); i++)
{
int id = _selectedObjects[i];
GObjectController* cont = _controllers[id];
{
if(type==GBLACKBOX)
{
- for (int i=0; i<_selectedObjects.size(); i++)
+ for (int i=0; i< (int)_selectedObjects.size(); i++)
{
int id = _selectedObjects[i];
GObjectController* control = _controllers[id];
std::string pkg = mod->getBBTKPackage();
bool existsPkg = false;
- for(int t = 0;t<packages.size() && existsPkg == false;t++)
+ for(int t = 0;t< (int)packages.size() && existsPkg == false;t++)
{
if(packages[t]==pkg)
{
script+="include std\n"; // EED
script+="include itkvtk\n"; // EED
int i;
- for(i = 0; i<packages.size();i++)
+ for(i = 0; i< (int)packages.size();i++)
{
script+="include ";
script+=packages[i];
// script+="include std\n"; // JPR
- for(i = 0; i<boxes.size();i++)
+ for(i = 0; i < (int)boxes.size();i++)
{
script+="new ";
int id = boxes[i];
script+="\n";
std::vector<GPortModel*> inputs = model->getInputPorts();
- for(int j = 0; j<inputs.size();j++)
+ for(int j = 0; j < (int)inputs.size();j++)
{
GPortModel* inputPort = inputs[j];
if(inputPort->isValueSet())
}
- for(i = 0; i<connections.size();i++)
+ for(i = 0; i<(int)connections.size();i++)
{
script+="connect ";
int id = connections[i];
std::string pkg = mod->getBBTKPackage();
bool existsPkg = false;
- for(int t = 0;t<packages.size() && existsPkg == false;t++)
+ for(int t = 0;t<(int)packages.size() && existsPkg == false;t++)
{
if(packages[t]==pkg)
{
script+="include std\n"; // EED
script+="include itkvtk\n"; // EED
int i;
- for(i = 0; i<packages.size();i++)
+ for(i = 0; i<(int)packages.size();i++)
{
script+="include ";
script+=packages[i];
script+="\n";
std::vector<GPortModel*> inputs = model->getInputPorts();
- for(int j = 0; j<inputs.size();j++)
+ for(int j = 0; j<(int)inputs.size();j++)
{
GPortModel* inputPort = inputs[j];
if(inputPort->isValueSet())
std::string complexInputs="";
std::string complexOutputs="";
- for(i = 0; i<connections.size();i++)
+ for(i = 0; i<(int)connections.size();i++)
{
int id = connections[i];
GObjectController *control = _controllers[id];
}
}
- for(i = 0; i<execBoxes.size();i++)
+ for(i = 0; i<(int)execBoxes.size();i++)
{
script+="exec ";
int id = execBoxes[i];
getline(inputStream,line);//FIN_COMPLEX_PORT
+
int idOutputPort = createGComplexBoxOutputPort(outputPortName);
GObjectController *cont = _controllers[idOutputPort];
GBoxModel *cbmod = (GBoxModel*)cont->getModel();
std::istringstream zEt(zEnd);
zEt >> zEn;
- int idBox = createGBlackBox(0,0,package,type);
- GObjectController *cont = _controllers[idBox];
- GBlackBoxModel *bbmod = (GBlackBoxModel*)cont->getModel();
- bbmod->setBBTKName(name);
- bbmod->setInicPoint(xIn,yIn,zIn);
- bbmod->setFinalPoint(xEn,yEn,zEn);
-
+ bool boxExecutable=false;
if(isExec=="TRUE")
{
- bbmod->setExecutable(true);
- }
- else if(isExec=="FALSE")
- {
- bbmod->setExecutable(false);
+ boxExecutable= true;
}
+
+ int idBox = createGBlackBox(xIn,yIn,package,type);
+ GObjectController *cont = _controllers[idBox];
+ GBlackBoxModel *bbmod = (GBlackBoxModel*)cont->getModel();
+ configGBlackBox(idBox, xIn,yIn,zIn,name, boxExecutable,xEn,yEn,zEn);
+
+
+//ups2 eed
+// GObjectController *cont = _controllers[idBox];
+// GBlackBoxModel *bbmod = (GBlackBoxModel*)cont->getModel();
+// bbmod->setBBTKName(name);
+// bbmod->setInicPoint(xIn,yIn,zIn);
+// bbmod->setFinalPoint(xEn,yEn,zEn);
+// bbmod->setExecutable(boxExecutable);
+
//----------
getline(inputStream,line);//PORT o FIN_BOX
port=line.substr(0,4);
} // while
- bbmod->notifyObservers(_idManager);
+//EED bbmod->notifyObservers(_idManager);
} // boxes
/// CONNECTIONS
std::vector<int> newInputConnections = newBox->getConnectedInputs();
std::vector<int> newOutputConnections = newBox->getConnectedOutputs();
- for(int k = 0; k<oldInputConnections.size();k++)
+ for(int k = 0; k<(int)oldInputConnections.size();k++)
{
bool exist=false;
- int toCreate=-1;
- for(int l = 0; l<newInputConnections.size() && !exist;l++)
+//EED int toCreate=-1;
+ for(int l = 0; l<(int)newInputConnections.size() && !exist;l++)
{
if(oldInputConnections[k]==newInputConnections[l])
{
}
- for(int k = 0; k<oldOutputConnections.size();k++)
+ for(int k = 0; k<(int)oldOutputConnections.size();k++)
{
bool exist=false;
- int toCreate=-1;
- for(int l = 0; l<newOutputConnections.size() && !exist;l++)
+//EED int toCreate=-1;
+ for(int l = 0; l<(int)newOutputConnections.size() && !exist;l++)
{
if(oldOutputConnections[k]==newOutputConnections[l])
{