Re: 3D viewer in ROOT 4.02

From: Richard Maunder <richard.maunder_at_cern.ch>
Date: Wed, 09 Mar 2005 09:20:36 +0100


Hi Ralf,

I'm not sure why the old OGL viewer would not connect to a 'readonly' pad - but there is no reason why the new one will not - so this may no longer be needed.

I presume in this case you would expect the OGL viewer to respect the non-editable state of the pad contents - if it offers editing facilities itself.

Thanks for the infomation.

Richard

On Tue, 2005-03-08 at 21:08, Ralf Ehrlich wrote:
> 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 Wed Mar 09 2005 - 09:20:43 MET

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