cgv
Loading...
Searching...
No Matches
vr::vr_log Class Reference

helper struct for logging vr events More...

#include <vr_log.h>

Inheritance diagram for vr::vr_log:
cgv::data::ref_counted

Public Types

enum  StorageMode { SM_IN_MEMORY = 1 , SM_OSTREAM = 2 , SM_IN_MEMORY_AND_OSTREAM = 3 , SM_NONE = 0 }
 
enum  Filter {
  F_POSE = 1 , F_BUTTON = 2 , F_AXES = 4 , F_VIBRATION = 8 ,
  F_HMD = 16 , F_ALL = 31 , F_NONE = 0
}
 
template<class T >
using container = std::vector< T, std::allocator< T > >
 

Public Member Functions

 vr_log (std::istringstream &is)
 
void log_vr_state (const vr::vr_kit_state &state, const double &time)
 write vr_kit_state to log , and stream serialized vr_kit_state to log_stream if ostream_log is enabled
 
void disable_log ()
 disable logging
 
void enable_in_memory_log ()
 enable in memory log
 
void enable_ostream_log (const std::shared_ptr< std::ostream > &stream)
 enable writing to ostream.
 
void set_filter (int f)
 define what data should be recorded.
 
int get_filter () const
 
void lock_settings ()
 prevent changes to settings and enables log_vr_state methods
 
const size_t recorded_vr_states () const
 
bool load_state (std::istringstream &is)
 read log from stream
 
- Public Member Functions inherited from cgv::data::ref_counted
int get_ref_count () const
 read access to current count
 

Public Attributes

container< double > time_stamp
 
container< cgv::mat3x4hmd_pose
 
container< uint8_t > hmd_status
 
container< cgv::vecncontroller_axes [max_nr_controllers]
 
container< cgv::mat3x4controller_pose [max_nr_controllers]
 
container< cgv::vec2controller_vibration [max_nr_controllers]
 
container< unsigned > controller_button_flags [max_nr_controllers]
 
container< uint8_t > controller_status [max_nr_controllers]
 

Protected Member Functions

void log_vr_state (const vr::vr_kit_state &state, const int mode, const int filter, const double time, std::ostream *log_stream)
 record state
 
- Protected Member Functions inherited from cgv::data::ref_counted
 ref_counted ()
 constructor initializes the count to 0
 
void set_ref_count (int c) const
 write access is also const to allow ref counted pointers to const instances
 

Detailed Description

helper struct for logging vr events

Definition at line 19 of file vr_log.h.

Member Typedef Documentation

◆ container

template<class T >
using vr::vr_log::container = std::vector<T, std::allocator<T> >

Definition at line 22 of file vr_log.h.

Member Enumeration Documentation

◆ Filter

enum vr::vr_log::Filter

Definition at line 30 of file vr_log.h.

◆ StorageMode

enum vr::vr_log::StorageMode

Definition at line 23 of file vr_log.h.

Constructor & Destructor Documentation

◆ vr_log()

vr::vr_log::vr_log ( std::istringstream &  is)

Definition at line 129 of file vr_log.cxx.

Member Function Documentation

◆ disable_log()

void vr::vr_log::disable_log ( )

disable logging

Definition at line 107 of file vr_log.cxx.

◆ enable_in_memory_log()

void vr::vr_log::enable_in_memory_log ( )

enable in memory log

Definition at line 115 of file vr_log.cxx.

Referenced by cgv::gui::vr_server::enable_log().

◆ enable_ostream_log()

void vr::vr_log::enable_ostream_log ( const std::shared_ptr< std::ostream > &  stream)

enable writing to ostream.

Definition at line 121 of file vr_log.cxx.

Referenced by cgv::gui::vr_server::enable_log().

◆ get_filter()

int vr::vr_log::get_filter ( ) const
inline

Definition at line 87 of file vr_log.h.

◆ load_state()

bool vr::vr_log::load_state ( std::istringstream &  is)

read log from stream

Definition at line 323 of file vr_log.cxx.

◆ lock_settings()

void vr::vr_log::lock_settings ( )

prevent changes to settings and enables log_vr_state methods

Definition at line 300 of file vr_log.cxx.

Referenced by cgv::gui::vr_server::enable_log().

◆ log_vr_state() [1/2]

void vr::vr_log::log_vr_state ( const vr::vr_kit_state state,
const double &  time 
)
inline

write vr_kit_state to log , and stream serialized vr_kit_state to log_stream if ostream_log is enabled

Definition at line 70 of file vr_log.h.

◆ log_vr_state() [2/2]

void vr::vr_log::log_vr_state ( const vr::vr_kit_state state,
const int  mode,
const int  filter,
const double  time,
std::ostream *  log_stream 
)
protected

◆ recorded_vr_states()

const size_t vr::vr_log::recorded_vr_states ( ) const
inline

Definition at line 94 of file vr_log.h.

◆ set_filter()

void vr::vr_log::set_filter ( int  f)
inline

define what data should be recorded.

Definition at line 82 of file vr_log.h.

Referenced by cgv::gui::vr_server::enable_log().

Member Data Documentation

◆ controller_axes

container<cgv::vecn> vr::vr_log::controller_axes[max_nr_controllers]

Definition at line 45 of file vr_log.h.

◆ controller_button_flags

container<unsigned> vr::vr_log::controller_button_flags[max_nr_controllers]

Definition at line 48 of file vr_log.h.

◆ controller_pose

container<cgv::mat3x4> vr::vr_log::controller_pose[max_nr_controllers]

Definition at line 46 of file vr_log.h.

◆ controller_status

container<uint8_t> vr::vr_log::controller_status[max_nr_controllers]

Definition at line 49 of file vr_log.h.

◆ controller_vibration

container<cgv::vec2> vr::vr_log::controller_vibration[max_nr_controllers]

Definition at line 47 of file vr_log.h.

◆ hmd_pose

container<cgv::mat3x4> vr::vr_log::hmd_pose

Definition at line 42 of file vr_log.h.

◆ hmd_status

container<uint8_t> vr::vr_log::hmd_status

Definition at line 43 of file vr_log.h.

◆ time_stamp

container<double> vr::vr_log::time_stamp

Definition at line 40 of file vr_log.h.


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