Re: 3D viewer in ROOT 4.02

From: Ralf Ehrlich <ehrlich_at_umdgrb.umd.edu>
Date: Tue, 8 Mar 2005 15:08:32 -0500 (EST)


Hi Richard,
thank you very much for looking into this problem.  

> Incidently I would be interested to know why you overload ExecuteEvent()

For the program I wrote I needed to set myPad->SetEditable(false) to prevent users from moving/changing/deleting objects inside the pad. The first line in TPadOpenGLView::ExecuteEvent() is/was

    if (GetPad() && !GetPad()->IsEditable()) return; That means that ExecuteEvent returns without doing anything, if the reference TPad is not editable (e.g. myPad). The same thing happens with TView::ExecuteEvent(). Therefore I overloaded both classes in the following way:
class MyPadOpenGLView : public TPadOpenGLView {
  TPad *fPad;

  public:
  MyPadOpenGLView(TPad *pad):TPadOpenGLView(pad) {fPad=pad;}   void ExecuteEvent(Int_t event, Int_t px, Int_t py)   {
    fPad->SetEditable(true);
    TPadOpenGLView::ExecuteEvent(event,px,py);     fPad->SetEditable(false);
  }

  ClassDef(MyPadOpenGLView,0);
};

Thank you vey much,
Ralf Received on Tue Mar 08 2005 - 21:09:00 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET