MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ update()

template<typename LatticeT , typename CellT >
template<typename PositionT >
bool MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >::update ( const PositionT &  position)
inline

Observe one new position, updating the cell sequence.

Template Parameters
PositionTglm::vec2 for a Lattice2D-backed trajectory, glm::vec3 for a Lattice3D-backed trajectory; must match what LatticeT::cell_at accepts
Parameters
positionPosition in the same coordinate space as the lattice
Returns
true if this observation crossed into a different cell than the previous observation, false if it stayed in the same cell or this is the first observation

Definition at line 72 of file SymbolicTrajectory.hpp.

73 {
74 const CellT cell = m_lattice.cell_at(position);
75 m_history.push(cell);
76
77 if (!m_has_prior) {
78 m_has_prior = true;
79 m_current_cell = cell;
80 return false;
81 }
82
83 const bool crossed = !(cell == m_current_cell);
84 if (crossed) {
86 m_current_cell = cell;
87 }
88 return crossed;
89 }
Memory::HistoryBuffer< CellT > m_history
void push(const T &value)
Push new value to front of history.

References MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >::m_crossing_count, MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >::m_current_cell, MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >::m_has_prior, MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >::m_history, MayaFlux::Kinesis::SymbolicTrajectory< LatticeT, CellT >::m_lattice, and MayaFlux::Memory::HistoryBuffer< T >::push().

+ Here is the call graph for this function: