+ //=========================================================================
+
+ GBlackBoxModel* wxVtkSceneManager::findGBox(std::string boxname)
+ {
+ GBlackBoxModel *boxModel = NULL;
+ GBlackBoxModel *bbMod;
+ std::vector<int> lstB = getBlackBoxes();
+ int idB;
+ int j;
+ for(j = 0;j<(int)lstB.size();j++)
+ {
+ idB = lstB[j];
+ bbMod = (GBlackBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==boxname)
+ {
+ boxModel = bbMod;
+ }
+ } // for
+ return boxModel;
+ }
+
+ //=========================================================================
+
+
+ void wxVtkSceneManager::configGConnetion(bool _isComplexBox,
+ std::string nameStartBox, std::string nameStartPort, std::string
+ nameEndBox, std::string nameEndPort)
+ {
+ GPortModel *startP = findGBox(nameStartBox)->getOutputPort(nameStartPort);
+ GPortModel *endP = findGBox(nameEndBox)->getInputPort(nameEndPort);
+
+/*ups5 EED Borrame
+ std::vector<int> lstB = getBlackBoxes();
+ int j;
+ for(j = 0;j<(int)lstB.size();j++)
+ {
+ int idB = lstB[j];
+ GBlackBoxModel *bbMod = (GBlackBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==nameStartBox)
+ {
+ startP = bbMod->getOutputPort(nameStartPort);
+ }
+ else if(_controllers[idB]->getModel()->getBBTKName()==nameEndBox)
+ {
+ endP = bbMod->getInputPort(nameEndPort);
+ }
+ } // for
+*/
+ int j;
+ if(_isComplexBox)
+ {
+ if(startP==NULL)
+ {
+ std::vector<int> lstInputs = getComplexInputPorts();
+ for(j = 0;j<(int)lstInputs.size();j++)
+ {
+ int idB = lstInputs[j];
+ GBoxModel *cbMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==nameStartBox)
+ {
+ startP = cbMod->getOutputPort(nameStartPort);
+ } // if
+ } // for
+ } // if
+
+ if(endP==NULL)
+ {
+ std::vector<int> lstOutputs = getComplexOutputPorts();
+ for(j = 0;j<(int)lstOutputs.size();j++)
+ {
+ int idB = lstOutputs[j];
+ GBoxModel *cbMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==nameEndBox)
+ {
+ endP = cbMod->getInputPort(nameEndPort);
+ } // if
+ } // for
+ } // if endP
+ } // complex box
+
+ int idCon = createGConnector(startP);
+ _worldState = NOTHING_HAPPENS;
+ GConnectorController *tempp = (GConnectorController*)_controllers[idCon];
+
+ GConnectorModel *conMod = (GConnectorModel*)tempp->getModel();
+ vtkGConnectorView *conView = (vtkGConnectorView*)tempp->getView();
+ tempp->endContourCreation();
+ conMod->setEndPort(endP);
+ conView->updateStartEndPoints();
+ }
+