TridControl Class Reference

#include <TridControl.h>

List of all members.

Public Types

enum  EColorMode {
  kColorAsChargeMIP = 0, kColorAsChargeADC, kColorAsChargePE, kColorAsTimeMean,
  kColorAsTimeMeanT0, kColorAsTimeEarliest, kColorAsTimeEarliestT0, kColorAsOccupancy,
  kNumColorModes
}
enum  ETransMode {
  kTransNone = 0, kTransConstant, kTransAsChargeMIP, kTransAsChargeADC,
  kTransAsChargePE, kTransAsMeanTime, kTransAsMeanTimeT0, kNumTransModes
}
typedef enum
TridControl::EColorMode 
ColorMode_t
typedef enum
TridControl::ETransMode 
TransMode_t

Public Member Functions

 ~TridControl (void)
void ConnectTridPage (TridPage *page)
void DisconnectTridPage (TridPage *page)
void HistoMenuHandler (GuiMenu *menu, GuiMenu::GuiMenuList::iterator mit, std::string item)
void AddHistograms (const char *pageName, TH1 *colorhist, TH1 *transhist)
TH1 * GetColorHistogram ()
TH1 * GetTransHistogram ()
SelectionInfoPageGetSelectionInfoPage ()
void SetSelectionInfoPage (SelectionInfoPage *page)
void ClearPicked ()
void SetPicked (const TridModel *model)
bool IsPicked (const TridModel *model)
void ChangePicked ()
void ClearSelected ()
void ToggleSelected (const TridModel *model)
bool IsSelected (const TridModel *model)
void ChangeSelected ()
void ChangeColorMode (int mode)
void ChangeTransMode (int mode)
void ChangeColorRange (double min, double max)
void ChangeTransRange (double min, double max)
void GetColorRange (double &min, double &max)
void GetTransRange (double &min, double &max)
const char * GetColorModeName ()
const char * GetTransModeName ()
Double_t GetRangedModelColor (TridModel *model)
Double_t GetRangedModelTrans (TridModel *model)
TVector3 & GetBackgroundColor (void)
TVector3 & GetForegroundColor (void)
void SetBackgroundColor (TVector3 &c)
void SetForegroundColor (TVector3 &c)
TridAnimatorGetAnimator ()
Bool_t Animating ()
Bool_t AnimatingViews ()
Double_t GetAnimViewIncrement ()
Double_t CurrentAnimTimeMin ()
Double_t CurrentAnimTimeMax ()
void FireAnimationTrigger ()
Bool_t ShowColorUnderScale ()
Bool_t ShowColorOverScale ()
void SaveWindowGeometries ()
void RestoreWindowGeometries ()
virtual void SetColorMode (bool interpolate=true)
virtual TVector3 GetColor (Float_t x)

Static Public Member Functions

static TridControlInstance (PageDisplay *pd)

Public Attributes

TString fConfigFileName
SigC::Signal0< void > fSignal_ChangeColor
SigC::Signal0< void > fSignal_ChangeTrans
SigC::Signal0< void > fSignal_ChangePicked
SigC::Signal0< void > fSignal_ChangeSelected
SigC::Signal0< void > fSignal_ChangeHistograms
SigC::Signal0< void > fSignal_Animation
SigC::Signal1< void, TEnv & > fSignal_SaveWindowGeometry
SigC::Signal1< void, TEnv & > fSignal_RestoreWindowGeometry

Protected Attributes

PageDisplayfPageDisplay
SigC::Ptr< GuiMenufMenu
SigC::Ptr< GuiMenufHistoMenu
SigC::Ptr< GuiMenufWindowMenu
std::multimap< TridPage
*, SigC::Connection > 
fConnections
std::string fCurrentHistoName
std::map< std::string, TH1 * > fColorHistograms
std::map< std::string, TH1 * > fTransHistograms
const TridModelfPick
std::set< const TridModel * > fSelection
 Marks picked objects.
RangeDouble fColorRanges [kNumColorModes]
 Marks selected objects.
RangeDouble fTransRanges [kNumTransModes]
GuiToggledSubMenu fColorMode
GuiToggledSubMenu fTransMode
GuiToggledMenuItem fColorShowUnderScale
GuiToggledMenuItem fColorShowOverScale
Bool_t fInterpolateColor
TVector3 fForegroundColor
TVector3 fBackgroundColor
SelectionInfoPagefSelectionInfoPage
TridAnimator fAnimator

