TEveViewer.cxx

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveViewer.cxx 37366 2010-12-07 14:39:19Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TEveViewer.h"
00013 #include "TEveScene.h"
00014 #include "TEveSceneInfo.h"
00015 
00016 #include "TEveManager.h"
00017 #include "TEveSelection.h"
00018 
00019 #include "TGLFormat.h"
00020 #include "TGLSAViewer.h"
00021 #include "TGLEmbeddedViewer.h"
00022 #include "TGLScenePad.h"
00023 
00024 #include "TGLEventHandler.h"
00025 
00026 #include "TApplication.h"
00027 #include "TEnv.h"
00028 #include "TSystem.h"
00029 
00030 //==============================================================================
00031 //==============================================================================
00032 // TEveViewer
00033 //==============================================================================
00034 
00035 //______________________________________________________________________________
00036 //
00037 // Eve representation of TGLViewer.
00038 //
00039 // The gl-viewer is owned by this class and is deleted in destructor.
00040 //
00041 // The frame is not deleted, it is expected that the gl-viewer implementation
00042 // will delete that. TGLSAViewer and TGEmbeddedViewer both do so.
00043 // This could be an optional argument to SetGLViewer. A frame could be
00044 // passed as well.
00045 
00046 ClassImp(TEveViewer);
00047 
00048 Bool_t TEveViewer::fgInitInternal        = kFALSE;
00049 Bool_t TEveViewer::fgRecreateGlOnDockOps = kFALSE;
00050 
00051 //______________________________________________________________________________
00052 TEveViewer::TEveViewer(const char* n, const char* t) :
00053    TEveWindowFrame(0, n, t),
00054    fGLViewer      (0),
00055    fGLViewerFrame (0)
00056 {
00057    // Constructor.
00058    // The base-class TEveWindowFrame is constructed without a frame so
00059    // a default composite-frame is instantiated and stored in fGUIFrame.
00060    // Cleanup is set to no-cleanup as viewers need to be zapped with some
00061    // more care.
00062 
00063    SetChildClass(TEveSceneInfo::Class());
00064    fGUIFrame->SetCleanup(kNoCleanup); // the gl-viewer's frame deleted elsewhere.
00065 
00066    if (!fgInitInternal)
00067    {
00068       InitInternal();
00069    }
00070 }
00071 
00072 //______________________________________________________________________________
00073 TEveViewer::~TEveViewer()
00074 {
00075    // Destructor.
00076 
00077    fGLViewer->SetEventHandler(0);
00078 
00079    fGLViewerFrame->UnmapWindow();
00080    GetGUICompositeFrame()->RemoveFrame(fGLViewerFrame);
00081    fGLViewerFrame->ReparentWindow(gClient->GetDefaultRoot());
00082    TTimer::SingleShot(150, "TGLViewer", fGLViewer, "Delete()");
00083 }
00084 
00085 /******************************************************************************/
00086 
00087 //______________________________________________________________________________
00088 void TEveViewer::InitInternal()
00089 {
00090    // Initialize static data-members according to running conditions.
00091 
00092    // Determine if display is running on a mac.
00093    // This also works for ssh connection mac->linux.
00094    fgRecreateGlOnDockOps = (gVirtualX->SupportsExtension("Apple-WM") == 1);
00095 
00096    fgInitInternal = kTRUE;
00097 }
00098 
00099 //______________________________________________________________________________
00100 void TEveViewer::PreUndock()
00101 {
00102    // Virtual function called before a window is undocked.
00103    // On mac we have to force recreation of gl-context.
00104 
00105    TEveWindowFrame::PreUndock();
00106    if (fgRecreateGlOnDockOps)
00107    {
00108       // Mac only: TGLWidget can be already deleted
00109       // in case of recursive delete
00110       if (fGLViewer->GetGLWidget())
00111       {
00112          fGLViewer->DestroyGLWidget();
00113       }
00114    }
00115 }
00116 
00117 //______________________________________________________________________________
00118 void TEveViewer::PostDock()
00119 {
00120    // Virtual function called after a window is docked.
00121    // On mac we have to force recreation of gl-context.
00122 
00123    if (fgRecreateGlOnDockOps) {
00124       fGLViewer->CreateGLWidget();
00125    }
00126    TEveWindowFrame::PostDock();
00127 }
00128 
00129 /******************************************************************************/
00130 
00131 //______________________________________________________________________________
00132 const TGPicture* TEveViewer::GetListTreeIcon(Bool_t)
00133 {
00134    // Return TEveViewer icon.
00135 
00136    return TEveElement::fgListTreeIcons[1];
00137 }
00138 
00139 //______________________________________________________________________________
00140 void TEveViewer::SetGLViewer(TGLViewer* viewer, TGFrame* frame)
00141 {
00142    // Set TGLViewer that is represented by this object.
00143    // The old gl-viewer is deleted.
00144 
00145    delete fGLViewer;
00146    fGLViewer      = viewer;
00147    fGLViewerFrame = frame;
00148 
00149    fGLViewer->SetSmartRefresh(kTRUE);
00150 }
00151 
00152 //______________________________________________________________________________
00153 TGLSAViewer* TEveViewer::SpawnGLViewer(TGedEditor* ged, Bool_t stereo)
00154 {
00155    // Spawn new GLViewer and adopt it.
00156 
00157    static const TEveException kEH("TEveViewer::SpawnGLViewer ");
00158 
00159    TGCompositeFrame* cf = GetGUICompositeFrame();
00160 
00161    TGLFormat *form = 0;
00162    if (stereo)
00163    {
00164       form = new TGLFormat;
00165       form->SetStereo(kTRUE);
00166    }
00167 
00168    cf->SetEditable(kTRUE);
00169    TGLSAViewer* v = 0;
00170    try
00171    {
00172       v = new TGLSAViewer(cf, 0, ged, form);
00173    }
00174    catch (std::exception&)
00175    {
00176       Error("SpawnGLViewer", "Insufficient support from the graphics hardware. Aborting.");
00177       gApplication->Terminate(1);
00178    }
00179    cf->SetEditable(kFALSE);
00180    v->ToggleEditObject();
00181    v->DisableCloseMenuEntries();
00182    if (gEnv->GetValue("Eve.Viewer.HideMenus", 1) == 1)
00183    {
00184       v->EnableMenuBarHiding();
00185    }
00186    SetGLViewer(v, v->GetFrame());
00187 
00188    if (stereo)
00189       v->SetStereo(kTRUE);
00190 
00191    if (fEveFrame == 0)
00192       PreUndock();
00193 
00194    return v;
00195 }
00196 
00197 //______________________________________________________________________________
00198 TGLEmbeddedViewer* TEveViewer::SpawnGLEmbeddedViewer(TGedEditor* ged, Int_t border)
00199 {
00200    // Spawn new GLViewer and adopt it.
00201 
00202    static const TEveException kEH("TEveViewer::SpawnGLEmbeddedViewer ");
00203 
00204    TGCompositeFrame* cf = GetGUICompositeFrame();
00205 
00206    TGLEmbeddedViewer* v = new TGLEmbeddedViewer(cf, 0, ged, border);
00207    SetGLViewer(v, v->GetFrame());
00208 
00209    cf->AddFrame(fGLViewerFrame, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY));
00210 
00211    fGLViewerFrame->MapWindow();
00212 
00213    if (fEveFrame == 0)
00214       PreUndock();
00215 
00216    return v;
00217 }
00218 
00219 //______________________________________________________________________________
00220 void TEveViewer::Redraw(Bool_t resetCameras)
00221 {
00222    // Redraw viewer immediately.
00223 
00224    if (resetCameras) fGLViewer->PostSceneBuildSetup(kTRUE);
00225    fGLViewer->RequestDraw(TGLRnrCtx::kLODHigh);
00226 }
00227 
00228 //______________________________________________________________________________
00229 void TEveViewer::SwitchStereo()
00230 {
00231    // Switch stereo mode.
00232    // This only works TGLSAViewers and, of course, with stereo support
00233    // provided by the OpenGL driver.
00234 
00235    TGLSAViewer *v = dynamic_cast<TGLSAViewer*>(fGLViewer);
00236 
00237    if (!v) {
00238       Warning("SwitchStereo", "Only supported for TGLSAViewer.");
00239       return;
00240    }
00241 
00242    v->DestroyGLWidget();
00243    TGLFormat *f = v->GetFormat();
00244 switch_stereo:
00245    f->SetStereo(!f->IsStereo());
00246    v->SetStereo(f->IsStereo());
00247    try
00248    {
00249       v->CreateGLWidget();
00250    }
00251    catch (std::exception&)
00252    {
00253       Error("SwitchStereo", "Insufficient support from the graphics hardware. Reverting.");
00254       goto switch_stereo;
00255    }
00256 }
00257 
00258 /******************************************************************************/
00259 
00260 //______________________________________________________________________________
00261 void TEveViewer::AddScene(TEveScene* scene)
00262 {
00263    // Add 'scene' to the list of scenes.
00264 
00265    static const TEveException eh("TEveViewer::AddScene ");
00266 
00267    TGLSceneInfo* glsi = fGLViewer->AddScene(scene->GetGLScene());
00268    if (glsi != 0) {
00269       TEveSceneInfo* si = new TEveSceneInfo(this, scene, glsi);
00270       AddElement(si);
00271    } else {
00272       throw(eh + "scene already in the viewer.");
00273    }
00274 }
00275 
00276 //______________________________________________________________________________
00277 void TEveViewer::RemoveElementLocal(TEveElement* el)
00278 {
00279    // Remove element 'el' from the list of children and also remove
00280    // appropriate GLScene from GLViewer's list of scenes.
00281    // Virtual from TEveElement.
00282 
00283    fGLViewer->RemoveScene(((TEveSceneInfo*)el)->GetGLScene());
00284 }
00285 
00286 //______________________________________________________________________________
00287 void TEveViewer::RemoveElementsLocal()
00288 {
00289    // Remove all children, forwarded to GLViewer.
00290    // Virtual from TEveElement.
00291 
00292    fGLViewer->RemoveAllScenes();
00293 }
00294 
00295 //______________________________________________________________________________
00296 TObject* TEveViewer::GetEditorObject(const TEveException& eh) const
00297 {
00298    // Object to be edited when this is selected, returns the TGLViewer.
00299    // Virtual from TEveElement.
00300 
00301    if (!fGLViewer)
00302       throw(eh + "fGLViewer not set.");
00303    return fGLViewer;
00304 }
00305 
00306 //______________________________________________________________________________
00307 Bool_t TEveViewer::HandleElementPaste(TEveElement* el)
00308 {
00309    // Receive a pasted object. TEveViewer only accepts objects of
00310    // class TEveScene.
00311    // Virtual from TEveElement.
00312 
00313    static const TEveException eh("TEveViewer::HandleElementPaste ");
00314 
00315    TEveScene* scene = dynamic_cast<TEveScene*>(el);
00316    if (scene != 0) {
00317       AddScene(scene);
00318       return kTRUE;
00319    } else {
00320       Warning(eh.Data(), "class TEveViewer only accepts TEveScene paste argument.");
00321       return kFALSE;
00322    }
00323 }
00324 
00325 
00326 /******************************************************************************/
00327 /******************************************************************************/
00328 // TEveViewerList
00329 /******************************************************************************/
00330 
00331 //______________________________________________________________________________
00332 //
00333 // List of Viewers providing common operations on TEveViewer collections.
00334 
00335 ClassImp(TEveViewerList);
00336 
00337 //______________________________________________________________________________
00338 TEveViewerList::TEveViewerList(const char* n, const char* t) :
00339    TEveElementList(n, t),
00340    fShowTooltip   (kTRUE),
00341 
00342    fBrightness(0),
00343    fUseLightColorSet(kFALSE)
00344 {
00345    // Constructor.
00346 
00347    SetChildClass(TEveViewer::Class());
00348    Connect();
00349 }
00350 
00351 //______________________________________________________________________________
00352 TEveViewerList::~TEveViewerList()
00353 {
00354    // Destructor.
00355 
00356    Disconnect();
00357 }
00358 
00359 //==============================================================================
00360 
00361 //______________________________________________________________________________
00362 void TEveViewerList::AddElement(TEveElement* el)
00363 {
00364    // Call base-class implementation.
00365    // If compund is open and compound of the new element is not set,
00366    // the el's compound is set to this.
00367 
00368    TEveElementList::AddElement(el);
00369    el->IncParentIgnoreCnt();
00370 }
00371 
00372 //______________________________________________________________________________
00373 void TEveViewerList::RemoveElementLocal(TEveElement* el)
00374 {
00375    // Decompoundofy el, call base-class version.
00376 
00377    el->DecParentIgnoreCnt();
00378    TEveElementList::RemoveElementLocal(el);
00379 }
00380 
00381 //______________________________________________________________________________
00382 void TEveViewerList::RemoveElementsLocal()
00383 {
00384    // Decompoundofy children, call base-class version.
00385 
00386    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
00387    {
00388       (*i)->DecParentIgnoreCnt();
00389    }
00390 
00391    TEveElementList::RemoveElementsLocal();
00392 }
00393 
00394 //==============================================================================
00395 
00396 //______________________________________________________________________________
00397 void TEveViewerList::Connect()
00398 {
00399    // Connect to TGLViewer class-signals.
00400 
00401    TQObject::Connect("TGLViewer", "MouseOver(TObject*,UInt_t)",
00402                      "TEveViewerList", this, "OnMouseOver(TObject*,UInt_t)");
00403 
00404    TQObject::Connect("TGLViewer", "ReMouseOver(TObject*,UInt_t)",
00405                      "TEveViewerList", this, "OnReMouseOver(TObject*,UInt_t)");
00406 
00407    TQObject::Connect("TGLViewer", "UnMouseOver(TObject*,UInt_t)",
00408                      "TEveViewerList", this, "OnUnMouseOver(TObject*,UInt_t)");
00409 
00410    TQObject::Connect("TGLViewer", "Clicked(TObject*,UInt_t,UInt_t)",
00411                      "TEveViewerList", this, "OnClicked(TObject*,UInt_t,UInt_t)");
00412 
00413    TQObject::Connect("TGLViewer", "ReClicked(TObject*,UInt_t,UInt_t)",
00414                      "TEveViewerList", this, "OnReClicked(TObject*,UInt_t,UInt_t)");
00415 
00416    TQObject::Connect("TGLViewer", "UnClicked(TObject*,UInt_t,UInt_t)",
00417                      "TEveViewerList", this, "OnUnClicked(TObject*,UInt_t,UInt_t)");
00418 }
00419 
00420 //______________________________________________________________________________
00421 void TEveViewerList::Disconnect()
00422 {
00423    // Disconnect from TGLViewer class-signals.
00424 
00425    TQObject::Disconnect("TGLViewer", "MouseOver(TObject*,UInt_t)",
00426                         this, "OnMouseOver(TObject*,UInt_t)");
00427 
00428    TQObject::Disconnect("TGLViewer", "ReMouseOver(TObject*,UInt_t)",
00429                         this, "OnReMouseOver(TObject*,UInt_t)");
00430 
00431    TQObject::Disconnect("TGLViewer", "UnMouseOver(TObject*,UInt_t)",
00432                         this, "OnUnMouseOver(TObject*,UInt_t)");
00433 
00434    TQObject::Disconnect("TGLViewer", "Clicked(TObject*,UInt_t,UInt_t)",
00435                         this, "OnClicked(TObject*,UInt_t,UInt_t)");
00436 
00437    TQObject::Disconnect("TGLViewer", "ReClicked(TObject*,UInt_t,UInt_t)",
00438                         this, "OnReClicked(TObject*,UInt_t,UInt_t)");
00439 
00440    TQObject::Disconnect("TGLViewer", "UnClicked(TObject*,UInt_t,UInt_t)",
00441                         this, "OnUnClicked(TObject*,UInt_t,UInt_t)");
00442 }
00443 
00444 /******************************************************************************/
00445 
00446 //______________________________________________________________________________
00447 void TEveViewerList::RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
00448 {
00449    // Repaint viewers that are tagged as changed.
00450 
00451    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
00452    {
00453       TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
00454       if (glv->IsChanged())
00455       {
00456          // printf(" TEveViewer '%s' changed ... reqesting draw.\n", (*i)->GetObject()->GetName());
00457 
00458          if (resetCameras) glv->PostSceneBuildSetup(kTRUE);
00459          if (dropLogicals) glv->SetSmartRefresh(kFALSE);
00460 
00461          glv->RequestDraw(TGLRnrCtx::kLODHigh);
00462 
00463          if (dropLogicals) glv->SetSmartRefresh(kTRUE);
00464       }
00465    }
00466 }
00467 
00468 //______________________________________________________________________________
00469 void TEveViewerList::RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
00470 {
00471    // Repaint all viewers.
00472 
00473    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
00474    {
00475       TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
00476 
00477       // printf(" TEveViewer '%s' sending redraw reqest.\n", (*i)->GetObject()->GetName());
00478 
00479       if (resetCameras) glv->PostSceneBuildSetup(kTRUE);
00480       if (dropLogicals) glv->SetSmartRefresh(kFALSE);
00481 
00482       glv->RequestDraw(TGLRnrCtx::kLODHigh);
00483 
00484       if (dropLogicals) glv->SetSmartRefresh(kTRUE);
00485    }
00486 }
00487 
00488 //______________________________________________________________________________
00489 void TEveViewerList::DeleteAnnotations()
00490 {
00491    // Delete annotations from all viewers.
00492 
00493    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
00494    {
00495       TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
00496       glv->DeleteOverlayAnnotations();
00497    }
00498 }
00499 
00500 /******************************************************************************/
00501 
00502 //______________________________________________________________________________
00503 void TEveViewerList::SceneDestructing(TEveScene* scene)
00504 {
00505    // Callback done from a TEveScene destructor allowing proper
00506    // removal of the scene from affected viewers.
00507 
00508    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
00509    {
00510       TEveViewer* viewer = (TEveViewer*) *i;
00511       List_i j = viewer->BeginChildren();
00512       while (j != viewer->EndChildren())
00513       {
00514          TEveSceneInfo* sinfo = (TEveSceneInfo*) *j;
00515          ++j;
00516          if (sinfo->GetScene() == scene)
00517             viewer->RemoveElement(sinfo);
00518       }
00519    }
00520 }
00521 
00522 
00523 /******************************************************************************/
00524 // Processing of events from TGLViewers.
00525 /******************************************************************************/
00526 
00527 //______________________________________________________________________________
00528 void TEveViewerList::HandleTooltip()
00529 {
00530    // Show / hide tooltip for various MouseOver events.
00531    // Must be called from slots where sender is TGLEventHandler.
00532 
00533    if (fShowTooltip)
00534    {
00535       TGLViewer       *glw = dynamic_cast<TGLViewer*>((TQObject*) gTQSender);
00536       TGLEventHandler *glh = (TGLEventHandler*) glw->GetEventHandler();
00537       if (gEve->GetHighlight()->NumChildren() == 1)
00538       {
00539          TString title(gEve->GetHighlight()->FirstChild()->GetHighlightTooltip());
00540          if ( ! title.IsNull())
00541             glh->TriggerTooltip(title);
00542       }
00543       else
00544       {
00545          glh->RemoveTooltip();
00546       }
00547    }
00548 }
00549 
00550 //______________________________________________________________________________
00551 void TEveViewerList::OnMouseOver(TObject *obj, UInt_t /*state*/)
00552 {
00553    // Slot for global TGLViewer::MouseOver() signal.
00554    //
00555    // The attempt is made to determine the TEveElement being
00556    // represented by the physical shape and global higlight is updated
00557    // accordingly.
00558    //
00559    // If TEveElement::IsPickable() returns false, the element is not
00560    // highlighted.
00561    //
00562    // Highlight is always in single-selection mode.
00563 
00564    TEveElement *el = dynamic_cast<TEveElement*>(obj);
00565    if (el && !el->IsPickable())
00566       el = 0;
00567 
00568    void *qsender = gTQSender;
00569    gEve->GetHighlight()->UserPickedElement(el, kFALSE);
00570    gTQSender = qsender;
00571 
00572    HandleTooltip();
00573 }
00574 
00575 //______________________________________________________________________________
00576 void TEveViewerList::OnReMouseOver(TObject *obj, UInt_t /*state*/)
00577 {
00578    // Slot for global TGLViewer::ReMouseOver().
00579    //
00580    // The obj is dyn-casted to the TEveElement and global selection is
00581    // updated accordingly.
00582    //
00583    // If TEveElement::IsPickable() returns false, the element is not
00584    // selected.
00585 
00586    TEveElement* el = dynamic_cast<TEveElement*>(obj);
00587    if (el && !el->IsPickable())
00588       el = 0;
00589 
00590    void *qsender = gTQSender;
00591    gEve->GetHighlight()->UserRePickedElement(el);
00592    gTQSender = qsender;
00593 
00594    HandleTooltip();
00595 }
00596 
00597 //______________________________________________________________________________
00598 void TEveViewerList::OnUnMouseOver(TObject *obj, UInt_t /*state*/)
00599 {
00600    // Slot for global TGLViewer::UnMouseOver().
00601    //
00602    // The obj is dyn-casted to the TEveElement and global selection is
00603    // updated accordingly.
00604    //
00605    // If TEveElement::IsPickable() returns false, the element is not
00606    // selected.
00607 
00608    TEveElement* el = dynamic_cast<TEveElement*>(obj);
00609    if (el && !el->IsPickable())
00610       el = 0;
00611 
00612    void *qsender = gTQSender;
00613    gEve->GetHighlight()->UserUnPickedElement(el);
00614    gTQSender = qsender;
00615 
00616    HandleTooltip();
00617 }
00618 
00619 //______________________________________________________________________________
00620 void TEveViewerList::OnClicked(TObject *obj, UInt_t /*button*/, UInt_t state)
00621 {
00622    // Slot for global TGLViewer::Clicked().
00623    //
00624    // The obj is dyn-casted to the TEveElement and global selection is
00625    // updated accordingly.
00626    //
00627    // If TEveElement::IsPickable() returns false, the element is not
00628    // selected.
00629 
00630    TEveElement* el = dynamic_cast<TEveElement*>(obj);
00631    if (el && !el->IsPickable())
00632       el = 0;
00633    gEve->GetSelection()->UserPickedElement(el, state & kKeyControlMask);
00634 }
00635 
00636 //______________________________________________________________________________
00637 void TEveViewerList::OnReClicked(TObject *obj, UInt_t /*button*/, UInt_t /*state*/)
00638 {
00639    // Slot for global TGLViewer::ReClicked().
00640    //
00641    // The obj is dyn-casted to the TEveElement and global selection is
00642    // updated accordingly.
00643    //
00644    // If TEveElement::IsPickable() returns false, the element is not
00645    // selected.
00646 
00647    TEveElement* el = dynamic_cast<TEveElement*>(obj);
00648    if (el && !el->IsPickable())
00649       el = 0;
00650    gEve->GetSelection()->UserRePickedElement(el);
00651 }
00652 
00653 //______________________________________________________________________________
00654 void TEveViewerList::OnUnClicked(TObject *obj, UInt_t /*button*/, UInt_t /*state*/)
00655 {
00656    // Slot for global TGLViewer::UnClicked().
00657    //
00658    // The obj is dyn-casted to the TEveElement and global selection is
00659    // updated accordingly.
00660    //
00661    // If TEveElement::IsPickable() returns false, the element is not
00662    // selected.
00663 
00664    TEveElement* el = dynamic_cast<TEveElement*>(obj);
00665    if (el && !el->IsPickable())
00666       el = 0;
00667    gEve->GetSelection()->UserUnPickedElement(el);
00668 }
00669 
00670 //______________________________________________________________________________
00671 void TEveViewerList::SetColorBrightness(Float_t b)
00672 {
00673    // Set color brightness.
00674 
00675    TEveUtil::SetColorBrightness(b, 1);
00676 }
00677 
00678 //______________________________________________________________________________
00679 void TEveViewerList::SwitchColorSet()
00680 {
00681    // Switch background color.
00682 
00683    fUseLightColorSet = ! fUseLightColorSet;
00684    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
00685    {  
00686       TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
00687       if ( fUseLightColorSet)
00688          glv->UseLightColorSet();
00689       else 
00690          glv->UseDarkColorSet();
00691 
00692       glv->RequestDraw(TGLRnrCtx::kLODHigh);
00693    }
00694 }

Generated on Tue Jul 5 14:16:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1