g4tools  5.4.0
Public Member Functions | Public Attributes | List of all members
tools::sg::gstos_add Class Reference

Public Member Functions

 gstos_add ()
 
virtual ~gstos_add ()
 
 gstos_add (const gstos_add &)
 
gstos_addoperator= (const gstos_add &)
 
void clear ()
 
void add_points (size_t a_floatn, const float *a_xyzs)
 
void add_lines (size_t a_floatn, const float *a_xyzs)
 
void add_line_strip (size_t a_floatn, const float *a_xyzs)
 
void add_line_loop (size_t a_floatn, const float *a_xyzs)
 
void add_triangles_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms)
 
void add_triangle_strip_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms)
 
void add_triangle_fan_normal (size_t a_floatn, const float *a_xyzs, const float *a_nms)
 
void add_triangle_strip_as_triangles (size_t a_floatn, const float *a_xyzs, const float *a_nms)
 

Public Attributes

std::vector< float > m_xyzs
 
std::vector< float > m_nms
 
size_t m_gsto_points_sz
 
size_t m_gsto_lines_sz
 
size_t m_gsto_tris_sz
 
size_t m_gsto_nms_sz
 

Detailed Description

Definition at line 15 of file gstos_add.

Constructor & Destructor Documentation

◆ gstos_add() [1/2]

tools::sg::gstos_add::gstos_add ( )
inline

Definition at line 17 of file gstos_add.

17 {}

◆ ~gstos_add()

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

Definition at line 18 of file gstos_add.

18 {}

◆ gstos_add() [2/2]

tools::sg::gstos_add::gstos_add ( const gstos_add )
inline

Definition at line 20 of file gstos_add.

20 {}

Member Function Documentation

◆ add_line_loop()

void tools::sg::gstos_add::add_line_loop ( size_t  a_floatn,
const float *  a_xyzs 
)
inline

Definition at line 40 of file gstos_add.

40  {
41  size_t num = a_floatn/3;
42  if(num<2) return;
43  size_t nxyzs = num*2*3;
44  size_t offset = m_xyzs.size();
45  m_xyzs.resize(offset+nxyzs);
46  float* pxyzs = vec_data<float>(m_xyzs)+offset;
47  gl::line_loop_to_lines(num,a_xyzs,pxyzs);
48  }

◆ add_line_strip()

void tools::sg::gstos_add::add_line_strip ( size_t  a_floatn,
const float *  a_xyzs 
)
inline

Definition at line 31 of file gstos_add.

31  {
32  size_t num = a_floatn/3;
33  if(num<2) return;
34  size_t nxyzs = (num-1)*2*3;
35  size_t offset = m_xyzs.size();
36  m_xyzs.resize(offset+nxyzs);
37  float* pxyzs = vec_data<float>(m_xyzs)+offset;
38  gl::line_strip_to_lines(num,a_xyzs,pxyzs);
39  }

◆ add_lines()

void tools::sg::gstos_add::add_lines ( size_t  a_floatn,
const float *  a_xyzs 
)
inline

Definition at line 28 of file gstos_add.

28  {
29  append(m_xyzs,a_floatn,a_xyzs);
30  }

◆ add_points()

void tools::sg::gstos_add::add_points ( size_t  a_floatn,
const float *  a_xyzs 
)
inline

Definition at line 25 of file gstos_add.

25  {
26  append(m_xyzs,a_floatn,a_xyzs);
27  }

◆ add_triangle_fan_normal()

void tools::sg::gstos_add::add_triangle_fan_normal ( size_t  a_floatn,
const float *  a_xyzs,
const float *  a_nms 
)
inline

Definition at line 65 of file gstos_add.

65  {
66  size_t num = a_floatn/3;
67  if(num<3) return;
68  size_t nxyzs = (num-2)*3*3;
69  size_t offset = m_xyzs.size();
70  m_xyzs.resize(offset+nxyzs);
71  float* pxyzs = vec_data<float>(m_xyzs)+offset;
72  offset = m_nms.size();
73  m_nms.resize(offset+nxyzs);
74  float* pnms = vec_data<float>(m_nms)+offset;
75  gl::triangle_fan_to_triangles_nms(num,a_xyzs,a_nms,pxyzs,pnms);
76  }

