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

Public Member Functions

virtual void * cast (const std::string &a_class) const
 
virtual bool begin_render (int, int, unsigned int, unsigned int, float, float, float, float, bool=true)
 
virtual void end_render ()
 
virtual unsigned int create_texture (const img_byte &a_img, bool)
 
virtual unsigned int create_gsto_from_data (size_t, const float *)
 
virtual bool is_gsto_id_valid (unsigned int a_id) const
 
virtual void delete_gsto (unsigned int a_id)
 
virtual gsto_mode get_gsto_mode () const
 
virtual void set_gsto_mode (gsto_mode)
 
virtual void available_gsto_modes (std::vector< std::string > &a_v)
 
virtual void available_not_memory_gsto_mode (std::string &a_s) const
 
virtual size_t used_texture_memory () const
 
virtual size_t gstos_size () const
 
 zb_manager ()
 
virtual ~zb_manager ()
 
 zb_manager (const zb_manager &a_from)
 
zb_manageroperator= (const zb_manager &a_from)
 
bool find (unsigned int a_id, img_byte &a_img)
 
void delete_gstos ()
 
- Public Member Functions inherited from tools::sg::render_manager
virtual ~render_manager ()
 
unsigned int create_gsto_from_data (const std::vector< float > &a_xyzs)
 

Protected Types

typedef std::map< unsigned int, img_bytegstos_t
 

Protected Attributes

unsigned int m_gen_id
 
gstos_t m_gstos
 

Detailed Description

Definition at line 18 of file zb_manager.

Member Typedef Documentation

◆ gstos_t

typedef std::map<unsigned int,img_byte> tools::sg::zb_manager::gstos_t
protected

Definition at line 94 of file zb_manager.

Constructor & Destructor Documentation

◆ zb_manager() [1/2]

tools::sg::zb_manager::zb_manager ( )
inline

Definition at line 56 of file zb_manager.

56  :m_gen_id(0){
57 #ifdef TOOLS_MEM
58  mem::increment(s_class().c_str());
59 #endif
60  }

◆ ~zb_manager()

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

Definition at line 61 of file zb_manager.

61  {
62  m_gstos.clear();
63 #ifdef TOOLS_MEM
64  mem::decrement(s_class().c_str());
65 #endif
66  }

◆ zb_manager() [2/2]

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

Definition at line 68 of file zb_manager.

69  :parent(a_from)
70  ,m_gen_id(0)
71  ,m_gstos()
72  {
73 #ifdef TOOLS_MEM
74  mem::increment(s_class().c_str());
75 #endif
76  }

Member Function Documentation

◆ available_gsto_modes()

virtual void tools::sg::zb_manager::available_gsto_modes ( std::vector< std::string > &  a_v)
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 51 of file zb_manager.

51 {a_v.clear();}

◆ available_not_memory_gsto_mode()

virtual void tools::sg::zb_manager::available_not_memory_gsto_mode ( std::string &  a_s) const
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 52 of file zb_manager.

52 {a_s.clear();}

◆ begin_render()

virtual bool tools::sg::zb_manager::begin_render ( int  ,
int  ,
unsigned int  ,
unsigned int  ,
float  ,
float  ,
float  ,
float  ,
bool  = true 
)
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 27 of file zb_manager.

27 {return true;}

◆ cast()

virtual void* tools::sg::zb_manager::cast ( const std::string &  a_class) const
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 22 of file zb_manager.

22  {
23  if(void* p = cmp_cast<zb_manager>(this,a_class)) {return p;}
24  else return 0;
25  }

◆ create_gsto_from_data()

virtual unsigned int tools::sg::zb_manager::create_gsto_from_data ( size_t  ,
const float *   
)
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 36 of file zb_manager.

36 {return 0;}

◆ create_texture()

virtual unsigned int tools::sg::zb_manager::create_texture ( const img_byte a_img,
bool   
)
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 30 of file zb_manager.

30  {
31  m_gen_id++; //never return 0.
32  m_gstos[m_gen_id] = a_img;
33  return m_gen_id;
34  }

◆ delete_gsto()

virtual void tools::sg::zb_manager::delete_gsto ( unsigned int  a_id)
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 43 of file zb_manager.

43  {
44  gstos_t::iterator it = m_gstos.find(a_id);
45  if(it!=m_gstos.end()) m_gstos.erase(it);
46  }

◆ delete_gstos()

void tools::sg::zb_manager::delete_gstos ( )
inline

Definition at line 91 of file zb_manager.

91 {m_gstos.clear();}

◆ end_render()

virtual void tools::sg::zb_manager::end_render ( )
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 28 of file zb_manager.

28 {}

◆ find()

bool tools::sg::zb_manager::find ( unsigned int  a_id,
img_byte a_img 
)
inline

Definition at line 84 of file zb_manager.

84  {
85  gstos_t::iterator it = m_gstos.find(a_id);
86  if(it==m_gstos.end()) return false;
87  a_img = (*it).second;
88  return true;
89  }

◆ get_gsto_mode()

virtual gsto_mode tools::sg::zb_manager::get_gsto_mode ( ) const
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 49 of file zb_manager.

49 {return gsto_memory;}

◆ gstos_size()

virtual size_t tools::sg::zb_manager::gstos_size ( ) const
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 54 of file zb_manager.

54 {return 0;}

◆ is_gsto_id_valid()

virtual bool tools::sg::zb_manager::is_gsto_id_valid ( unsigned int  a_id) const
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 38 of file zb_manager.

38  {
39  gstos_t::const_iterator it = m_gstos.find(a_id);
40  if(it==m_gstos.end()) return false;
41  return true;
42  }

◆ operator=()

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

Definition at line 77 of file zb_manager.

77  {
78  if(&a_from==this) return *this;
79  m_gen_id = 0;
80  m_gstos.clear();
81  return *this;
82  }

◆ set_gsto_mode()

virtual void tools::sg::zb_manager::set_gsto_mode ( gsto_mode  )
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 50 of file zb_manager.

50 {}

◆ used_texture_memory()

virtual size_t tools::sg::zb_manager::used_texture_memory ( ) const
inlinevirtual

Implements tools::sg::render_manager.

Definition at line 53 of file zb_manager.

53 {return 0;}

Member Data Documentation

◆ m_gen_id

unsigned int tools::sg::zb_manager::m_gen_id
protected

Definition at line 93 of file zb_manager.

◆ m_gstos

gstos_t tools::sg::zb_manager::m_gstos
protected

Definition at line 95 of file zb_manager.


The documentation for this class was generated from the following file:
tools::sg::zb_manager::m_gstos
gstos_t m_gstos
Definition: zb_manager:95
tools::sg::zb_manager::m_gen_id
unsigned int m_gen_id
Definition: zb_manager:93
tools::sg::gsto_memory
@ gsto_memory
Definition: enums:173