TView on TPad

Hi all,
I want to visualize my geometry. It seems to work OK, but there is a question.
I want to know how does the TView class works. Can I set some parameters (like SetParallel or Top) forcibly while I’m creating my geometry?
Shoul I update my Pad? Should I do smth else?

When I try to save the canvas as *.C file I cannot find there an interesting information :frowning:

Yes you can set some parameters like SetParallel in TView. See:
root.cern.ch/root/htmldoc/TView.html

So what am I doing wrong in this code:

TView *view=new TView(1);
view->SetParallel();  // seems this doesn't work :(
view->Zoom();
pad1->SetView(view);
...//creating geometry
pad1->cd();
 gGeoManager->GetMasterVolume()->Draw();
 pad1->SetView(view);

where should I specify my view settings?

And also another question:
Is it possible to paint different nodes made from the same TGeoVolume in different colors?
For example I have a set of scintillator counters and I want to paint them according to their energy release.

Just do things the opposite way, since TGeoVolume::Draw() creates a TView object that you are replacing…

...//creating geometry
pad1->cd();
gGeoManager->GetMasterVolume()->Draw();
TView *view = pad1->GetView();
view->... whatever with TView API
pad1->Modified();
pad1->Update();

Cheers,

agheata
Thanks a lot :smiley:

One more question. :blush:
When I save the canvas to ps-file I obtain there a perspective view.

view=pad1->GetView();
     view->Zoom();
     view->SetParallel();
     pad1->Modified();
     pad1->Update();
     pad2->cd();
...// [i]something is done with other pads on the canvas[/i] [b]can1[/b].
can1->Print("file.ps");

What should I do to obtain a parallel one?

I do not see this problem. I have executed rootgeom.C. I set “perspective” or “parapel” from the TView pop up menu in the canvas, saved the canvas into a PS file: The PS file is always identical to what is visible on the screen (ie: perspecive or parallel view). May be you have a little script showing the problem ?

While executing rootgeom.C I’ve found the same problem.
I set the parallel view from a popup menu, then I save the picture in ps-file using the main menu. And in ps-file I obtain a picture with a perpective view. The picture on visible screen is changing to the perspective view after I choose “Save -> c1.ps”.
Also when I drag cursor over the canvas with a parralel view (without pressing any buttons on the mouse or in the keyboard) the view becomes perpsective!

The same things happen when I execute my script.

ROOT version 4.04/02f