CMS 3D CMS Logo

IgQtRangeMValue< T > Class Template Reference

#include <Iguana/GLBrowsers/interface/IgQtRangeMValue.h>

Inheritance diagram for IgQtRangeMValue< T >:

IgQtRangeMControlImp< T >

List of all members.

Public Types

enum  BoundaryHandling { ACCUMULATE, MODULATE }
typedef IgQtRangeMValue< T > inherited
typedef std::vector< T > rangeMValues

Public Member Functions

virtual BoundaryHandling boundaryHandling (void) const
 IgQtRangeMValue (const rangeMValues &values, T min=0, T max=SHRT_MAX)
 IgQtRangeMValue (unsigned int size, const T *values, T min=0, T max=SHRT_MAX)
 IgQtRangeMValue (T value=0, T min=0, T max=SHRT_MAX)
virtual bool isValueChanged (unsigned int index) const
virtual bool isValueChanged (void) const
virtual T maxValue (void) const
virtual T minValue (void) const
virtual void resize (unsigned int size, T appendedValues=0)
virtual void setBoundaryHandling (BoundaryHandling mode)
virtual void setMaxValue (T max)
virtual void setMinValue (T min)
virtual void setRange (T min, T max)
virtual void setValue (const rangeMValues &values)
virtual void setValue (unsigned int size, const T *values)
virtual void setValue (unsigned int index, T value)
unsigned int size (void) const
virtual const rangeMValuesvalue (void) const
virtual T value (unsigned int index) const
virtual const rangeMValuesvalueChange (void) const
virtual T valueChange (unsigned int index) const
virtual ~IgQtRangeMValue (void)

Protected Member Functions

accumulate (T value) const
adjustValue (T value)
virtual void forceValue (const rangeMValues &values)
virtual void forceValue (unsigned int size, const T *values)
virtual void forceValue (unsigned int index, T value)
virtual void forceValue (T value)
virtual void forceValueChanged (const rangeMValues &delta)
virtual void forceValueChanged (unsigned int size, const T *delta)
virtual void forceValueChanged (unsigned int index, T delta)
virtual void forceValueChanged (T delta)
modulate (T value) const

Protected Attributes

BoundaryHandling m_boundary
rangeMValues m_change
m_max
m_min
rangeMValues m_value
bool m_valueChangeFlag


Detailed Description

template<class T>
class IgQtRangeMValue< T >

Definition at line 19 of file IgQtRangeMValue.h.


Member Typedef Documentation

template<class T>
typedef IgQtRangeMValue<T> IgQtRangeMValue< T >::inherited

Reimplemented in IgQtRangeMControlFloat, IgQtRangeMControlImp< T >, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 22 of file IgQtRangeMValue.h.

template<class T>
typedef std::vector<T> IgQtRangeMValue< T >::rangeMValues

Reimplemented in IgQtRangeMControlImp< T >, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 29 of file IgQtRangeMValue.h.


Member Enumeration Documentation

template<class T>
enum IgQtRangeMValue::BoundaryHandling

Enumerator:
ACCUMULATE 
MODULATE 

Definition at line 24 of file IgQtRangeMValue.h.

00024                           {
00025         ACCUMULATE,
00026         MODULATE
00027     };


Constructor & Destructor Documentation

template<class T>
IgQtRangeMValue< T >::IgQtRangeMValue ( value = 0,
min = 0,
max = SHRT_MAX 
) [inline]

Definition at line 235 of file IgQtRangeMValue.h.

References IgQtRangeMValue< T >::m_value, and IgQtRangeMValue< T >::setValue().

00238     : m_value (1, value),
00239       m_change (1, value),
00240       m_min (min),
00241       m_max (max),
00242       m_boundary (ACCUMULATE),
00243       m_valueChangeFlag (false)
00244 { setValue (m_value); }

template<class T>
IgQtRangeMValue< T >::IgQtRangeMValue ( unsigned int  size,
const T *  values,
min = 0,
max = SHRT_MAX 
) [inline]