Static Protected Attributes

static std::map< PageDisplay
*, TridControl * > 
sControls

Private Member Functions

 TridControl (PageDisplay *pd=0)

Detailed Description

Definition at line 36 of file TridControl.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kColorAsChargeMIP 
kColorAsChargeADC 
kColorAsChargePE 
kColorAsTimeMean 
kColorAsTimeMeanT0 
kColorAsTimeEarliest 
kColorAsTimeEarliestT0 
kColorAsOccupancy 
kNumColorModes 

Definition at line 123 of file TridControl.h.

Enumerator:
kTransNone 
kTransConstant 
kTransAsChargeMIP 
kTransAsChargeADC 
kTransAsChargePE 
kTransAsMeanTime 
kTransAsMeanTimeT0 
kNumTransModes 

Definition at line 135 of file TridControl.h.


Constructor & Destructor Documentation

TridControl::~TridControl ( void   ) 

Definition at line 177 of file TridControl.cxx.

References fPageDisplay, Msg::kDebug, MSG, and sControls.

00178 {
00179   // Object is destroyed by the usual SigC mechanism:
00180   // When all pages which track instance drop it,
00181   // it destroys itself.
00182   MSG("TriD",Msg::kDebug) << "~TridControl()" << endl;
00183 
00184   sControls[fPageDisplay] = 0;
00185 }

TridControl::TridControl ( PageDisplay pd = 0  )  [private]

Definition at line 88 of file TridControl.cxx.

References GuiMenu::Add(), SelectionInfoPage::fPageDisplay, GuiMenuBar::GetMenu(), PageDisplay::GetMenuBar(), gSystem(), kColorModeNames, kColorModeStartRanges, Msg::kDebug, Msg::kError, Msg::kInfo, kTransModeStartRanges, GuiMenuBar::MakeAddMenu(), MSG, TridAnimator::OpenWindow(), RestoreWindowGeometries(), and SaveWindowGeometries().

Referenced by Instance().

00088                                        : 
00089   fPageDisplay(pd),
00090   fMenu(0),
00091   fHistoMenu(0),
00092   fCurrentHistoName(""),
00093   fPick(0),
00094   fSelection(),
00095   fColorMode(kColorAsChargeADC),
00096   fTransMode(kTransConstant),  
00097   fColorShowUnderScale(true), 
00098   fColorShowOverScale(true),
00099   fInterpolateColor(true),
00100   fForegroundColor(1,1,1), // White
00101   fBackgroundColor(0,0,0), // Black
00102   fSelectionInfoPage(0),
00103   fAnimator(*this)
00104 {
00105   const char* confFile = gSystem->Getenv("TRID_CONFIG_FILE");
00106   if(confFile) {
00107     MSG("TriD",Msg::kInfo) << "Loading config data from " << confFile << endl;
00108     fConfigFileName = confFile;
00109   }
00110   else 
00111     fConfigFileName = ".tridrc";
00112 
00113   sControls[fPageDisplay] = this;
00114   MSG("TriD",Msg::kDebug) << "TridControl Constructor!" << endl;
00115 
00116   // Look for the TriD menu, common to all Pages in the PD.
00117   GuiMenuBar& mb = fPageDisplay->GetMenuBar();
00118   GuiMenu* fMenu = mb.GetMenu("TriD");
00119   GuiMenu::GuiMenuList::iterator mit;
00120   
00121   if(fMenu) {
00122     MSG("TriD",Msg::kError) << "TridControl Constructor: Menu already exists in PageDisplay!" << endl;
00123     return; 
00124   }
00125 
00126   // Setup the trid menu(s).
00127   fMenu = mb.MakeAddMenu("TriD");
00128   
00129   mit = fMenu->Add("Animation...");
00130   (*mit)->Connect(slot_class(fAnimator,&TridAnimator::OpenWindow));
00131 
00132   // Histograms.
00133   fHistoMenu = manage(new GuiMenu);
00134   fMenu->Add("Histograms",*fHistoMenu);
00135 
00137   // Switches.
00138    
00139   // Over and underscale options.
00140   fColorShowUnderScale.AddToMenu(fMenu,"Show Underscale (color)");
00141   fColorShowOverScale. AddToMenu(fMenu,"Show Overscale (color)");
00142   // When hit, change the color.
00143   fColorShowUnderScale.Connect(fSignal_ChangeColor.slot());
00144   fColorShowOverScale.Connect(fSignal_ChangeColor.slot()); 
00145 
00146   // Window menu.
00147   //fWindowMenu = manage(new GuiMenu);
00148   //fMenu->Add("Windows",*fWindowMenu);
00149   mit = fMenu->Add("Save Configuration");
00150   (*mit)->Connect(slot_class(*this,&TridControl::SaveWindowGeometries));
00151   mit = fMenu->Add("Restore Configuration");
00152   (*mit)->Connect(slot_class(*this,&TridControl::RestoreWindowGeometries));
00153 
00154 
00155   // Set up the default ranges.
00156 
00157   // Put in some values for all of them, just to cover my ass.
00158   for(int i=0;i<kNumColorModes;i++) {
00159     fColorRanges[i].SetName(kColorModeNames[i]);
00160     fColorRanges[i].Set(
00161                                kColorModeStartRanges[i][0],
00162                                kColorModeStartRanges[i][1]
00163                                );
00164   }
00165 
00166   for(int i=0;i<kNumTransModes;i++) {
00167     fColorRanges[i].SetName(kColorModeNames[i]);
00168     fTransRanges[i].Set(
00169                                kTransModeStartRanges[i][0],
00170                                kTransModeStartRanges[i][1]
00171                                );
00172   }
00173   
00174 }


