Visual Computing Library
Loading...
Searching...
No Matches
vcl::DrawableMeshBGFX< MeshType > Class Template Reference
Inheritance diagram for vcl::DrawableMeshBGFX< MeshType >:

Public Member Functions

 DrawableMeshBGFX (const MeshType &mesh)
 
 DrawableMeshBGFX (MeshType &&mesh)
 
 DrawableMeshBGFX (const DrawableMeshBGFX &drawableMesh)
 
 DrawableMeshBGFX (DrawableMeshBGFX &&drawableMesh)
 
DrawableMeshBGFXoperator= (DrawableMeshBGFX drawableMesh)
 
void updateBuffers (MRI::BuffersBitSet buffersToUpdate=MRI::BUFFERS_ALL) override
 
std::string & name () override
 Returns a reference of the name of the object, that allows to modify it.
 
const std::string & name () const override
 Returns the name of the object.
 
void swap (DrawableMeshBGFX &other)
 
void init () override
 This member function is called after the initialization of the Context. It must initialize and bind data to the GPU like buffers and textures.
 
void draw (uint viewId) const override
 This member function must draw the object. It will be called at every frame.
 
Box3d boundingBox () const override
 This member function is used to find a good camera position to render object. It should return the the bounding box of the object. Return a null bounding box if the object shouldn't influence the position of the camera.
 
std::shared_ptr< DrawableObjectclone () const &override
 This member function is used to create a new copy of the DrawableObject. Each derived class must implement this member function, that returns a shared pointer pointing to a copy of the current one. for more details about this paradigm, check polimorphism clone in modern c++: https://www.fluentcpp.com/2017/09/08/make-polymorphic-copy-modern-cpp/.
 
std::shared_ptr< DrawableObjectclone () &&override
 This member function is used to create a new DrawableObject that is a moved from the current one. This object will be destroyed after the call of this function. Each derived class must implement this member function, that returns a shared pointer pointing to the moved object. For more details about this paradigm, check polimorphism clone in modern c++: https://www.fluentcpp.com/2017/09/08/make-polymorphic-copy-modern-cpp/.
 
void setVisibility (bool vis) override
 This member function is used to set the visibility of the object.
 
void setRenderSettings (const MeshRenderSettings &rs) override
 
- Public Member Functions inherited from vcl::AbstractDrawableMesh
 AbstractDrawableMesh (const AbstractDrawableMesh &other)=default
 
template<MeshConcept MeshType>
 AbstractDrawableMesh (const MeshType &m)
 
const MeshRenderSettingsrenderSettings () const
 
bool isVisible () const
 This member function is used to check if the object is visible.
 
- Public Member Functions inherited from vcl::DrawableObject
 DrawableObject ()=default
 Empty constructor.
 
const std::string & info () const
 Returns the info of the object.
 
std::string & info ()
 Returns a reference of the info of the object, that allows to modify it.
 

Private Types

using MRI = MeshRenderInfo
 

Private Member Functions

void bindUniforms () const
 

Private Attributes

Box3d mBoundingBox
 
MeshRenderBuffers< MeshType > mMRB
 
bgfx::ProgramHandle mProgramEdges
 
bgfx::ProgramHandle mProgramPoints
 
bgfx::ProgramHandle mProgramSurface
 
bgfx::ProgramHandle mProgramWireframe
 
MeshRenderSettingsUniforms mMeshRenderSettingsUniforms
 

Friends

void swap (DrawableMeshBGFX &a, DrawableMeshBGFX &b)
 

Additional Inherited Members

- Protected Member Functions inherited from vcl::AbstractDrawableMesh
void swap (AbstractDrawableMesh &other)
 
- Protected Member Functions inherited from vcl::DrawableObject
void swap (DrawableObject &other)
 Utility swap function that allows to swap the content of two DrawableObject instances.
 
- Protected Attributes inherited from vcl::AbstractDrawableMesh
MeshRenderSettings mMRS
 

Member Function Documentation

◆ boundingBox()

template<MeshConcept MeshType>
Box3d vcl::DrawableMeshBGFX< MeshType >::boundingBox ( ) const
inlineoverridevirtual

This member function is used to find a good camera position to render object. It should return the the bounding box of the object. Return a null bounding box if the object shouldn't influence the position of the camera.

Returns
The bounding box of the object.

Implements vcl::DrawableObject.

◆ clone() [1/2]

template<MeshConcept MeshType>
std::shared_ptr< DrawableObject > vcl::DrawableMeshBGFX< MeshType >::clone ( ) &&
inlineoverridevirtual

This member function is used to create a new DrawableObject that is a moved from the current one. This object will be destroyed after the call of this function. Each derived class must implement this member function, that returns a shared pointer pointing to the moved object. For more details about this paradigm, check polimorphism clone in modern c++: https://www.fluentcpp.com/2017/09/08/make-polymorphic-copy-modern-cpp/.

