+ if(_worldState==INIT_CREATION_CONTOUR)
+ {
+ bool isOverPort=false;
+ std::map<int, GObjectController*>::iterator it;
+ for(it = _controllers.begin(); it != _controllers.end() && isOverPort==false; ++it)
+ {
+ GObjectController *desc = it->second;
+ if(desc->getGObjectType()==GPORT)
+ {
+ GPortModel* portmod=(GPortModel*)desc->getModel();
+ vtkGObjectView* portView=desc->getView();
+ if(portmod->getPortType()==GINPUTPORT && portView->getState()==HIGHLIGHTED)
+ {
+ isOverPort=true;
+ }
+ }
+ }
+
+ if(isOverPort==false)
+ {
+ _worldState=NOTHING_HAPPENS;
+ int lastId = _controllers.size()-1;
+ GConnectorController *connector = (GConnectorController*)_controllers[lastId];
+ connector->removeFromScene();
+ unregisterController(connector);
+ _controllers.erase(lastId);
+
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *desc = it->second;
+ desc->SetActive(true);
+ desc->getView()->setState(NOTHING_HAPPENS);
+ desc->getModel()->notifyObservers(_idManager);
+ }
+ }
+ }