Member Function Documentation

void TridControl::AddHistograms ( const char *  pageName,
TH1 *  colorhist,
TH1 *  transhist 
)

Definition at line 235 of file TridControl.cxx.

References fColorHistograms, fCurrentHistoName, fHistoMenu, fTransHistograms, HistoMenuHandler(), and s().

00236 {
00237   string s(pageName);
00238   fColorHistograms[s] = colorhist;
00239   fTransHistograms[s] = transhist;  
00240  
00241   // Update menu.
00242   GuiMenu::GuiMenuList::iterator mit;
00243   mit = fHistoMenu->Add(pageName);
00244   (*mit)->Connect(bind(bind(bind(slot_class(*this,&TridControl::HistoMenuHandler),
00245                                  s), mit), fHistoMenu));
00246   if(fCurrentHistoName=="") {
00247     fHistoMenu->CheckEntry(mit);
00248     fCurrentHistoName=s;
00249   }
00250 }

Bool_t TridControl::Animating (  )  [inline]

Definition at line 207 of file TridControl.h.

References TridAnimator::Animating(), and fAnimator.

00207 { return fAnimator.Animating(); }

Bool_t TridControl::AnimatingViews (  )  [inline]

Definition at line 211 of file TridControl.h.

References TridAnimator::AnimatingViews(), and fAnimator.

00211 { return fAnimator.AnimatingViews(); }

void TridControl::ChangeColorMode ( int  mode  ) 

Definition at line 282 of file TridControl.cxx.

References fColorMode, fSignal_ChangeColor, Msg::kDebug, kNumColorModes, MSG, and GuiToggledSubMenu::SetState().

Referenced by TridHistoPage::Init().

00283 {
00284   MSG("TriD",Msg::kDebug) << "Color mode change requested to " << mode  << endl;
00285   if((mode < kNumColorModes) ) {
00286     fColorMode.SetState(mode);
00287     fSignal_ChangeColor.emit();
00288   }
00289 }

void TridControl::ChangeColorRange ( double  min,
double  max 
)

Definition at line 291 of file TridControl.cxx.

References fColorMode, fColorRanges, fSignal_ChangeColor, and Range< TYPE >::Set().

00292 {
00293   fColorRanges[fColorMode()].Set(min,max);
00294   fSignal_ChangeColor.emit();
00295 }

void TridControl::ChangePicked (  )  [inline]

Definition at line 68 of file TridControl.h.

References fSignal_ChangePicked.

00068 {fSignal_ChangePicked.emit(); };

void TridControl::ChangeSelected (  )  [inline]

Definition at line 73 of file TridControl.h.

References fSignal_ChangeSelected.

00073 {fSignal_ChangeSelected.emit(); };

void TridControl::ChangeTransMode ( int  mode  ) 

Definition at line 313 of file TridControl.cxx.

References fSignal_ChangeTrans, fTransMode, Msg::kDebug, kNumTransModes, MSG, and GuiToggledSubMenu::SetState().

Referenced by TridTransHistoPage::Init().

00314 {
00315   MSG("TriD",Msg::kDebug) << "Trans mode change requested to " << mode  << endl;
00316   if((mode < kNumTransModes) ) {
00317     fTransMode.SetState(mode);
00318 
00319     fSignal_ChangeTrans.emit();
00320   }
00321 }

