Beispiel #1
0
bool reTranslateTool::OnMouseDown(wxMouseEvent& event, rwxGLCanvas* canvas){
	reToolBase::OnMouseDown(event, canvas);

	rActor3* actor = PickActor(event, canvas);

	if (actor){
		m_selectedAxis = m_gizmo->GetGizmoAxis(actor);

		if (m_selectedAxis == reGizmoAxis::NONE){
			bool result = DoActorSelection(actor, event);
			m_gizmo->Update();
		}
		else{
			m_gizmo->Update();
			SetDragPlaneFromSelectedAxis();
			GetWorldSpaceDragPosition(canvas, m_previousWorldPosition);
			m_command = new reTranslateCommand(m_component->SelectionManager()->GetSelection(), m_component);
		}

		return true;
	}
	else{
		m_gizmo->SetVisibility(false);
		return DoClearSelection();
	}
}
bool reTranslateTool::OnMouseDown(wxMouseEvent& event, rwxGLCanvas* canvas){
	reToolBase::OnMouseDown(event, canvas);

	m_component->GetEngine()->viewports->SetActiveViewport(canvas->GetViewport());
	m_gizmo->Update();

	rRay3 selectionRay = GetSelectionRay(event, canvas);
	m_selectedAxis = m_gizmo->PickAxis(selectionRay);

	if (m_selectedAxis != reGizmoAxis::NONE) {
		m_gizmo->HighlightAxis(m_selectedAxis);
		m_gizmo->Update();
		m_dragPlane = reToolBase::GetDragPlaneFromRay(selectionRay, m_gizmo->GetPosition());
		GetWorldSpaceDragPosition(canvas, m_previousWorldPosition);
		m_command = new reTranslateCommand(m_component->SelectionManager()->GetSelection(), m_component);

		return true;
	}
	else {
		rActor3* actor = PickActor(event, canvas);

		if (actor) {
			bool result = DoActorSelection(actor, event);
			m_gizmo->Update();
			
			return true;
		}
		else {
			m_gizmo->SetVisibility(false);
			return DoClearSelection();
		}
	}
}
Beispiel #3
0
bool wxPropertyGridInterface::ClearSelection( bool validation )
{
    bool res = DoClearSelection(validation, wxPG_SEL_DONT_SEND_EVENT);
    wxPropertyGrid* pg = GetPropertyGrid();
    if ( pg )
        pg->Refresh();
    return res;
}