bool GPortController::OnLeftButtonDown()
{
- if ( _vtkInteractorStyleBaseView!=NULL )
- {
- int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
- wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
- wxVTKiren->GetEventPosition(X,Y);
-
- int state = _view->getState();
+ int state = _view->getState();
- //Evaluate new state
- if(state == HIGHLIGHTED)
- {
- _isLeftClickDown=true;
- }
-
+ //Evaluate new state
+ if(state == HIGHLIGHTED)
+ {
+ _isLeftClickDown=true;
}
return true;
}
bool GPortController::OnLeftButtonUp()
{
int state = _view->getState();
- if(state == HIGHLIGHTED && _isLeftClickDown)
+ if(_isLeftClickDown)
{
- _isLeftClickDown=false;
-
- if ( _vtkInteractorStyleBaseView!=NULL )
+ if(state==HIGHLIGHTED)
{
- int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
- wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
- wxVTKiren->GetEventPosition(X,Y);
-
int portType = ((GPortModel*)_model)->getPortType();
//Evaluate new state
if(portType==GOUTPUTPORT)
{
- _model->setChanged();
- _model->notifyObservers(_id,INIT_CREATION_CONTOUR);
+ _model->notifyObservers(getId(),INIT_CREATION_CONTOUR);
}
else if (portType==GINPUTPORT)
{
- _model->setChanged();
- _model->notifyObservers(_id,FIN_CREATION_CONTOUR);
+ _model->notifyObservers(getId(),FIN_CREATION_CONTOUR);
}
-
}
+ else
+ {
+ _view->setState(NOTHING_HAPPENS);
+ }
+ _isLeftClickDown=false;
}
return true;