Commit d4056da5 authored by Berk Geveci's avatar Berk Geveci

Adding support for observers.

parent 5140a0f3
......@@ -42,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkInteractorStyleJoystickActor.h"
#include "vtkObjectFactory.h"
#include "vtkMath.h"
#include "vtkCommand.h"
//----------------------------------------------------------------------------
vtkInteractorStyleJoystickActor *vtkInteractorStyleJoystickActor::New()
......@@ -460,6 +461,12 @@ void vtkInteractorStyleJoystickActor::ScaleXY(int vtkNotUsed(x), int y)
void vtkInteractorStyleJoystickActor::OnLeftButtonDown(int ctrl, int shift,
int x, int y)
{
if (this->HasObserver(vtkCommand::LeftButtonPressEvent))
{
this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
return;
}
this->FindPokedRenderer(x, y);
this->FindPickedActor(x, y);
......@@ -508,6 +515,12 @@ void vtkInteractorStyleJoystickActor::OnLeftButtonUp(int vtkNotUsed(ctrl),
void vtkInteractorStyleJoystickActor::OnMiddleButtonDown(int ctrl, int shift,
int x, int y)
{
if (this->HasObserver(vtkCommand::MiddleButtonPressEvent))
{
this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
return;
}
this->FindPokedRenderer(x, y);
this->FindPickedActor(x, y);
......@@ -550,6 +563,12 @@ void vtkInteractorStyleJoystickActor::OnRightButtonDown(int vtkNotUsed(ctrl),
int vtkNotUsed(shift),
int x, int y)
{
if (this->HasObserver(vtkCommand::RightButtonPressEvent))
{
this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
return;
}
this->FindPokedRenderer(x, y);
this->FindPickedActor(x, y);
......
......@@ -42,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkInteractorStyleTrackballActor.h"
#include "vtkObjectFactory.h"
#include "vtkMath.h"
#include "vtkCommand.h"
//----------------------------------------------------------------------------
vtkInteractorStyleTrackballActor *vtkInteractorStyleTrackballActor::New()
......@@ -432,6 +433,11 @@ void vtkInteractorStyleTrackballActor::ScaleXY(int vtkNotUsed(x), int y,
void vtkInteractorStyleTrackballActor::OnLeftButtonDown(int ctrl, int shift,
int x, int y)
{
if (this->HasObserver(vtkCommand::LeftButtonPressEvent))
{
this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
return;
}
this->FindPokedRenderer(x, y);
this->FindPickedActor(x, y);
......@@ -468,6 +474,11 @@ void vtkInteractorStyleTrackballActor::OnLeftButtonUp(int vtkNotUsed(ctrl),
void vtkInteractorStyleTrackballActor::OnMiddleButtonDown(int ctrl, int shift,
int x, int y)
{
if (this->HasObserver(vtkCommand::MiddleButtonPressEvent))
{
this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
return;
}
this->FindPokedRenderer(x, y);
this->FindPickedActor(x, y);
......@@ -500,6 +511,11 @@ void vtkInteractorStyleTrackballActor::OnRightButtonDown(int vtkNotUsed(ctrl),
int vtkNotUsed(shift),
int x, int y)
{
if (this->HasObserver(vtkCommand::RightButtonPressEvent))
{
this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
return;
}
this->FindPokedRenderer(x, y);
this->FindPickedActor(x, y);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment