Range< TYPE > Class Template Reference

#include <Range.h>

List of all members.

Classes

struct  RangeState

Public Member Functions

 Range (TYPE min=0, TYPE max=0, const char *name=0)
virtual ~Range ()
void Set (TYPE min, TYPE max)
void SetMin (TYPE min)
void SetMax (TYPE max)
void Get (TYPE &min, TYPE &max) const
TYPE Min (void) const
TYPE Max (void) const
bool InRange (TYPE val)
TYPE Relative (TYPE val)
TYPE RelativeUnclipped (TYPE val)
const char * GetName (void) const
void SetName (const char *name)
void Merge (const Range &r)
void SetFrom (const Range &r)
void SetState (RangeState rs)
RangeState GetState (void)

Public Attributes

SigC::Signal0< void > modified

Private Member Functions

 Range (const Range &rhs)
Rangeoperator= (const Range &rhs)

Private Attributes

RangeState fState
const char * fName

Detailed Description

template<class TYPE>
class Range< TYPE >

Definition at line 32 of file Range.h.


Constructor & Destructor Documentation

template<class TYPE>
Range< TYPE >::Range ( TYPE  min = 0,
TYPE  max = 0,
const char *  name = 0 
) [inline]

Definition at line 45 of file Range.h.

00046         : fState(min,max), fName(name) {}

template<class TYPE>
virtual Range< TYPE >::~Range (  )  [inline, virtual]

Definition at line 47 of file Range.h.

00047 { /*cerr << "~Range()\n";*/}

template<class TYPE>
Range< TYPE >::Range ( const Range< TYPE > &  rhs  )  [inline, private]

Definition at line 83 of file Range.h.

00083 { SetFrom(rhs); } // copy constructor


Member Function Documentation

template<class TYPE>
void Range< TYPE >::Get ( TYPE &  min,
TYPE &  max 
) const [inline]

Definition at line 53 of file Range.h.

00053 { min=fState.min, max=fState.max; }

template<class TYPE>
const char* Range< TYPE >::GetName ( void   )  const [inline]

Definition at line 66 of file Range.h.

00067         { return fName; }

template<class TYPE>
RangeState Range< TYPE >::GetState ( void   )  [inline]

Definition at line 78 of file Range.h.

00078 { return fState; }

template<class TYPE>
bool Range< TYPE >::InRange ( TYPE  val  )  [inline]

Definition at line 56 of file Range.h.

Referenced by GfxTrackList::Configure(), GfxShowerList::Configure(), select_digit(), and select_strip().

00056 { return val >= fState.min && val <= fState.max; }

template<class TYPE>
TYPE Range< TYPE >::Max ( void   )  const [inline]
template<class TYPE>
void Range< TYPE >::Merge ( const Range< TYPE > &  r  )  [inline]

Definition at line 70 of file Range.h.

00070                                {
00071         bool dirty = false;
00072         if (r.Min() < fState.min) { fState.min = r.Min(); dirty=true; }
00073         if (r.Max() > fState.max) { fState.max = r.Max(); dirty=true; }
00074         if (dirty) this->modified();
00075     }

template<class TYPE>
TYPE Range< TYPE >::Min ( void   )  const [inline]
template<class TYPE>
Range& Range< TYPE >::operator= ( const Range< TYPE > &  rhs  )  [inline, private]

Definition at line 84 of file Range.h.

00084 { SetFrom(rhs); return *this; } // assignment

template<class TYPE>
TYPE Range< TYPE >::Relative ( TYPE  val  )  [inline]

Definition at line 57 of file Range.h.

Referenced by PmtPixels::Refresh().

00057                             { 
00058         val = this->RelativeUnclipped(val);
00059         if (val < 0) return 0.0;
00060         if (val > 1) return 1.0;
00061         return val;
00062     }

template<class TYPE>
TYPE Range< TYPE >::RelativeUnclipped ( TYPE  val  )  [inline]

Definition at line 63 of file Range.h.

Referenced by TridControl::GetRangedModelColor(), TridControl::GetRangedModelTrans(), and Range< double >::Relative().

00063                                      { 
00064         return (val - fState.min) / (fState.max - fState.min); 
00065     }

template<class TYPE>
void Range< TYPE >::Set ( TYPE  min,
TYPE  max 
) [inline]
template<class TYPE>
void Range< TYPE >::SetFrom ( const Range< TYPE > &  r  )  [inline]
template<class TYPE>
void Range< TYPE >::SetMax ( TYPE  max  )  [inline]

Definition at line 52 of file Range.h.

Referenced by EVD::ColorSemanticHandler(), and AltTimeHist::SetTotTimeRange().

00052 { fState.max = max; this->modified(); }

template<class TYPE>
void Range< TYPE >::SetMin ( TYPE  min  )  [inline]

Definition at line 51 of file Range.h.

Referenced by EVD::ColorSemanticHandler(), and AltTimeHist::SetTotTimeRange().

00051 { fState.min = min; this->modified(); }

template<class TYPE>
void Range< TYPE >::SetName ( const char *  name  )  [inline]

Definition at line 68 of file Range.h.

00069         { fName = name; }

template<class TYPE>
void Range< TYPE >::SetState ( RangeState  rs  )  [inline]

Definition at line 77 of file Range.h.

00077 { fState = rs; this->modified(); }


Member Data Documentation

template<class TYPE>
const char* Range< TYPE >::fName [private]

Definition at line 87 of file Range.h.

Referenced by Range< double >::GetName(), and Range< double >::SetName().

template<class TYPE>
RangeState Range< TYPE >::fState [private]
template<class TYPE>
SigC::Signal0<void> Range< TYPE >::modified

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1