+ int X,Y;
+ wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(X,Y);
+
+
+ if(_worldState == DRAG_OBJECTS)
+ {
+ for (int i=0; i<_selectedObjects.size(); i++)
+ {
+ int id = _selectedObjects[i];
+ GObjectController* cont = _controllers[id];
+ if(_startDragging)
+ {
+ cont->getView()->setStartDragging(true);
+ }
+ cont->getView()->moveObject(X,Y);
+ cont->getView()->setState(DRAG);
+ cont->getModel()->notifyObservers(_idManager);
+ }
+
+ std::map<int, GObjectController*>::iterator it;
+
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *desc = it->second;
+ if(desc->getGObjectType()==GCONNECTOR)
+ {
+ GConnectorView* vconn = (GConnectorView*)desc->getView();
+ vconn->updateStartEndPoints();
+ }
+ }
+
+ _startDragging=false;
+
+ }
+ else if(_worldState == NOTHING_HAPPENS || _worldState == INIT_CREATION_CONTOUR)
+ {
+ std::map<int, GObjectController*>::iterator it;
+
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *desc = it->second;
+ int type = desc->getGObjectType();
+ int state = desc->getView()->getState();
+
+ if(state == HIGHLIGHTED){
+
+ updateStatusBar(desc->getStatusText());
+ if(type==GBLACKBOX)
+ {
+ GBlackBoxModel *mod = (GBlackBoxModel*)desc->getModel();
+ _parent->displayBlackBoxInfo(mod->getBBTKPackage(),mod->getBBTKType());
+ }
+ }
+ }
+ }
+
+
+
+
+ return true;
+ }
+
+ //=========================================================================
+
+ bool wxVtkSceneManager::OnLeftButtonDown()
+ {
+
+ if(_selectedObjects.size()!=0)
+ {
+ _worldState = DRAG_OBJECTS;
+ _startDragging = true;
+
+ for (int i = 0; i < _selectedObjects.size(); i++)
+ {
+ int id = _selectedObjects[i];
+ GObjectController* cont = _controllers[id];
+ cont->getView()->setState(DRAG);
+ cont->getModel()->notifyObservers(_idManager);
+ }
+ }
+
+
+
+ return true;
+ }
+
+ //=========================================================================
+
+ bool wxVtkSceneManager::OnLeftButtonUp()
+ {
+ if(_worldState == DRAG_OBJECTS)
+ {
+ _worldState = NOTHING_HAPPENS;
+
+ for (int i = 0; i < _selectedObjects.size(); i++)
+ {
+ int id = _selectedObjects[i];
+ GObjectController* cont = _controllers[id];
+ cont->getView()->setState(SELECTED);
+ cont->getModel()->notifyObservers(_idManager);
+ }
+ }
+ return true;
+ }
+
+ //=========================================================================
+
+ bool wxVtkSceneManager::OnRightButtonUp()
+ {
+ for (int i = 0; i < _selectedObjects.size(); i++)
+ {
+ int id = _selectedObjects[i];
+ GObjectController* cont = _controllers[id];
+ cont->SetActive(true);
+ cont->getView()->setState(NOTHING_HAPPENS);
+ cont->getModel()->notifyObservers(_idManager);
+ }
+
+ _selectedObjects.clear();
+