nifti_user/ocu/src/Panels/RenderPanel.cpp
RenderPanel::RenderPanel(wxWindow* parent, int panelNumber, Ogre::SceneManager* sceneMgr, eu::nifti::ocu::gui::IMultiVizInputEventsHandler* evtHandler)
    : wxOgreRenderWindow(Ogre::Root::getSingletonPtr(), parent, wxID_ANY, wxDefaultPosition, parent->GetSize(), wxSUNKEN_BORDER, wxDefaultValidator, true)
    , mouse_x_(0)
    , mouse_y_(0)
    , sceneMgr(sceneMgr)
    , camera(NULL)
    , panelNumber(panelNumber)
    , evtHandler(evtHandler)
    {
        assert(panelNumber >= 0 && panelNumber <= 3);
        assert(sceneMgr != NULL);
        assert(evtHandler != NULL);

        SetFocus();
        Connect(wxEVT_CHAR, wxKeyEventHandler(RenderPanel::onKeyEvent), NULL, this);

        Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MIDDLE_DOWN, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MOTION, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_LEFT_UP, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MIDDLE_UP, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
    }
// Passes all default parameters to wxOgreRenderWindow except the size. It
// seems like it's a problem with GTK, but when I create a RenderPanel for
// a camera view, only a part of the image is painted at first. For example,
// when there is no input, "No Image" is shown. However,
// wxDefaultSize is 20 x 20 and only this part of the "No Image" is painted.
// If I create the RenderPanel at the size of the parent, which is certainly
// bigger than what it will actually be once layed out, then everything is
// painted properly.
Passes all default parameters to wxOgreRenderWindow except the size. It
seems like it's a problem with GTK, but when I create a RenderPanel for
a camera view, only a part of the image is painted at first. For example,
when there is no input, "No Image" is shown. However,
wxDefaultSize is 20 x 20 and only this part of the "No Image" is painted.
If I create the RenderPanel at the size of the parent, which is certainly
bigger than what it will actually be once layed out, then everything is
painted properly.
Passes all default parameters to wxOgreRenderWindow except the size . It seems like it ' s a problem with GTK but when I create a RenderPanel for a camera view only a part of the image is painted at first . For example when there is no input " No Image " is shown . However wxDefaultSize is 20 x 20 and only this part of the " No Image " is painted . If I create the RenderPanel at the size of the parent which is certainly bigger than what it will actually be once layed out then everything is painted properly .
RenderPanel::RenderPanel(wxWindow* parent, int panelNumber, Ogre::SceneManager* sceneMgr, eu::nifti::ocu::gui::IMultiVizInputEventsHandler* evtHandler)
    : wxOgreRenderWindow(Ogre::Root::getSingletonPtr(), parent, wxID_ANY, wxDefaultPosition, parent->GetSize(), wxSUNKEN_BORDER, wxDefaultValidator, true)
    , mouse_x_(0)
    , mouse_y_(0)
    , sceneMgr(sceneMgr)
    , camera(NULL)
    , panelNumber(panelNumber)
    , evtHandler(evtHandler)
    {
        assert(panelNumber >= 0 && panelNumber <= 3);
        assert(sceneMgr != NULL);
        assert(evtHandler != NULL);
        SetFocus();
        Connect(wxEVT_CHAR, wxKeyEventHandler(RenderPanel::onKeyEvent), NULL, this);
        Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MIDDLE_DOWN, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MOTION, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_LEFT_UP, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MIDDLE_UP, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
        Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(RenderPanel::onMouseEvent), NULL, this);
    }
RenderPanel :: RenderPanel ( wxWindow * parent , int panelNumber , Ogre :: SceneManager * sceneMgr , eu :: nifti :: ocu :: gui :: IMultiVizInputEventsHandler * evtHandler ) : wxOgreRenderWindow ( Ogre :: Root :: getSingletonPtr ( ) , parent , wxID_ANY , wxDefaultPosition , parent -> GetSize ( ) , wxSUNKEN_BORDER , wxDefaultValidator , true ) , mouse_x_ ( 0 ) , mouse_y_ ( 0 ) , sceneMgr ( sceneMgr ) , camera ( NULL ) , panelNumber ( panelNumber ) , evtHandler ( evtHandler ) { assert ( panelNumber >= 0 && panelNumber <= 3 ) ; assert ( sceneMgr != NULL ) ; assert ( evtHandler != NULL ) ; SetFocus ( ) ; Connect ( wxEVT_CHAR , wxKeyEventHandler ( RenderPanel :: onKeyEvent ) , NULL , this ) ; Connect ( wxEVT_LEFT_DOWN , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_MIDDLE_DOWN , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_RIGHT_DOWN , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_MOTION , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_LEFT_UP , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_MIDDLE_UP , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_RIGHT_UP , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_MOUSEWHEEL , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; Connect ( wxEVT_LEFT_DCLICK , wxMouseEventHandler ( RenderPanel :: onMouseEvent ) , NULL , this ) ; }
Passes all default parameters to wxOgreRenderWindow except the size.
Passes all default parameters to wxOgreRenderWindow except the size .