void TridControl::ChangeTransRange ( double  min,
double  max 
)

Definition at line 323 of file TridControl.cxx.

References fSignal_ChangeTrans, fTransMode, fTransRanges, and Range< TYPE >::Set().

00324 {
00325   fTransRanges[fTransMode()].Set(min,max);
00326   fSignal_ChangeTrans.emit();
00327 }

void TridControl::ClearPicked (  )  [inline]

Definition at line 65 of file TridControl.h.

References fPick.

00065 { fPick = 0; };

void TridControl::ClearSelected (  ) 

Definition at line 389 of file TridControl.cxx.

References fSelection.

00390 {
00391   fSelection.clear();
00392 }

void TridControl::ConnectTridPage ( TridPage page  ) 

Definition at line 201 of file TridControl.cxx.

References TridPage::AnimationHook(), TridPage::ChangeColorHook(), TridPage::ChangeHistogramsHook(), TridPage::ChangePickedHook(), TridPage::ChangeSelectedHook(), TridPage::ChangeTransHook(), fConnections, fSignal_Animation, fSignal_ChangeColor, fSignal_ChangeHistograms, fSignal_ChangePicked, fSignal_ChangeSelected, fSignal_ChangeTrans, fSignal_RestoreWindowGeometry, fSignal_SaveWindowGeometry, TridPage::RestoreWindowGeometry(), and TridPage::SaveWindowGeometry().

00202 {
00203   // Connects each signal to the corresponding slot on the Page.
00204   // Adds the connection for each signal to a map so that the 
00205   // slot can be deleted when the page is.
00206   std::vector<Connection> list;
00207   list.push_back(fSignal_ChangeColor.connect     ((slot_class(*page,&TridPage::ChangeColorHook)    )));
00208   list.push_back(fSignal_ChangeTrans.connect     ((slot_class(*page,&TridPage::ChangeTransHook)    )));
00209   list.push_back(fSignal_ChangePicked.connect    ((slot_class(*page,&TridPage::ChangePickedHook)   )));
00210   list.push_back(fSignal_ChangeSelected.connect  ((slot_class(*page,&TridPage::ChangeSelectedHook) )));
00211   list.push_back(fSignal_ChangeHistograms.connect((slot_class(*page,&TridPage::ChangeHistogramsHook) )));
00212   list.push_back(fSignal_Animation.connect       ((slot_class(*page,&TridPage::AnimationHook) )));
00213   list.push_back(fSignal_SaveWindowGeometry.connect   ((slot_class(*page,&TridPage::SaveWindowGeometry) )));
00214   list.push_back(fSignal_RestoreWindowGeometry.connect((slot_class(*page,&TridPage::RestoreWindowGeometry) )));
00215   for(UInt_t i = 0; i<list.size(); i++) {
00216     fConnections.insert(pair<TridPage*,Connection>(page,list[i]));
00217   }
00218 }

Double_t TridControl::CurrentAnimTimeMax (  )  [inline]

Definition at line 209 of file TridControl.h.

References fAnimator, and TridAnimator::GetAnimTimeMax().

00209 { return fAnimator.GetAnimTimeMax(); }

Double_t TridControl::CurrentAnimTimeMin (  )  [inline]

Definition at line 208 of file TridControl.h.

References fAnimator, and TridAnimator::GetAnimTimeMin().

00208 { return fAnimator.GetAnimTimeMin(); }

void TridControl::DisconnectTridPage ( TridPage page  ) 

Definition at line 219 of file TridControl.cxx.

References fConnections, and it.

00220 {
00221   typedef std::multimap<TridPage*,Connection>::iterator my_it;
00222   pair<my_it,my_it> range;
00223   range = fConnections.equal_range(page);
00224   for(my_it it = range.first; it != range.second; it++) {
00225     it->second.disconnect();
00226   }
00227 
00228 }

void TridControl::FireAnimationTrigger (  )  [inline]

Definition at line 210 of file TridControl.h.

References fSignal_Animation.

Referenced by TridAnimator::HandleTimer().

00210 { fSignal_Animation.emit(); }

TridAnimator& TridControl::GetAnimator (  )  [inline]

Definition at line 97 of file TridControl.h.

References fAnimator.

00097 { return fAnimator; };

Double_t TridControl::GetAnimViewIncrement (  )  [inline]