Definition at line 247 of file IgQtRangeMValue.h.

References ASSERT, and IgQtRangeMValue< T >::setValue().

00251     : m_value (size, 0),
00252       m_change (size, 0),
00253       m_min (min),
00254       m_max (max),
00255       m_boundary (ACCUMULATE),
00256       m_valueChangeFlag (false)
00257 { 
00258     ASSERT (size);
00259     setValue (size, values);
00260 }

template<class T>
IgQtRangeMValue< T >::IgQtRangeMValue ( const rangeMValues values,
min = 0,
max = SHRT_MAX 
) [inline]

Definition at line 263 of file IgQtRangeMValue.h.

References ASSERT, and IgQtRangeMValue< T >::setValue().

00266     : m_value (values.size (), 0),
00267       m_change (values.size (), 0),
00268       m_min (min),
00269       m_max (max),
00270       m_boundary (ACCUMULATE),
00271       m_valueChangeFlag (false)
00272 {
00273     ASSERT (values.size());
00274     setValue (values);
00275 }

template<class T>
virtual IgQtRangeMValue< T >::~IgQtRangeMValue ( void   )  [inline, virtual]

Definition at line 45 of file IgQtRangeMValue.h.

00045 {}


Member Function Documentation

template<class T>
T IgQtRangeMValue< T >::accumulate ( value  )  const [inline, protected]

Definition at line 143 of file IgQtRangeMValue.h.

00144     {
00145       if (value > m_max)
00146         return m_max;
00147       else if (value < m_min)
00148         return m_min;
00149       return value;
00150     }

template<class T>
T IgQtRangeMValue< T >::adjustValue ( value  )  [inline, protected]

Definition at line 152 of file IgQtRangeMValue.h.

00153     {
00154       switch (boundaryHandling ())
00155       {
00156       case ACCUMULATE:
00157         value = accumulate (value);
00158         break;
00159 
00160       case MODULATE:
00161         value = modulate (value);
00162         break;
00163       }
00164       return value;
00165     }

template<class T>
virtual BoundaryHandling IgQtRangeMValue< T >::boundaryHandling ( void   )  const [inline, virtual]

Definition at line 125 of file IgQtRangeMValue.h.

00126     { return m_boundary; }

template<class T>
virtual void IgQtRangeMValue< T >::forceValue ( const rangeMValues values  )  [inline, protected, virtual]

Definition at line 186 of file IgQtRangeMValue.h.

