VAPOR3 3.9.4
AnimationParams.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2004 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: AnimationParams.h
10//
11// Author: Alan Norton
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: January 2005
16//
17// Description: Defines the AnimationParams class
18// This is derived from the Params class
19// It contains all the parameters required for animation
20
21//
22#ifndef ANIMATIONPARAMS_H
23#define ANIMATIONPARAMS_H
24
25#include <vapor/ParamsBase.h>
26
33
36
38public:
39 AnimationParams(ParamsBase::StateSave *ssave);
40
42
44
47 //
48 size_t GetCurrentTimestep() const { return (size_t)GetValueLong(_currentTimestepTag, 0); }
49
53 //
54 void SetCurrentTimestep(size_t ts)
55 {
56 SetValueLong(_currentTimestepTag, "Set timestep", (long)ts);
57 }
58
61 //
62 size_t GetStartTimestep() const { return (size_t)GetValueLong(_startTimestepTag, 0); }
63
67 //
68 void SetStartTimestep(size_t ts) { SetValueLong(_startTimestepTag, "Set start timestep", (long)ts); }
69
72 //
73 size_t GetEndTimestep() const { return (size_t)GetValueLong(_endTimestepTag, (long)0); }
74
78 //
79 void SetEndTimestep(size_t val) { SetValueLong(_endTimestepTag, "Set end timestep", (long)val); }
80
83 //
84 bool GetPlayBackwards() const { return GetValueLong(_playBackwardsTag, 0); }
85
88 //
89 void SetPlayBackwards(bool val) { SetValueLong(_playBackwardsTag, "Set play direction", (long)val); }
90
93 //
94 size_t GetFrameStepSize() const { return (size_t)GetValueLong(_stepSizeTag, 1); }
95
99 //
100 void SetFrameStepSize(size_t val) { SetValueLong(_stepSizeTag, "Set frame stepsize", (size_t)val); }
101
104 //
105 double GetMaxFrameRate() { return GetValueDouble(_maxRateTag, 1.0); }
106
111 void SetMaxFrameRate(double rate) { SetValueDouble(_maxRateTag, "Set max frame rate", rate); }
112
115 //
116 bool GetRepeating() const { return (GetValueLong(_repeatTag, false)); }
117
121 //
122 void SetRepeating(bool onOff) { SetValueLong(_repeatTag, "enable repeat play", (long)onOff); }
123
124 // Get static string identifier for this params class
125 //
126 static string GetClassType() { return ("AnimationParams"); }
127
128public:
129 static const string _repeatTag;
130 static const string _maxRateTag;
131 static const string _stepSizeTag;
132 static const string _startTimestepTag;
133 static const string _endTimestepTag;
134 static const string _playBackwardsTag;
135 static const string _currentTimestepTag;
136
137private:
139 void _init();
140};
141
142#endif // ANIMATIONPARAMS_H
A class that specifies parameters used in animation.
double GetMaxFrameRate()
size_t GetStartTimestep() const
static const string _endTimestepTag
static const string _currentTimestepTag
void SetEndTimestep(size_t val)
static const string _startTimestepTag
AnimationParams(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node)
bool GetRepeating() const
bool GetPlayBackwards() const
void SetStartTimestep(size_t ts)
size_t GetFrameStepSize() const
void SetMaxFrameRate(double rate)
static const string _repeatTag
static const string _playBackwardsTag
static const string _stepSizeTag
static const string _maxRateTag
AnimationParams(ParamsBase::StateSave *ssave)
static string GetClassType()
size_t GetEndTimestep() const
void SetRepeating(bool onOff)
void SetCurrentTimestep(size_t ts)
void SetPlayBackwards(bool val)
size_t GetCurrentTimestep() const
virtual ~AnimationParams()
void SetFrameStepSize(size_t val)
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
virtual double GetValueDouble(const string tag, double defaultVal) const
virtual void SetValueLong(const string &tag, string description, long value)
virtual void SetValueDouble(const string &tag, string description, double value)
virtual long GetValueLong(const string tag, long defaultVal) const
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77