Definition at line 212 of file TridControl.h.

References fAnimator, and TridAnimator::GetViewIncrement().

00212 { return fAnimator.GetViewIncrement(); }

TVector3& TridControl::GetBackgroundColor ( void   )  [inline]

Definition at line 91 of file TridControl.h.

References fBackgroundColor.

00091 { return fBackgroundColor; }; // Default background

TVector3 TridControl::GetColor ( Float_t  x  )  [virtual]

Definition at line 422 of file TridControl.cxx.

References fInterpolateColor, and n.

00423 {
00424   // Map a fractional number x to a place in the current pallete.
00425   // Underscale:
00426   int n = gStyle->GetNumberOfColors();
00427   int index = (int)(floor((x*(float)n)));
00428   if(index>=n) index = n-1;
00429   if(index<0) index = 0;
00430   int colNum = gStyle->GetColorPalette(index);
00431   TColor* colref = gROOT->GetColor(colNum);
00432   TVector3 rgb(colref->GetRed(),colref->GetGreen(),colref->GetBlue());
00433 
00434   // Underscale and overscale: make whiter.
00435   if((x<.00) || (x>1.0)) {
00436     rgb = rgb + TVector3(.4,.4,.4);
00437     if(rgb.x()>1) rgb.SetX(1);
00438     if(rgb.y()>1) rgb.SetY(1);
00439     if(rgb.z()>1) rgb.SetZ(1);
00440     return rgb;
00441   }
00442 
00443   if(!fInterpolateColor) {
00444     return rgb;
00445   }
00446   if(index+1>=n) return rgb;
00447   int colNum2 = gStyle->GetColorPalette(index+1);
00448   TColor* colref2 = gROOT->GetColor(colNum2);
00449   TVector3 rgb2(colref2->GetRed(),colref2->GetGreen(),colref2->GetBlue());
00450   double frac = fmod(x*(double)n,1.0);
00451   TVector3 interp = (1.0-frac)*rgb + (frac)*rgb2;
00452   return interp;
00453 }

TH1 * TridControl::GetColorHistogram (  ) 

Definition at line 252 of file TridControl.cxx.

References fColorHistograms, and fCurrentHistoName.

00253 {
00254   return fColorHistograms[fCurrentHistoName];
00255 }

const char * TridControl::GetColorModeName (  ) 

Definition at line 303 of file TridControl.cxx.

References fColorMode, and kColorModeNames.

00304 {
00305   return kColorModeNames[fColorMode()];
00306 }

void TridControl::GetColorRange ( double &  min,
double &  max 
)

Definition at line 297 of file TridControl.cxx.

References fColorMode, fColorRanges, Range< TYPE >::Max(), and Range< TYPE >::Min().

00298 {
00299   min = fColorRanges[fColorMode()].Min();
00300   max = fColorRanges[fColorMode()].Max();
00301 }

TVector3& TridControl::GetForegroundColor ( void   )  [inline]

Definition at line 92 of file TridControl.h.

References fForegroundColor.

00092 { return fForegroundColor; }; // Default foreground

Double_t TridControl::GetRangedModelColor ( TridModel model  ) 

Definition at line 459 of file TridControl.cxx.

References fColorMode, fColorRanges, TridModel::GetEarliestTime(), TridModel::GetMeanTime(), TridModel::GetOccupancy(), TridModel::GetTotalCharge(), kColorAsChargeADC, kColorAsChargeMIP, kColorAsChargePE, kColorAsOccupancy, kColorAsTimeEarliest, kColorAsTimeEarliestT0, kColorAsTimeMean, kColorAsTimeMeanT0, Msg::kError, CalTimeType::kNone, CalStripType::kNone, CalStripType::kPE, CalStripType::kSigCorr, CalTimeType::kT0, MSG, Munits::nanosecond, and Range< TYPE >::RelativeUnclipped().