00187     {
00188       unsigned int size = values.size ();
00189       for (unsigned int i = 0; i < size; i++)
00190         forceValue (i, values[i]);
00191     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValue ( unsigned int  size,
const T *  values 
) [inline, protected, virtual]

Definition at line 180 of file IgQtRangeMValue.h.

00181     {
00182       for (unsigned int i = 0; i < size; i++)
00183         forceValue (i, values[i]);
00184     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValue ( unsigned int  index,
value 
) [inline, protected, virtual]

Definition at line 174 of file IgQtRangeMValue.h.

00175     {
00176       ASSERT ( index < m_value.size() );
00177       m_value [index] = value;
00178     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValue ( value  )  [inline, protected, virtual]

Definition at line 167 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< T >::initialize().

00168     {
00169       unsigned int size = m_value.size ();
00170       for (unsigned int i = 0; i < size; i++)
00171         m_value [i] = value;
00172     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValueChanged ( const rangeMValues delta  )  [inline, protected, virtual]

Definition at line 216 of file IgQtRangeMValue.h.

00217     {
00218       unsigned int size = delta.size ();
00219       m_valueChangeFlag = false;
00220       for (unsigned int i = 0; i < size; i++)
00221         forceValueChanged (i, delta[i]);
00222     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValueChanged ( unsigned int  size,
const T *  delta 
) [inline, protected, virtual]

Definition at line 209 of file IgQtRangeMValue.h.

00210     {
00211       m_valueChangeFlag = false;
00212       for (unsigned int i = 0; i < size; i++)
00213         forceValueChanged (i, delta[i]);
00214     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValueChanged ( unsigned int  index,
delta 
) [inline, protected, virtual]

Reimplemented in IgQtRangeMValueFloat.

Definition at line 201 of file IgQtRangeMValue.h.

00202     {
00203       ASSERT ( index < m_change.size() );
00204       m_change [index] = delta;
00205       if(delta != 0)
00206         m_valueChangeFlag = true;
00207     }

template<class T>
virtual void IgQtRangeMValue< T >::forceValueChanged ( delta  )  [inline, protected, virtual]

Reimplemented in IgQtRangeMValueFloat.

Definition at line 193 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< T >::initialize(), and IgQtRangeMControlImp< T >::setDirty().

00194     {
00195       unsigned int size = m_change.size ();
00196       for (unsigned int i = 0; i < size; i++)
00197         m_change [i] = delta;
00198       m_valueChangeFlag = delta ? true : false;
00199     }

template<class T>
virtual bool IgQtRangeMValue< T >::isValueChanged ( unsigned int  index  )  const [inline, virtual]

Reimplemented in IgQtRangeMValueFloat.

Definition at line 99 of file IgQtRangeMValue.h.

00100     { return valueChange (index) != 0 ? true : false; }

template<class T>
virtual bool IgQtRangeMValue< T >::isValueChanged ( void   )  const [inline, virtual]

Definition at line 96 of file IgQtRangeMValue.h.

00097     { return m_valueChangeFlag; }

template<class T>
virtual T IgQtRangeMValue< T >::maxValue ( void   )  const [inline, virtual]

Definition at line 119 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< T >::moveValue(), and IgQtRangeMControlImp< T >::updateTextValue().

00120     { return m_max; }

template<class T>
virtual T IgQtRangeMValue< T >::minValue ( void   )  const [inline, virtual]

Definition at line 113 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< T >::moveValue(), and IgQtRangeMControlImp< T >::updateTextValue().

00114     { return m_min; }

template<class T>
T IgQtRangeMValue< T >::modulate ( value  )  const [inline, protected]

Definition at line 135 of file IgQtRangeMValue.h.

00136     {
00137       T width = m_max - m_min;
00138       value -= int ((value - m_min) / width) * width;
00139       value += int ((m_max - value) / width) * width;
00140       return value;
00141     }

template<class T>
virtual void IgQtRangeMValue< T >::resize ( unsigned int  size,
appendedValues = 0 
) [inline, virtual]

Reimplemented in IgQtRangeMControlFloat, IgQtRangeMControlImp< T >, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 50 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< short >::resize().

00051     {
00052       ASSERT (size);
00053       if (size == m_value.size ()) return;
00054       m_value.resize(size, appendedValues);
00055       m_change.resize(size, 0);
00056     }

template<class T>
virtual void IgQtRangeMValue< T >::setBoundaryHandling ( BoundaryHandling  mode  )  [inline, virtual]

Definition at line 128 of file IgQtRangeMValue.h.

00129     { 
00130       if (m_boundary != mode)
00131       { m_boundary = mode; setValue (m_value); }
00132     }

template<class T>
virtual void IgQtRangeMValue< T >::setMaxValue ( max  )  [inline, virtual]

Definition at line 122 of file IgQtRangeMValue.h.

00123     { setRange (max, maxValue ()); }

template<class T>
virtual void IgQtRangeMValue< T >::setMinValue ( min  )  [inline, virtual]

Definition at line 116 of file IgQtRangeMValue.h.

00117     { setRange (min, maxValue ()); }

template<class T>
virtual void IgQtRangeMValue< T >::setRange ( min,
max 
) [inline, virtual]

Reimplemented in IgQtRangeMControlFloat, IgQtRangeMControlImp< T >, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 102 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< short >::editSettings(), IgQtRangeMControlImp< short >::setRange(), and IgQtRangeMControlImp< short >::setSettingString().

00103     {
00104       if (min == m_min && max == m_max)
00105         return;
00106       else if (min > max)
00107         std::swap (min, max);
00108       m_max = max;
00109       m_min = min;
00110       setValue (m_value);
00111     }

template<class T>
virtual void IgQtRangeMValue< T >::setValue ( const rangeMValues values  )  [inline, virtual]

Reimplemented in IgQtRangeMControlImp< T >, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 75 of file IgQtRangeMValue.h.

00076     { setValue (values.size (), &values [0]); }

template<class T>
virtual void IgQtRangeMValue< T >::setValue ( unsigned int  size,
const T *  values 
) [inline, virtual]

Reimplemented in IgQtRangeMControlFloat, IgQtRangeMControlImp< T >, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 67 of file IgQtRangeMValue.h.

00068     {
00069       m_valueChangeFlag = false;
00070       resize (size);
00071       for(unsigned int i = 0; i < size; i++)
00072         setValue (i, values [i]);
00073     }

template<class T>
virtual void IgQtRangeMValue< T >::setValue ( unsigned int  index,
value 
) [inline, virtual]

Reimplemented in IgQtRangeMControlFloat, IgQtRangeMControlImp< T >, IgQtRangeMValueFloat, IgQtRangeMControlImp< long >, IgQtRangeMControlImp< unsigned long >, IgQtRangeMControlImp< int >, IgQtRangeMControlImp< unsigned int >, IgQtRangeMControlImp< unsigned short >, and IgQtRangeMControlImp< short >.

Definition at line 58 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMValue< T >::IgQtRangeMValue(), and IgQtRangeMControlImp< short >::setValue().

00059     {
00060       ASSERT ( index < m_value.size() );
00061       value = adjustValue (value);
00062       m_change[index] += value - m_value [index];
00063       m_value[index]  = value;
00064       m_valueChangeFlag = isValueChanged (index);
00065     }

template<class T>
unsigned int IgQtRangeMValue< T >::size ( void   )  const [inline]

Definition at line 47 of file IgQtRangeMValue.h.

00048     { return m_value.size(); }

template<class T>
virtual const rangeMValues& IgQtRangeMValue< T >::value ( void   )  const [inline, virtual]

Definition at line 84 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMControlImp< T >::initialize(), and IgQtRangeMControlImp< T >::moveValue().

00085     { return m_value; }

template<class T>
virtual T IgQtRangeMValue< T >::value ( unsigned int  index  )  const [inline, virtual]

Definition at line 78 of file IgQtRangeMValue.h.

00079     {
00080       ASSERT ( index < m_value.size() );
00081       return m_value [index];
00082     }

template<class T>
virtual const rangeMValues& IgQtRangeMValue< T >::valueChange ( void   )  const [inline, virtual]

Definition at line 93 of file IgQtRangeMValue.h.

00094     { return m_change; }

template<class T>
virtual T IgQtRangeMValue< T >::valueChange ( unsigned int  index  )  const [inline, virtual]

Definition at line 87 of file IgQtRangeMValue.h.

00088     {
00089       ASSERT ( index < m_value.size() );
00090       return m_change[index];
00091     }


Member Data Documentation

template<class T>
BoundaryHandling IgQtRangeMValue< T >::m_boundary [protected]

Definition at line 230 of file IgQtRangeMValue.h.

template<class T>
rangeMValues IgQtRangeMValue< T >::m_change [protected]

Definition at line 227 of file IgQtRangeMValue.h.

template<class T>
T IgQtRangeMValue< T >::m_max [protected]

Definition at line 229 of file IgQtRangeMValue.h.

template<class T>
T IgQtRangeMValue< T >::m_min [protected]

Definition at line 228 of file IgQtRangeMValue.h.

template<class T>
rangeMValues IgQtRangeMValue< T >::m_value [protected]

Definition at line 226 of file IgQtRangeMValue.h.

Referenced by IgQtRangeMValue< T >::IgQtRangeMValue().

template<class T>
bool IgQtRangeMValue< T >::m_valueChangeFlag [protected]

Definition at line 231 of file IgQtRangeMValue.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:25:32 2009 for CMSSW by  doxygen 1.5.4