mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
3DScene mouse event handler partially moved to c++ - part 2
This commit is contained in:
parent
276533e236
commit
6bf009edee
12 changed files with 257 additions and 173 deletions
|
@ -476,19 +476,6 @@ void GLCanvas3DManager::set_mouse_dragging(wxGLCanvas* canvas, bool dragging)
|
|||
it->second->set_mouse_dragging(dragging);
|
||||
}
|
||||
|
||||
Pointf GLCanvas3DManager::get_mouse_position(wxGLCanvas* canvas) const
|
||||
{
|
||||
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||
return (it != m_canvases.end()) ? it->second->get_mouse_position() : Pointf();
|
||||
}
|
||||
|
||||
void GLCanvas3DManager::set_mouse_position(wxGLCanvas* canvas, const Pointf& position)
|
||||
{
|
||||
CanvasesMap::iterator it = _get_canvas(canvas);
|
||||
if (it != m_canvases.end())
|
||||
it->second->set_mouse_position(position);
|
||||
}
|
||||
|
||||
int GLCanvas3DManager::get_hover_volume_id(wxGLCanvas* canvas) const
|
||||
{
|
||||
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||
|
@ -738,6 +725,20 @@ void GLCanvas3DManager::register_on_select_callback(wxGLCanvas* canvas, void* ca
|
|||
it->second->register_on_select_callback(callback);
|
||||
}
|
||||
|
||||
void GLCanvas3DManager::register_on_model_update_callback(wxGLCanvas* canvas, void* callback)
|
||||
{
|
||||
CanvasesMap::iterator it = _get_canvas(canvas);
|
||||
if (it != m_canvases.end())
|
||||
it->second->register_on_model_update_callback(callback);
|
||||
}
|
||||
|
||||
void GLCanvas3DManager::register_on_move_callback(wxGLCanvas* canvas, void* callback)
|
||||
{
|
||||
CanvasesMap::iterator it = _get_canvas(canvas);
|
||||
if (it != m_canvases.end())
|
||||
it->second->register_on_move_callback(callback);
|
||||
}
|
||||
|
||||
GLCanvas3DManager::CanvasesMap::iterator GLCanvas3DManager::_get_canvas(wxGLCanvas* canvas)
|
||||
{
|
||||
return (canvas == nullptr) ? m_canvases.end() : m_canvases.find(canvas);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue