SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLPoints.h
Go to the documentation of this file.
1 /**
2  * \file SLPoints.h
3  * \date October 2017
4  * \authors Marcus Hudritsch
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLPOINTS_H
11 #define SLPOINTS_H
12 
13 #include <SLMesh.h>
14 #include <SLRnd3f.h>
15 
16 //-----------------------------------------------------------------------------
17 /**
18  * @brief The SLPoints mesh object of witch the vertices are drawn as points.
19  * @remarks It is important that during instantiation NO OpenGL functions (gl*)
20  * get called because this constructor will be most probably called in a parallel
21  * thread from within an SLScene::registerAssetsToLoad or SLScene::assemble
22  * function. All objects that get rendered have to do their OpenGL initialization
23  * when they are used the first time during rendering in the main thread.
24  * For this mesh it means that the objects for OpenGL drawing (_vao, _vaoP,
25  * _vaoN, _vaoT and _vaoS) remain unused until the first frame is rendered.
26  */
27 class SLPoints : public SLMesh
28 {
29 public:
30  //! Ctor for a given vector of points
31  SLPoints(SLAssetManager* assetMgr,
32  const SLVVec3f& points,
33  const SLstring& name = "point cloud",
34  SLMaterial* material = nullptr);
35  SLPoints(SLAssetManager* assetMgr,
36  const SLVVec3f& points,
37  const SLVVec3f& normals,
38  const SLstring& name = "point cloud",
39  SLMaterial* material = 0);
40 
41  //! Ctor for a random point cloud.
42  SLPoints(SLAssetManager* assetMgr,
43  SLuint32 nPoints,
44  SLRnd3f& rnd,
45  const SLstring& name = "normal point cloud",
46  SLMaterial* mat = nullptr);
47 };
48 //-----------------------------------------------------------------------------
49 #endif
string SLstring
Definition: SL.h:158
uint32_t SLuint32
Definition: SL.h:184
vector< SLVec3f > SLVVec3f
Definition: SLVec3.h:325
Toplevel holder of the assets meshes, materials, textures and shaders.
Defines a standard CG material with textures and a shader program.
Definition: SLMaterial.h:56
An SLMesh object is a triangulated mesh, drawn with one draw call.
Definition: SLMesh.h:134
SLMaterial * mat() const
Definition: SLMesh.h:177
const SLstring & name() const
Definition: SLObject.h:38
The SLPoints mesh object of witch the vertices are drawn as points.
Definition: SLPoints.h:28
SLPoints(SLAssetManager *assetMgr, const SLVVec3f &points, const SLstring &name="point cloud", SLMaterial *material=nullptr)
Ctor for a given vector of points.
Definition: SLPoints.cpp:15
Abstract base class for random 3D point generator.
Definition: SLRnd3f.h:18