Generally, if your class that inherits from DrawableObject is called MyObject, the clone member function should be implemented as follows:

std::shared_ptr<DrawableObject> MyObject::clone() &&
{
return std::make_shared<MyObject>(std::move(*this));
}
Returns
A shared pointers that points to a new DrawableObject that is a moved from the current one.

Implements vcl::DrawableObject.

◆ clone() [2/2]

template<MeshConcept MeshType>
std::shared_ptr< DrawableObject > vcl::DrawableMeshBGFX< MeshType >::clone ( ) const &
inlineoverridevirtual

This member function is used to create a new copy of the DrawableObject. Each derived class must implement this member function, that returns a shared pointer pointing to a copy of the current one. for more details about this paradigm, check polimorphism clone in modern c++: https://www.fluentcpp.com/2017/09/08/make-polymorphic-copy-modern-cpp/.

Generally, if your class that inherits from DrawableObject is called MyObject, the clone member function should be implemented as follows:

std::shared_ptr<DrawableObject> MyObject::clone() const&
{
return std::make_shared<MyObject>(*this);
}
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Returns
A shared pointers that points to a new DrawableObject that is a copy of the current one.

Implements vcl::DrawableObject.

◆ draw()

template<MeshConcept MeshType>
void vcl::DrawableMeshBGFX< MeshType >::draw ( uint  viewId) const
inlineoverridevirtual

This member function must draw the object. It will be called at every frame.

Parameters
viewIdThe ID of the view to draw. It may be used depending on the rendering engine.

Implements vcl::DrawableObject.

◆ init()

template<MeshConcept MeshType>
void vcl::DrawableMeshBGFX< MeshType >::init ( )
inlineoverridevirtual

This member function is called after the initialization of the Context. It must initialize and bind data to the GPU like buffers and textures.

Reimplemented from vcl::DrawableObject.

◆ name() [1/2]

template<MeshConcept MeshType>
const std::string & vcl::DrawableMeshBGFX< MeshType >::name ( ) const
inlineoverridevirtual

Returns the name of the object.

Returns
The name of the object.

Reimplemented from vcl::DrawableObject.

◆ name() [2/2]

template<MeshConcept MeshType>
std::string & vcl::DrawableMeshBGFX< MeshType >::name ( )
inlineoverridevirtual

Returns a reference of the name of the object, that allows to modify it.

Parameters
[in]nameThe name of the object.

Reimplemented from vcl::DrawableObject.

◆ setRenderSettings()

template<MeshConcept MeshType>
void vcl::DrawableMeshBGFX< MeshType >::setRenderSettings ( const MeshRenderSettings rs)
inlineoverridevirtual

Reimplemented from vcl::AbstractDrawableMesh.

◆ setVisibility()

template<MeshConcept MeshType>
void vcl::DrawableMeshBGFX< MeshType >::setVisibility ( bool  vis)
inlineoverridevirtual

This member function is used to set the visibility of the object.

Parameters
[in]vistrue if the object should be visible;

Reimplemented from vcl::AbstractDrawableMesh.

◆ updateBuffers()

template<MeshConcept MeshType>
void vcl::DrawableMeshBGFX< MeshType >::updateBuffers ( MRI::BuffersBitSet  buffersToUpdate = MRI::BUFFERS_ALL)
inlineoverridevirtual

Member Data Documentation

◆ mProgramEdges

template<MeshConcept MeshType>
bgfx::ProgramHandle vcl::DrawableMeshBGFX< MeshType >::mProgramEdges
private
Initial value:
=
.programManager()
.getProgram<VertFragProgram::DRAWABLE_MESH_EDGES>()
static Context & instance(void *windowHandle=nullptr, void *displayHandle=nullptr)
Return the context instance.
Definition context.cpp:365

◆ mProgramPoints

template<MeshConcept MeshType>
bgfx::ProgramHandle vcl::DrawableMeshBGFX< MeshType >::mProgramPoints
private
Initial value:
=
.programManager()
.getProgram<VertFragProgram::DRAWABLE_MESH_POINTS>()

◆ mProgramSurface

template<MeshConcept MeshType>
bgfx::ProgramHandle vcl::DrawableMeshBGFX< MeshType >::mProgramSurface
private
Initial value:
=
.programManager()
.getProgram<VertFragProgram::DRAWABLE_MESH_SURFACE>()

◆ mProgramWireframe

template<MeshConcept MeshType>
bgfx::ProgramHandle vcl::DrawableMeshBGFX< MeshType >::mProgramWireframe
private
Initial value:
=
.programManager()
.getProgram<VertFragProgram::DRAWABLE_MESH_WIREFRAME>()

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