Visual Computing Library
Loading...
Searching...
No Matches
vcl::DrawableAxis Class Reference
Inheritance diagram for vcl::DrawableAxis:

Public Member Functions

 DrawableAxis (double size=1)
 
 DrawableAxis (const DrawableAxis &other)
 
 DrawableAxis (DrawableAxis &&other)
 
DrawableAxisoperator= (DrawableAxis other)
 
void swap (DrawableAxis &other)
 
void setSize (double size)
 
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/.
 
bool isVisible () const override
 This member function is used to check if the object is visible.
 
void setVisibility (bool vis) override
 This member function is used to set the visibility of the object.
 
- Public Member Functions inherited from vcl::DrawableObject
 DrawableObject ()=default
 Empty constructor.
 
virtual void init ()
 This member function is called after the initialization of the Context. It must initialize and bind data to the GPU like buffers and textures.
 
virtual const std::string & name () const
 Returns the name of the object.
 
virtual std::string & name ()
 Returns a reference of the name of the object, that allows to modify it.
 
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 Member Functions

void updateMatrices (double size)
 
void createAxis ()
 

Private Attributes

bool mVisible = false
 
vcl::Matrix44f mMatrices [3]
 
MeshRenderBuffers< vcl::TriMeshmArrowBuffers [2]
 
bgfx::ProgramHandle mProgram
 
DrawableAxisUniforms mUniforms
 

Static Private Attributes

static const std::pair< vcl::TriMesh, vcl::TriMeshAXIS_MESHES
 
static const vcl::Color AXIS_COLORS [3]
 

Friends

void swap (DrawableAxis &a, DrawableAxis &b)
 

Additional Inherited Members

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

Member Function Documentation

◆ boundingBox()

Box3d vcl::DrawableAxis::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]

std::shared_ptr< DrawableObject > vcl::DrawableAxis::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]

std::shared_ptr< DrawableObject > vcl::DrawableAxis::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()

void vcl::DrawableAxis::draw ( uint  viewId) const
overridevirtual

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.

◆ isVisible()

bool vcl::DrawableAxis::isVisible ( ) const
inlineoverridevirtual

This member function is used to check if the object is visible.

Returns
true if the object is visible;

Implements vcl::DrawableObject.

◆ setVisibility()

void vcl::DrawableAxis::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;

Implements vcl::DrawableObject.

Member Data Documentation

◆ AXIS_COLORS

const vcl::Color vcl::DrawableAxis::AXIS_COLORS[3]
inlinestaticprivate
Initial value:
= {
vcl::Color::Red,
vcl::Color::Green,
vcl::Color::Blue}

◆ AXIS_MESHES

const std::pair<vcl::TriMesh, vcl::TriMesh> vcl::DrawableAxis::AXIS_MESHES
inlinestaticprivate

◆ mMatrices

vcl::Matrix44f vcl::DrawableAxis::mMatrices[3]
private
Initial value:
= {
vcl::Matrix44f::Zero(),
vcl::Matrix44f::Zero(),
vcl::Matrix44f::Zero()}

◆ mProgram

bgfx::ProgramHandle vcl::DrawableAxis::mProgram
private
Initial value:
=
.programManager()
.getProgram<VertFragProgram::DRAWABLE_AXIS>()
static Context & instance(void *windowHandle=nullptr, void *displayHandle=nullptr)
Return the context instance.
Definition context.cpp:365

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