+ //=========================================================================
+
+
+
+ //=========================================================================
+ void wxVtkSceneManager::configGComBoxInputOutputPort(bool inputoutput, std::string portName, double xIn, double yIn,double zIn)
+ {
+ int idPort;
+ if (inputoutput==true)
+ {
+ idPort = createGComplexBoxInputPort(portName);
+ } else {
+ idPort = createGComplexBoxOutputPort(portName);
+ }
+ GObjectController *cont = _controllers[idPort];
+ GBoxModel *cbmod = (GBoxModel*)cont->getModel();
+ cbmod->setInicPoint(xIn,yIn,zIn);
+ cbmod->notifyObservers(_idManager);
+ }
+ //=========================================================================
+
+
+ //=========================================================================
+ GBoxModel* wxVtkSceneManager::findGBox(std::string boxname)
+ {
+ int j;
+ int idB;
+ GBoxModel *bMod;
+ GBoxModel *boxModel = NULL;
+ std::vector<int> lstB = getBlackBoxes();
+ for(j = 0;j<(int)lstB.size();j++)
+ {
+ idB = lstB[j];
+ bMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==boxname)
+ {
+ boxModel = bMod;
+ }
+ } // for
+
+ if((_isComplexBox) && (boxModel==NULL))
+ {
+ std::vector<int> lstInputs = getComplexInputPorts();
+ for(j = 0;j<(int)lstInputs.size();j++)
+ {
+ idB = lstInputs[j];
+ bMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==boxname)
+ {
+ boxModel = bMod;
+ }
+ } // for
+
+ std::vector<int> lstOutputs = getComplexOutputPorts();
+ for(j = 0;j<(int)lstOutputs.size();j++)
+ {
+ int idB = lstOutputs[j];
+ bMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==boxname)
+ {
+ boxModel = bMod;
+ }
+ } // for
+
+ } // complex box
+
+ return boxModel;
+ }
+
+ //=========================================================================
+
+
+ void wxVtkSceneManager::configGConnetion(std::string nameStartBox, std::string nameStartPort, std::string
+ nameEndBox, std::string nameEndPort)
+ {
+ printf("EED wxVtkSceneManager::configGConnetion 1 %s %s %s %s\n", nameStartBox.c_str(), nameStartPort.c_str(), nameEndBox.c_str(), nameEndPort.c_str() );
+
+ GBoxModel *boxModel;
+ GPortModel *startP = NULL;
+ GPortModel *endP = NULL;
+
+ boxModel= findGBox(nameStartBox);
+ if (boxModel!=NULL)
+ {
+ startP = boxModel->getOutputPort(nameStartPort);
+ }
+
+ boxModel= findGBox(nameEndBox);
+ if (boxModel!=NULL)
+ {
+ endP = boxModel->getInputPort(nameEndPort);
+ }
+
+
+ printf("EED wxVtkSceneManager::configGConnetion 2 %p %p \n", startP, endP );
+
+/*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
+
+ 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();
+ }
+
+ //=========================================================================
+
+ bool wxVtkSceneManager::boxExist(std::string boxname)
+ {
+ bool ok=false;
+ std::map<int, GObjectController*>::iterator it;
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *cont = it->second;
+ if(cont->getModel()->getBBTKName()==boxname)
+ {
+ ok=true;
+ }
+ }
+ return ok;
+ }