23#ifndef VCL_BGFX_DRAWABLE_DRAWABLE_AXIS_H
24#define VCL_BGFX_DRAWABLE_DRAWABLE_AXIS_H
26#include "mesh/mesh_render_buffers.h"
28#include <vclib/algorithms/mesh/create.h>
29#include <vclib/meshes/tri_mesh.h>
30#include <vclib/render/drawable/drawable_object.h>
31#include <vclib/space/core/matrix.h>
33#include <vclib/bgfx/context.h>
41 inline static const std::pair<vcl::TriMesh, vcl::TriMesh> AXIS_MESHES =
44 inline static const vcl::Color AXIS_COLORS[3] = {
49 bool mVisible =
false;
52 vcl::Matrix44f::Zero(),
53 vcl::Matrix44f::Zero(),
54 vcl::Matrix44f::Zero()};
63 for (uint
i = 0;
i < 3;
i++) {
64 mMatrices[
i] =
other.mMatrices[
i];
83 swap(mVisible,
other.mVisible);
84 for (uint
i = 0;
i < 3;
i++) {
85 swap(mMatrices[
i],
other.mMatrices[
i]);
87 for (uint
i = 0;
i < 2;
i++) {
88 mArrowBuffers[
i].swap(
other.mArrowBuffers[
i]);
94 void setSize(
double size);
104 return std::make_shared<DrawableAxis>(*
this);
107 std::shared_ptr<DrawableObject>
clone() &&
override
109 return std::make_shared<DrawableAxis>(std::move(*
this));
117 void updateMatrices(
double size);
The Color class represents a 32 bit color.
Definition color.h:48
Definition drawable_axis.h:40
Box3d boundingBox() const override
This member function is used to find a good camera position to render object. It should return the th...
Definition drawable_axis.h:100
void setVisibility(bool vis) override
This member function is used to set the visibility of the object.
Definition drawable_axis.h:114
void draw(const DrawObjectSettings &settings) const override
This member function must draw the object. It will be called at every frame.
Definition drawable_axis.cpp:43
bool isVisible() const override
This member function is used to check if the object is visible.
Definition drawable_axis.h:112
std::shared_ptr< DrawableObject > clone() const &override
This member function is used to create a new copy of the DrawableObject. Each derived class must impl...
Definition drawable_axis.h:102
std::shared_ptr< DrawableObject > clone() &&override
This member function is used to create a new DrawableObject that is a moved from the current one....
Definition drawable_axis.h:107
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:57
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41