Re: 3D viewer in ROOT 4.02

From: Richard Maunder <richard.maunder_at_cern.ch>
Date: Tue, 08 Mar 2005 09:27:53 +0100


Hello Ralf,

You are quite correct - calling CreateScene will add the objects to the OGL viewer again - so removal of objects will not work. In fact repeatedly calling CreateScene will end up with multiple copies of the objects - though you will not notice as they are laid on top of one another.

We are in the process of making a number of changes to TVirtualViewer3D etc which should make the rebuilding of viewer contents automatic when the pad content changes.

These will hopefully be ready shortly (this week), and should address your needs - so I would suggest hanging on for these. I will let you know when they are committed.

Incidently I would be interested to know why you overload ExecuteEvent() method? I will be doing a lot of work on the internals of the new OGL viewer, and so any customization that we can easily support directly can be considerd at this stage - possibly saving you the need to subclass this in the future.

Thanks

Richard

On Mon, 2005-03-07 at 22:57, Ralf Ehrlich wrote:
> Hi Olivier,
> the only functionality I'm missing in TViewerOpenGL is updating the 3D
> display. With TViewerOpenGL::CreateScene("ogl") it is possible to add
> new objects, but removing objects does not seem to work.
>
> Here is a (very simple) script that demonstrates how I did this with
> TPadOpenGLView:
> {
> gROOT->LoadClass("TGLKernel","RGL");
> TCanvas *c = new TCanvas;
> c->SetView(new TView(1));
> c->GetView()->SetRange(0,0,0,1,1,1);
> TPadOpenGLView *d = new TPadOpenGLView(c); //I don't initiate the 3D
> c->ResetView3D(d); //viewer with
> //c->x3d("OPENGL"),
> //since I actually use a
> //MyPadOpenGLView class
> //which inherits from
> //TPadOpenGLView.
> //This new class "overwrites"
> //the ExecuteEvent() method.
>
> TBRIK *b = new TBRIK("B","B","void",10,10,10);
> TNode *n = new TNode("N","N",b);
> n->cd();
> n->Draw(); //The 3D window now has the brik.
>
> TTUBE *t = new TTUBE("T","T","void",10,10);
> TNode *n1 = new TNode("N1","N1",t,10,10,10);
> n->cd();
> c->Modified(); //The 3D window now has the brik and the tube.
>
> n->RecursiveRemove(n1);
> TSPHE *s = new TSPHE("S","S","void",10);
> TNode *n2 = new TNode("N2","N2",s,-10,-10,-10);
> n->cd();
> c->Modified(); //The 3D window now had the brik and the sphere,
> //but the tube has been removed.
> }
>
> Any suggestion how to handle this problem with TViewerOpenGL would be
> greatly appreciated.
>
> Thank you,
> Ralf
>
>
> On Mon, 7 Mar 2005, Olivier Couet wrote:
>
> >
> > Hi Ralf,
> >
> > The new viewer TViewerOpenGL is under development. A lot of work is
> > currently put on that tool. The old way (TPadOpenGLView) will not be
> > reactivated, it was unmaintainable and it was not possible to evolve it on
> > the long term. Now we have a common interface for all viewer (x3d OpenGL
> > etc ...). Many new functionalities have been put in the new OpenGL viewer:
> >
> > - color management,
> > - transparency,
> > - possibility to move object,
> > - vector postscript,
> > - we are now working on a way to represent the composite shapes,
> > - a PadGL is also under investigation to have a even better integration of
> > OpenGL in ROOT,
> > - etc ...
> >
> > May be you can send us a little script showing how you were using
> > TPadOpenGLView and what are you missing in TViewerOpenGL. We will help you
> > to find a solution.
> >
> > Cheers, Olivier
> >
> >
> > On Sun, 6 Mar 2005, Ralf Ehrlich wrote:
> >
> > > Hello,
> > > I have been using the TPadOpenGLView class to get the 3D viewer. This
> > > worked very well till ROOT version 4.00/08.
> > > Now I'm using ROOT 4.02. This version doesn't have this TPadOpenGLView
> > > class anymore - it has been replaced by the TViewerOpenGL class.
> > > Unfortunately this new 3D viewer doesn't seem to be updated anymore when
> > > the content of its reference TPad changes. This was a feature that worked
> > > very well for TPadOpenGLView. Is there a method I can call to
> > > update/redraw/... the 3D display? Or would it be possible to bring the old
> > > 3D viewer back?
> > > Thank you very much,
> > > Ralf
> > >
> > >
> >
> >
>
Received on Tue Mar 08 2005 - 09:28:00 MET

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