X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FwxVtkSceneManager.cxx;h=3a411d84aae13f951de908eb7ca225c46b5dfe04;hb=e4d5a319ef249bde6c4f4ddfee66f6258558bf91;hp=bc9e4b53033c649d7a2ce7250bfdd11ae6e4487f;hpb=29e2cbfd540787fdf4ee0eb6ce04f424b49722d1;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index bc9e4b5..3a411d8 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -507,7 +507,11 @@ GPortController* wxVtkSceneManager::createGPort(int portType, //========================================================================= -int wxVtkSceneManager::createGConnector(GPortModel* startPort) { +int wxVtkSceneManager::createGConnector(GPortModel* startPort) +{ + + + int type = GCONNECTOR; manualConnectorContourController *manContourControl = new manualConnectorContourController(); @@ -530,6 +534,8 @@ int wxVtkSceneManager::createGConnector(GPortModel* startPort) { manContourView->SetColorEditContour(0.5, 0.5, 0.5); manContourView->SetColorSelectContour(1, 0.8, 0); + + /** * JGRR AND CM * Width increased from 2 to 3, it simplifies line handling and spline control :P @@ -677,6 +683,7 @@ void wxVtkSceneManager::update(int idController, int command) { // The last one is the controller of the connector std::map::iterator it2; + for (it2 = _controllers.begin(); it2 != _controllers.end(); ++it2) { GObjectController *cont = it2->second; if (cont->getGObjectType() == GPORT) { @@ -953,8 +960,10 @@ void wxVtkSceneManager::CancelConnection() //========================================================================= -bool wxVtkSceneManager::OnRightButtonUp() { - if (_worldState == INIT_CREATION_CONTOUR) { +bool wxVtkSceneManager::OnRightButtonUp() +{ + if (_worldState == INIT_CREATION_CONTOUR) + { CancelConnection(); } UnSelectBlackBoxes(); @@ -1079,8 +1088,21 @@ bool wxVtkSceneManager::OnChar() // KeyCode 127 : Delete Key // KeyCode 8 : Backspace Key + + + if (keyCode == 8 || keyCode == 127 || keyCode == 27) + { + if (_worldState == INIT_CREATION_CONTOUR) + { + CancelConnection(); + UnSelectBlackBoxes(); + } + } + + if (keyCode == 8 || keyCode == 127) { + for (int i = 0; i < (int) _selectedObjects.size(); i++) { int id = _selectedObjects[i];