◆ add_triangle_strip_as_triangles()

void tools::sg::gstos_add::add_triangle_strip_as_triangles ( size_t  a_floatn,
const float *  a_xyzs,
const float *  a_nms 
)
inline

Definition at line 78 of file gstos_add.

78  { //used in sg::sphere, icosahedron_sphere.
79  add_triangle_strip_normal(a_floatn,a_xyzs,a_nms);
80  }

◆ add_triangle_strip_normal()

void tools::sg::gstos_add::add_triangle_strip_normal ( size_t  a_floatn,
const float *  a_xyzs,
const float *  a_nms 
)
inline

Definition at line 53 of file gstos_add.

53  {
54  size_t num = a_floatn/3;
55  if(num<3) return;
56  size_t nxyzs = (num-2)*3*3;
57  size_t offset = m_xyzs.size();
58  m_xyzs.resize(offset+nxyzs);
59  float* pxyzs = vec_data<float>(m_xyzs)+offset;
60  offset = m_nms.size();
61  m_nms.resize(offset+nxyzs);
62  float* pnms = vec_data<float>(m_nms)+offset;
63  gl::triangle_strip_to_triangles_nms(num,a_xyzs,a_nms,pxyzs,pnms);
64  }

◆ add_triangles_normal()

void tools::sg::gstos_add::add_triangles_normal ( size_t  a_floatn,
const float *  a_xyzs,
const float *  a_nms 
)
inline

Definition at line 49 of file gstos_add.

49  {
50  append(m_xyzs,a_floatn,a_xyzs);
51  append(m_nms,a_floatn,a_nms);
52  }

◆ clear()

void tools::sg::gstos_add::clear ( )
inline

Definition at line 23 of file gstos_add.

23 {m_xyzs.clear();m_nms.clear();}

◆ operator=()

gstos_add& tools::sg::gstos_add::operator= ( const gstos_add )
inline

Definition at line 21 of file gstos_add.

21 {return *this;}

Member Data Documentation

◆ m_gsto_lines_sz

size_t tools::sg::gstos_add::m_gsto_lines_sz

Definition at line 113 of file gstos_add.

◆ m_gsto_nms_sz

size_t tools::sg::gstos_add::m_gsto_nms_sz

Definition at line 115 of file gstos_add.

◆ m_gsto_points_sz

size_t tools::sg::gstos_add::m_gsto_points_sz

Definition at line 112 of file gstos_add.

◆ m_gsto_tris_sz

size_t tools::sg::gstos_add::m_gsto_tris_sz

Definition at line 114 of file gstos_add.

◆ m_nms

std::vector<float> tools::sg::gstos_add::m_nms

Definition at line 110 of file gstos_add.

◆ m_xyzs

std::vector<float> tools::sg::gstos_add::m_xyzs

Definition at line 109 of file gstos_add.


The documentation for this class was generated from the following file:
tools::gl::triangle_strip_to_triangles_nms
void triangle_strip_to_triangles_nms(size_t a_npt, const float *a_xyzs, const float *a_nms, float *&a_pxyzs, float *&a_pnms)
Definition: glprims:307
tools::gl::triangle_fan_to_triangles_nms
void triangle_fan_to_triangles_nms(size_t a_npt, const float *a_xyzs, const float *a_nms, float *&a_pxyzs, float *&a_pnms)
Definition: glprims:302
tools::gl::line_strip_to_lines
void line_strip_to_lines(size_t a_npt, const float *a_xyzs, float *&a_pxyzs)
Definition: glprims:425
tools::sg::gstos_add::m_xyzs
std::vector< float > m_xyzs
Definition: gstos_add:109
tools::append
void append(std::vector< T > &a_vec, const std::vector< T > &a_from)
Definition: vmanip:66
tools::gl::line_loop_to_lines
void line_loop_to_lines(size_t a_npt, const float *a_xyzs, float *&a_pxyzs)
Definition: glprims:455
tools::sg::gstos_add::m_nms
std::vector< float > m_nms
Definition: gstos_add:110
tools::sg::gstos_add::add_triangle_strip_normal
void add_triangle_strip_normal(size_t a_floatn, const float *a_xyzs, const float *a_nms)
Definition: gstos_add:53