1 #ifndef _DYN_SEQUENCE_H_
41 friend class boost::serialization::access;
48 template <
typename Archive>
49 void serialize(Archive &ar,
const unsigned int version){
135 inline void append(vector<shared_ptr<T>> elements)
143 inline shared_ptr<T>
get(
size_t index)
const {
return sequence[index];}
150 inline void set(
size_t index, shared_ptr<T> element)
174 inline typename vector<T>::iterator
end() {
return sequence.end();}
208 inline void setId(
string const &
id)
const {this->
id =
id;}
221 #include <scene/dynamic/DynSequence.tpp>
222 #define _DYN_SEQUENCE_H_
Dynamic sequence is a set of elements that must be applied during dynamic simulations to provide dyna...
Definition: DynSequence.h:37
vector< shared_ptr< T > > nextStep()
Obtain sequence corresponding to next step.
shared_ptr< T > get(size_t index) const
Obtain element at given index in the sequence.
Definition: DynSequence.h:143
size_t size() const
Obtain the number of elements composing the sequence.
Definition: DynSequence.h:164
void serialize(Archive &ar, const unsigned int version)
Serialize a dynamic sequence to a stream of bytes.
Definition: DynSequence.h:49
DynSequence(string id, string next, size_t loop)
Dynamic sequence basic constructor.
Definition: DynSequence.h:104
size_t iteration
Current iteration. It is used to control the dynamic sequence application loop. By default,...
Definition: DynSequence.h:86
void remove(size_t index)
Remove element at given index in the sequence.
Definition: DynSequence.h:157
void set(size_t index, shared_ptr< T > element)
Set element at given index in the sequence.
Definition: DynSequence.h:150
vector< T >::iterator end()
Obtain a iterator pointing to the last dynamic sequence element.
Definition: DynSequence.h:174
string id
Unique identifier for the dynamic sequence.
Definition: DynSequence.h:63
void append(shared_ptr< T > element)
Append an element to the sequence.
Definition: DynSequence.h:128
DynSequence()
Default constructor for the dynamic sequence.
Definition: DynSequence.h:94
void clear()
Remove all elements composing the sequence.
Definition: DynSequence.h:178
string getNext() const
Get next identifier for the dynamic sequence.
Definition: DynSequence.h:213
void setNext(string const &next)
Set next identifier for the dynamic sequence.
Definition: DynSequence.h:218
vector< T >::iterator begin()
Obtain a iterator pointing to the first dynamic sequence element.
Definition: DynSequence.h:169
void setLoop(size_t const loop)
Set loop value (max iterations)
Definition: DynSequence.h:196
vector< shared_ptr< T > > sequence
The elements composing the dynamic sequence.
Definition: DynSequence.h:80
void setId(string const &id) const
Set identifier for the dynamic sequence.
Definition: DynSequence.h:208
size_t getLoop() const
Get loop value (max iterations)
Definition: DynSequence.h:190
string getId() const
Get current identifier for the dynamic sequence.
Definition: DynSequence.h:202
string next
Unique identifier for dynamic sequence that must come after this one.
Definition: DynSequence.h:71
void restart()
Restart the dynamic sequence so when nextStep is called again it will start from the first iteration.
void append(vector< shared_ptr< T >> elements)
Append vector of elements to the end of the sequence.
Definition: DynSequence.h:135
size_t loop
Specify for how long the dynamic sequence must be repeated, using simulation steps as unit.
Definition: DynSequence.h:76
size_t getIteration() const
Get current iteration.
Definition: DynSequence.h:184