00460 {
00461   double x = 0;
00462 
00463   switch(fColorMode()) {
00464   case kColorAsChargeMIP:
00465     x = model->GetTotalCharge(CalStripType::kSigCorr);
00466     break;
00467         
00468   case kColorAsChargeADC:
00469     x = model->GetTotalCharge(CalStripType::kNone);
00470     break;
00471     
00472   case kColorAsChargePE:
00473     x = model->GetTotalCharge(CalStripType::kPE);
00474     break;
00475 
00476   case kColorAsTimeMean:
00477     x = model->GetMeanTime(CalTimeType::kNone)/Munits::nanosecond;
00478     break;
00479 
00480   case kColorAsTimeMeanT0:
00481     x = model->GetMeanTime(CalTimeType::kT0)/Munits::nanosecond;
00482     break;
00483 
00484   case kColorAsTimeEarliest:
00485     x = model->GetEarliestTime(CalTimeType::kNone)/Munits::nanosecond;
00486     break;
00487 
00488   case kColorAsTimeEarliestT0:
00489     x = model->GetEarliestTime(CalTimeType::kT0)/Munits::nanosecond;
00490     break;
00491     
00492   case kColorAsOccupancy:
00493     x = model->GetOccupancy();
00494     break;
00495 
00496   default:
00497     MSG("TriD",Msg::kError) << "Color mode not implimented!" << endl;
00498   }
00499 
00500   // Transform to current scale and get color.
00501   return fColorRanges[fColorMode()].RelativeUnclipped(x);
00502 }

Double_t TridControl::GetRangedModelTrans ( TridModel model  ) 

Definition at line 504 of file TridControl.cxx.

References fTransMode, fTransRanges, TridModel::GetMeanTime(), TridModel::GetTotalCharge(), Msg::kError, CalTimeType::kNone, CalStripType::kNone, CalStripType::kPE, CalStripType::kSigCorr, CalTimeType::kT0, kTransAsChargeADC, kTransAsChargeMIP, kTransAsChargePE, kTransAsMeanTime, kTransAsMeanTimeT0, kTransConstant, kTransNone, MSG, Munits::nanosecond, and Range< TYPE >::RelativeUnclipped().

00505 {
00506   Float_t x = 1.0;
00507   switch(fTransMode()) {
00508   case kTransNone: return 1.0;
00509   case kTransConstant:   
00510     x = 1.0;
00511     break;
00512   case kTransAsChargeMIP:
00513     x = model->GetTotalCharge(CalStripType::kSigCorr);
00514     break;
00515   case kTransAsChargeADC:
00516     x = model->GetTotalCharge(CalStripType::kNone);
00517     break;
00518   case kTransAsChargePE:
00519     x = model->GetTotalCharge(CalStripType::kPE);
00520     break;
00521   case kTransAsMeanTime:
00522     x = model->GetMeanTime(CalTimeType::kNone)/Munits::nanosecond;
00523     break;
00524   case kTransAsMeanTimeT0:
00525     x = model->GetMeanTime(CalTimeType::kT0)/Munits::nanosecond;
00526     break;
00527   default:
00528     MSG("TriD",Msg::kError) << "Trans mode not implimented!" << endl;
00529   }
00530   
00531   return fTransRanges[fTransMode()].RelativeUnclipped(x);
00532 }

SelectionInfoPage* TridControl::GetSelectionInfoPage (  )  [inline]

Definition at line 62 of file TridControl.h.

References fSelectionInfoPage.

00062 { return fSelectionInfoPage; };

TH1 * TridControl::GetTransHistogram (  ) 

Definition at line 257 of file TridControl.cxx.

References fCurrentHistoName, and fTransHistograms.

00258 {
00259   return fTransHistograms[fCurrentHistoName];
00260 }

const char * TridControl::GetTransModeName (  ) 

Definition at line 335 of file TridControl.cxx.

References fTransMode, and kTransModeNames.

00336 {
00337   return kTransModeNames[fTransMode()];
00338 }

void TridControl::GetTransRange ( double &  min,
double &  max 
)

Definition at line 329 of file TridControl.cxx.

References fTransMode, fTransRanges, Range< TYPE >::Max(), and Range< TYPE >::Min().

00330 {
00331   min = fTransRanges[fTransMode()].Min();
00332   max = fTransRanges[fTransMode()].Max();
00333 }

void TridControl::HistoMenuHandler ( GuiMenu menu,
GuiMenu::GuiMenuList::iterator  mit,
std::string  item 
)

Referenced by AddHistograms().

TridControl * TridControl::Instance ( PageDisplay pd  )  [static]

Definition at line 191 of file TridControl.cxx.

References sControls, and TridControl().

Referenced by TridPage::Init(), TridTransHistoPage::Init(), TridHistoPage::Init(), SelectionInfoPage::Init(), main(), TridSetup(), and SelectionInfoPage::~SelectionInfoPage().

00192 {
00193   // Get a trid control pointer.
00194   if(sControls[pd]!=0) return sControls[pd];
00195   TridControl* control = manage(new TridControl(pd));
00196   return control;
00197 }

