RangeControl< TYPE > Class Template Reference

#include <RangeControl.h>

Inheritance diagram for RangeControl< TYPE >:
Undoable

List of all members.

Public Member Functions

 RangeControl (UndoHistory *history=0, Range< TYPE > *range=0)
virtual ~RangeControl ()
void Set (TYPE min, TYPE max)
void SetMin (TYPE min)
void SetMax (TYPE max)
void Apply (Range< TYPE > *r)
void UseRange (Range< TYPE > *range)
Range< TYPE > & GetRange ()
UndoMemento GetMemento ()
void StartCompound ()
void StopCompound ()

Private Attributes

SigC::Ptr< UndoHistoryfHistory
SigC::Ptr< Range< TYPE > > fRange
bool fBlockHistory

Detailed Description

template<class TYPE>
class RangeControl< TYPE >

Id
RangeControl.h,v 1.4 2005/07/21 20:26:36 bv Exp

Definition at line 26 of file RangeControl.h.


Constructor & Destructor Documentation

template<class TYPE>
RangeControl< TYPE >::RangeControl ( UndoHistory history = 0,
Range< TYPE > *  range = 0 
) [inline]

Definition at line 31 of file RangeControl.h.

00032         : fHistory(history), fRange(range), fBlockHistory(false) { 
00033         if (!fHistory) fHistory = SigC::manage(new UndoHistory);
00034         if (!fRange) fRange = SigC::manage(new Range<TYPE>); 
00035     }

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

Definition at line 49 of file RangeControl.h.

00049 {}


Member Function Documentation

template<class TYPE>
void RangeControl< TYPE >::Apply ( Range< TYPE > *  r  )  [inline]

Definition at line 64 of file RangeControl.h.

00064                                {
00065         if (!fBlockHistory) fHistory->Store(*this);
00066         fRange->Set(r->Min(),r->Max());
00067     }

template<class TYPE>
UndoMemento RangeControl< TYPE >::GetMemento ( void   )  [inline, virtual]

Implements Undoable.

Definition at line 91 of file RangeControl.h.

00091                              {
00092         using namespace SigC;
00093         return bind(slot(*fRange,&Range<TYPE>::SetState),fRange->GetState());
00094     }

template<class TYPE>
Range<TYPE>& RangeControl< TYPE >::GetRange ( void   )  [inline]
template<class TYPE>
void RangeControl< TYPE >::Set ( TYPE  min,
TYPE  max 
) [inline]

Definition at line 52 of file RangeControl.h.

Referenced by main(), GuiSlider::UpdateRange(), and zoom_range().

00052                                  {
00053         if (!fBlockHistory) fHistory->Store(*this);
00054         fRange->Set(min,max);
00055     }

template<class TYPE>
void RangeControl< TYPE >::SetMax ( TYPE  max  )  [inline]

Definition at line 60 of file RangeControl.h.

00060                           {
00061         if (!fBlockHistory) fHistory->Store(*this);
00062         fRange->SetMax(max);
00063     }

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

Definition at line 56 of file RangeControl.h.

00056                           {
00057         if (!fBlockHistory) fHistory->Store(*this);
00058         fRange->SetMin(min);
00059     }

template<class TYPE>
void RangeControl< TYPE >::StartCompound (  )  [inline]

Definition at line 96 of file RangeControl.h.

Referenced by GuiSlider::StartCompound().

00096                          { 
00097         fHistory->Store(*this);
00098         fBlockHistory = true;
00099     }

template<class TYPE>
void RangeControl< TYPE >::StopCompound (  )  [inline]

Definition at line 100 of file RangeControl.h.

Referenced by GuiSlider::StopCompound().

00100                         {
00101         fBlockHistory = false;
00102     }

template<class TYPE>
void RangeControl< TYPE >::UseRange ( Range< TYPE > *  range  )  [inline]

Definition at line 78 of file RangeControl.h.

Referenced by GuiSlider::UseExtrema(), RangeControl< double >::UseRange(), and GuiSlider::UseRange().

00078                                       {
00079         using namespace SigC;
00080         UndoItem ui(*this, 
00081                     SigC::bind(SigC::slot(*this,&RangeControl::UseRange),
00082                                fRange));
00083         fHistory->Store(ui);
00084         fRange = range;
00085     }


Member Data Documentation

template<class TYPE>
bool RangeControl< TYPE >::fBlockHistory [private]
template<class TYPE>
SigC::Ptr<UndoHistory> RangeControl< TYPE >::fHistory [private]
template<class TYPE>
SigC::Ptr<Range<TYPE> > RangeControl< TYPE >::fRange [private]

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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1