g4tools  5.4.0
Public Member Functions | List of all members
tools::sg::sf_rotf Class Reference
Inheritance diagram for tools::sg::sf_rotf:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::sf_rotf:
Collaboration graph
[legend]

Public Member Functions

virtual bool write (io::iwbuf &a_buffer)
 
virtual bool read (io::irbuf &a_buffer)
 
virtual bool dump (std::ostream &)
 
virtual bool s_value (std::string &a_s) const
 
virtual bool s2value (const std::string &)
 
 sf_rotf ()
 
 sf_rotf (const rotf &a_value)
 
virtual ~sf_rotf ()
 
 sf_rotf (const sf_rotf &a_from)
 
sf_rotfoperator= (const sf_rotf &a_from)
 
sf_rotfoperator= (const rotf &a_value)
 
void setValue (const vec3f &a_axis, float a_angle)
 
void setValue (const rotf &a_value)
 
- Public Member Functions inherited from tools::sg::bsf< rotf >
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const
 
 bsf (const rotf &a_value)
 
 bsf (const bsf &a_from)
 
virtual ~bsf ()
 
bsfoperator= (const bsf &a_from)
 
bsfoperator= (const rotf &a_value)
 
bool operator== (const bsf &a_from) const
 
bool operator== (const rotf &a_value) const
 
bool operator!= (const bsf &a_from) const
 
bool operator!= (const rotf &a_value) const
 
 operator const rotf & () const
 
 operator rotf ()
 
rotfvalue ()
 
const rotfvalue () const
 
void value (const rotf &a_value)
 
void value_no_cmp (const rotf &a_value)
 
void setValue (const rotf &a_value)
 
const rotfgetValue () const
 
- Public Member Functions inherited from tools::sg::field
virtual const std::string & s_cls () const =0
 
virtual ~field ()
 
void touch ()
 
bool touched () const
 
void reset_touched ()
 

Additional Inherited Members

- Static Public Member Functions inherited from tools::sg::bsf< rotf >
static const std::string & s_class ()
 
- Protected Member Functions inherited from tools::sg::bsf< rotf >
 bsf ()
 
- Protected Member Functions inherited from tools::sg::field
 field ()
 
 field (const field &)
 
fieldoperator= (const field &)
 
- Protected Attributes inherited from tools::sg::bsf< rotf >
rotf m_value
 
- Protected Attributes inherited from tools::sg::field
bool m_touched
 

Detailed Description

Definition at line 16 of file sf_rotf.

Constructor & Destructor Documentation

◆ sf_rotf() [1/3]

tools::sg::sf_rotf::sf_rotf ( )
inline

Definition at line 50 of file sf_rotf.

50 :parent(){}

◆ sf_rotf() [2/3]

tools::sg::sf_rotf::sf_rotf ( const rotf a_value)
inline

Definition at line 51 of file sf_rotf.

51 :parent(a_value){}

◆ ~sf_rotf()

virtual tools::sg::sf_rotf::~sf_rotf ( )
inlinevirtual

Definition at line 52 of file sf_rotf.

52 {}

◆ sf_rotf() [3/3]

tools::sg::sf_rotf::sf_rotf ( const sf_rotf a_from)
inline

Definition at line 54 of file sf_rotf.

54 :parent(a_from){}

Member Function Documentation

◆ dump()

virtual bool tools::sg::sf_rotf::dump ( std::ostream &  )
inlinevirtual

Implements tools::sg::field.

Definition at line 43 of file sf_rotf.

43  {
44  //a_out << parent::m_value << std::endl;
45  return true;
46  }

◆ operator=() [1/2]

sf_rotf& tools::sg::sf_rotf::operator= ( const rotf a_value)
inline

Definition at line 60 of file sf_rotf.

60  {
61  parent::operator=(a_value);
62  return *this;
63  }

◆ operator=() [2/2]

sf_rotf& tools::sg::sf_rotf::operator= ( const sf_rotf a_from)
inline

Definition at line 55 of file sf_rotf.

55  {
56  parent::operator=(a_from);
57  return *this;
58  }

◆ read()

virtual bool tools::sg::sf_rotf::read ( io::irbuf a_buffer)
inlinevirtual

Implements tools::sg::field.

Definition at line 24 of file sf_rotf.

24  {
25  vec4<float>& vec = m_value.quat();
26  uint32 n;
27  float* v;
28  if(!a_buffer.read_vec(n,v)) return false;
29  if(n!=vec.size()) {
30  delete [] v;
31 #ifdef TOOLS_MEM
32  mem::decrement(s_new().c_str());
33 #endif
34  return false;
35  }
36  for(uint32 index=0;index<n;index++) vec[index] = v[index];
37  delete [] v;
38 #ifdef TOOLS_MEM
39  mem::decrement(s_new().c_str());
40 #endif
41  return true;
42  }

◆ s2value()

virtual bool tools::sg::sf_rotf::s2value ( const std::string &  )
inlinevirtual

Implements tools::sg::field.

Definition at line 48 of file sf_rotf.

48 {return false;}

◆ s_value()

virtual bool tools::sg::sf_rotf::s_value ( std::string &  a_s) const
inlinevirtual

Implements tools::sg::field.

Definition at line 47 of file sf_rotf.

47 {a_s.clear();return false;}

◆ setValue() [1/2]

void tools::sg::sf_rotf::setValue ( const rotf a_value)
inline

Definition at line 68 of file sf_rotf.

68  {
69  value(a_value);
70  }

◆ setValue() [2/2]

void tools::sg::sf_rotf::setValue ( const vec3f a_axis,
float  a_angle 
)
inline

Definition at line 65 of file sf_rotf.

65  {
66  value(rotf(a_axis,a_angle));
67  }

◆ write()

virtual bool tools::sg::sf_rotf::write ( io::iwbuf a_buffer)
inlinevirtual

Implements tools::sg::field.

Definition at line 19 of file sf_rotf.

19  {
20  const vec4<float>& vec = m_value.quat();
21  const float* d = get_data(vec);
22  return a_buffer.write_vec(vec.size(),d);
23  }

The documentation for this class was generated from the following file:
tools::sg::bsf< rotf >::m_value
rotf m_value
Definition: bsf:120
tools::qrot::quat
const VEC4 & quat() const
Definition: qrot:366
tools::sg::field::operator=
field & operator=(const field &)
Definition: field:57
tools::sg::get_data
const std::string * get_data(const std::vector< std::string > &a_v)
Definition: mf:191
tools::sg::bsf< rotf >::value
rotf & value()
Definition: bsf:98
tools::uint32
unsigned int uint32
Definition: typedefs:71