sculpto
Public Member Functions | List of all members
scl::topology::grid Class Reference

#include <grid.h>

Inheritance diagram for scl::topology::grid:
scl::topology::basis< vertex > scl::topology::cone scl::topology::full_screen_quad scl::topology::plane scl::topology::sphere

Public Member Functions

int GetWidth () const
 
int GetHeight () const
 
 grid (int Width, int Height)
 
 ~grid () override=default
 
- Public Member Functions inherited from scl::topology::basis< vertex >
const mesh_type GetType () const
 
const std::vector< vertexGetVertices () const
 
const std::vector< u32GetIndices () const
 
const vec3GetBoundMin () const
 
const vec3GetBoundMax () const
 
std::vector< vertex >::const_iterator cbegin () const
 
std::vector< vertex >::const_iterator cend () const
 
 basis (mesh_type MeshType)
 
 basis (mesh_type MeshType, const std::vector< vertex > &Vertices, const std::vector< u32 > &Indices)
 
 basis (mesh_type MeshType, std::vector< vertex > &&Vertices, std::vector< u32 > &&Indices)
 
virtual ~basis ()=default
 

Additional Inherited Members

- Public Attributes inherited from scl::topology::basis< vertex >
mesh_type MeshType
 
std::vector< vertexVertices
 
std::vector< u32Indices
 
vec3 Min
 
vec3 Max
 

Detailed Description

Topology grid object class.

Definition at line 17 of file grid.h.

Constructor & Destructor Documentation

◆ grid()

scl::topology::grid::grid ( int  Width,
int  Height 
)
  • Topology grid object basis constructor.
Parameters
Vertices- verticeies array.
Indices- vertices indices.

Definition at line 12 of file grid.cpp.

12 :
13 basis(mesh_type::TRIANGLES), Width(Width), Height(Height)
14{
15 for (int i = 0; i < Height; ++i)
16 for (int j = 0; j < Width; ++j)
17 {
18 Indices.push_back((i + 1) * (Width + 1) + j + 1);
19 Indices.push_back((i + 0) * (Width + 1) + j + 1);
20 Indices.push_back((i + 0) * (Width + 1) + j + 0);
21 Indices.push_back((i + 0) * (Width + 1) + j + 0);
22 Indices.push_back((i + 1) * (Width + 1) + j + 0);
23 Indices.push_back((i + 1) * (Width + 1) + j + 1);
24 }
25
26 Min = vec3(0), Max = vec3((float)Width, 0, (float)Height);
27}
std::vector< u32 > Indices
Definition: basis.h:23
basis(mesh_type MeshType)
Definition: basis.h:47
math::vec3< float > vec3
Definition: base.h:38

◆ ~grid()

scl::topology::grid::~grid ( )
overridedefault

Topology grid object default destructor.

Member Function Documentation

◆ GetHeight()

int scl::topology::grid::GetHeight ( ) const
inline

Grid height getter function.

Definition at line 26 of file grid.h.

26{ return Height; }

◆ GetWidth()

int scl::topology::grid::GetWidth ( ) const
inline

Topology grid object getter/setter functions.

Grid width getter function.

Definition at line 24 of file grid.h.

24{ return Width; }

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