bool TridControl::IsPicked ( const TridModel model  ) 

Definition at line 382 of file TridControl.cxx.

References fPick, and TridModel::Intersects().

00383 {
00384   if(fPick)
00385     if(fPick->Intersects(model)) return true;
00386   return false;
00387 }

Bool_t TridControl::IsSelected ( const TridModel model  ) 

Definition at line 405 of file TridControl.cxx.

References fSelection.

00406 {
00407   std::set<const TridModel*>::iterator it = fSelection.begin();
00408   std::set<const TridModel*>::iterator end= fSelection.end();
00409   for( ; it!=end; it++ ) {
00410     if( (*it)->Intersects(model) ) return true;
00411   }
00412 
00413   return false;
00414 }

void TridControl::RestoreWindowGeometries (  ) 

Definition at line 371 of file TridControl.cxx.

References fConfigFileName, and fSignal_RestoreWindowGeometry.

Referenced by TridControl().

00372 {
00373   //char *s = gSystem->ConcatFileName(gSystem->HomeDirectory(), ".tridrc");
00374   TEnv env(fConfigFileName.Data());  
00375   fSignal_RestoreWindowGeometry.emit(env);
00376 }

void TridControl::SaveWindowGeometries (  ) 

Definition at line 346 of file TridControl.cxx.

References fConfigFileName, Form(), fSignal_SaveWindowGeometry, and outfile.

Referenced by TridControl().

00347 {
00348   
00349   TEnv env(fConfigFileName.Data());
00350   env.SetValue("Trid.DefaultWindows","",kEnvChange); // Set up null string.
00351   fSignal_SaveWindowGeometry.emit(env);
00352 
00353   // This line doesn't work because the ROOT Env system has bugs.
00354   //env.SaveLevel(kEnvUser);
00355 
00356   // So, I'll write my own custom save routine here:
00357   TIter next(env.GetTable());
00358   TEnvRec* er;
00359   FILE* outfile = fopen(fConfigFileName.Data(),"w+");
00360   if(!outfile) return;
00361   while((er= (TEnvRec*) next())) {
00362     const char* val = env.GetValue(er->GetName(),"");
00363     fprintf(outfile, "%-40s %s\n", 
00364             Form("%s:", er->GetName()),
00365             val );
00366   }
00367   fclose(outfile);
00368   
00369 }

void TridControl::SetBackgroundColor ( TVector3 &  c  )  [inline]

Definition at line 93 of file TridControl.h.

References fBackgroundColor.

00093 { fBackgroundColor = c; }; // Default background

virtual void TridControl::SetColorMode ( bool  interpolate = true  )  [inline, virtual]

Definition at line 113 of file TridControl.h.

References fInterpolateColor.

00113 {fInterpolateColor = interpolate; }; // Turn off for printing.

void TridControl::SetForegroundColor ( TVector3 &  c  )  [inline]

Definition at line 94 of file TridControl.h.

References fForegroundColor.

00094 { fForegroundColor = c; }; // Default foreground

void TridControl::SetPicked ( const TridModel model  )  [inline]

Definition at line 66 of file TridControl.h.

References fPick.

00066 { fPick = model; };

void TridControl::SetSelectionInfoPage ( SelectionInfoPage page  )  [inline]

Definition at line 63 of file TridControl.h.

References fSelectionInfoPage.

Referenced by SelectionInfoPage::Init(), and SelectionInfoPage::~SelectionInfoPage().

00063 { fSelectionInfoPage = page; };

Bool_t TridControl::ShowColorOverScale (  )  [inline]

Definition at line 107 of file TridControl.h.

References fColorShowOverScale.

00107 { return fColorShowOverScale(); };

Bool_t TridControl::ShowColorUnderScale (  )  [inline]

Definition at line 106 of file TridControl.h.

References fColorShowUnderScale.

00106 { return fColorShowUnderScale(); };

void TridControl::ToggleSelected ( const TridModel model  ) 

Definition at line 394 of file TridControl.cxx.

References fSelection.

00395 {
00396   std::set<const TridModel*>::iterator it;
00397   it = fSelection.find(model);
00398   if(it==fSelection.end()) {
00399     fSelection.insert(model);
00400   } else {
00401     fSelection.erase(it);
00402   }
00403 }


Member Data Documentation

TVector3 TridControl::fBackgroundColor [protected]

Definition at line 194 of file TridControl.h.

