23#ifndef VCL_BGFX_DRAWABLE_DRAWABLE_LINES_H
24#define VCL_BGFX_DRAWABLE_DRAWABLE_LINES_H
26#include <vclib/bgfx/context.h>
27#include <vclib/bgfx/primitives/lines.h>
28#include <vclib/render/drawable/drawable_object.h>
37 bool mUseLineIndices =
false;
40 std::vector<float> mVertCoords;
41 std::vector<uint> mVertColors;
42 std::vector<float> mVertNormals;
43 std::vector<uint> mLineColors;
44 std::vector<uint> mLineIndices;
51 const std::vector<float>&
vertNormals = std::vector<float>(),
52 const std::vector<uint>&
vertColors = std::vector<uint>(),
53 const std::vector<uint>&
lineColors = std::vector<uint>())
61 const std::vector<float>&
vertNormals = std::vector<float>(),
62 const std::vector<uint>&
vertColors = std::vector<uint>(),
63 const std::vector<uint>&
lineColors = std::vector<uint>())
77 other.shadingPerVertex(),
79 other.implementationType()),
80 mVisible(
other.mVisible), mUseLineIndices(
other.mUseLineIndices),
81 mVertColors(
other.mVertColors), mVertNormals(
other.mVertNormals),
82 mLineColors(
other.mLineColors), mLineIndices(
other.mLineIndices)
102 swap(mVisible,
other.mVisible);
103 swap(mUseLineIndices,
other.mUseLineIndices);
105 swap(mVertCoords,
other.mVertCoords);
106 swap(mLineIndices,
other.mLineIndices);
107 swap(mVertColors,
other.mVertColors);
108 swap(mVertNormals,
other.mVertNormals);
109 swap(mLineColors,
other.mLineColors);
123 mUseLineIndices =
false;
138 mUseLineIndices =
true;
162 return std::make_shared<DrawableLines>(*
this);
165 std::shared_ptr<DrawableObject>
clone() &&
override
167 return std::make_shared<DrawableLines>(std::move(*
this));
174 void setImplementationType(ImplementationType type)
176 if (mUseLineIndices) {
187 mVertCoords, mVertNormals, mVertColors, mLineColors, type);
A class representing a box in N-dimensional space.
Definition box.h:46
Definition drawable_lines.h:35
vcl::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_lines.h:155
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_lines.h:165
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_lines.h:160
void draw(const DrawObjectSettings &settings) const override
This member function must draw the object. It will be called at every frame.
Definition drawable_lines.h:150
void setVisibility(bool vis) override
This member function is used to set the visibility of the object.
Definition drawable_lines.h:172
bool isVisible() const override
This member function is used to check if the object is visible.
Definition drawable_lines.h:170
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:57
void swap(DrawableObject &other)
Utility swap function that allows to swap the content of two DrawableObject instances.
Definition drawable_object.h:195
DrawableObject()=default
Empty constructor.
The Lines class provides an abstraction for rendering 3D lines with variable thickness and different ...
Definition lines.h:56
void draw(uint viewId) const
Draws in the given view the lines with the current settings.
Definition lines.h:427
void setPoints(const std::vector< float > &vertCoords, const std::vector< float > &vertNormals, const std::vector< uint > &vertColors, const std::vector< uint > &lineColors, ImplementationType type=ImplementationType::COUNT)
Sets the points of the lines.
Definition lines.h:236
The Point class represents an N-dimensional point containing N scalar values.
Definition point.h:55