Referenced by GetBackgroundColor(), and SetBackgroundColor().

std::map<std::string,TH1*> TridControl::fColorHistograms [protected]

Definition at line 173 of file TridControl.h.

Referenced by AddHistograms(), and GetColorHistogram().

RangeDouble TridControl::fColorRanges[kNumColorModes] [protected]

Marks selected objects.

Definition at line 181 of file TridControl.h.

Referenced by ChangeColorRange(), GetColorRange(), and GetRangedModelColor().

Definition at line 187 of file TridControl.h.

Referenced by ShowColorOverScale().

Definition at line 186 of file TridControl.h.

Referenced by ShowColorUnderScale().

Definition at line 148 of file TridControl.h.

Referenced by RestoreWindowGeometries(), and SaveWindowGeometries().

std::multimap<TridPage*,SigC::Connection> TridControl::fConnections [protected]

Definition at line 169 of file TridControl.h.

Referenced by ConnectTridPage(), and DisconnectTridPage().

std::string TridControl::fCurrentHistoName [protected]

Definition at line 172 of file TridControl.h.

Referenced by AddHistograms(), GetColorHistogram(), and GetTransHistogram().

TVector3 TridControl::fForegroundColor [protected]

Definition at line 193 of file TridControl.h.

Referenced by GetForegroundColor(), and SetForegroundColor().

SigC::Ptr<GuiMenu> TridControl::fHistoMenu [protected]

Definition at line 165 of file TridControl.h.

Referenced by AddHistograms().

Bool_t TridControl::fInterpolateColor [protected]

Definition at line 189 of file TridControl.h.

Referenced by GetColor(), and SetColorMode().

SigC::Ptr<GuiMenu> TridControl::fMenu [protected]

Definition at line 164 of file TridControl.h.

Definition at line 161 of file TridControl.h.

Referenced by ~TridControl().

const TridModel* TridControl::fPick [protected]

Definition at line 177 of file TridControl.h.

Referenced by ClearPicked(), IsPicked(), and SetPicked().

std::set<const TridModel*> TridControl::fSelection [protected]

Marks picked objects.

Definition at line 178 of file TridControl.h.

Referenced by ClearSelected(), IsSelected(), and ToggleSelected().

Definition at line 196 of file TridControl.h.

Referenced by GetSelectionInfoPage(), and SetSelectionInfoPage().

SigC::Signal0<void> TridControl::fSignal_Animation

Definition at line 155 of file TridControl.h.

Referenced by ConnectTridPage(), and FireAnimationTrigger().

SigC::Signal0<void> TridControl::fSignal_ChangeColor

Definition at line 150 of file TridControl.h.

Referenced by ChangeColorMode(), ChangeColorRange(), and ConnectTridPage().

Definition at line 154 of file TridControl.h.

Referenced by ConnectTridPage().

SigC::Signal0<void> TridControl::fSignal_ChangePicked

Definition at line 152 of file TridControl.h.

Referenced by ChangePicked(), and ConnectTridPage().

Definition at line 153 of file TridControl.h.

Referenced by ChangeSelected(), and ConnectTridPage().

SigC::Signal0<void> TridControl::fSignal_ChangeTrans

Definition at line 151 of file TridControl.h.

Referenced by ChangeTransMode(), ChangeTransRange(), and ConnectTridPage().

SigC::Signal1<void,TEnv&> TridControl::fSignal_RestoreWindowGeometry

Definition at line 157 of file TridControl.h.

Referenced by ConnectTridPage(), and RestoreWindowGeometries().

SigC::Signal1<void,TEnv&> TridControl::fSignal_SaveWindowGeometry

Definition at line 156 of file TridControl.h.

Referenced by ConnectTridPage(), and SaveWindowGeometries().

std::map<std::string,TH1*> TridControl::fTransHistograms [protected]

Definition at line 174 of file TridControl.h.

Referenced by AddHistograms(), and GetTransHistogram().

RangeDouble TridControl::fTransRanges[kNumTransModes] [protected]

Definition at line 182 of file TridControl.h.

Referenced by ChangeTransRange(), GetRangedModelTrans(), and GetTransRange().

SigC::Ptr<GuiMenu> TridControl::fWindowMenu [protected]

Definition at line 166 of file TridControl.h.

map< PageDisplay *, TridControl * > TridControl::sControls [static, protected]

Definition at line 191 of file TridControl.h.

Referenced by Instance(), and ~TridControl().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1