23#ifndef VCL_RENDER_DRAWABLE_ABSTRACT_DRAWABLE_MESH_H
24#define VCL_RENDER_DRAWABLE_ABSTRACT_DRAWABLE_MESH_H
26#include "drawable_object.h"
27#include "mesh/mesh_render_settings.h"
29#include <vclib/space/core/matrix.h>
42 inline static const Image EMPTY_IMAGE;
50 using MatIt = std::vector<Material>::const_iterator;
56 template<MeshConcept MeshType>
63 virtual void updateBuffers(
65 MeshRenderInfo::BUFFERS_ALL) = 0;
69 virtual uint vertexNumber()
const = 0;
71 virtual uint faceNumber()
const = 0;
73 virtual uint edgeNumber()
const = 0;
79 virtual const Image& textureImage(
const std::string& path)
const
97 swap(mMRS,
other.mMRS);
98 swap(mBoundingBox,
other.mBoundingBox);
105 template<MeshConcept MeshType>
106 void computeBoundingBox(
const MeshType& m)
110 if (m.boundingBox().isNull()) {
111 bbToInitialize =
true;
115 m.MeshType::boundingBox().template cast<double>();
119 if (bbToInitialize) {
123 if constexpr (HasTransformMatrix<MeshType>) {
124 mBoundingBox = transformBox(mBoundingBox, m.transformMatrix());
The AbstractDrawableMesh class is the base class for all the drawable meshes in the VCLib render syst...
Definition abstract_drawable_mesh.h:41
Box3d boundingBox() const override
This member function is used to find a good camera position to render object. It should return the th...
Definition abstract_drawable_mesh.h:86
void setVisibility(bool vis) override
This member function is used to set the visibility of the object.
Definition abstract_drawable_mesh.h:90
bool isVisible() const override
This member function is used to check if the object is visible.
Definition abstract_drawable_mesh.h:88
The BitSet class allows to treat an integral type as an array of booleans of a guaranteed size.
Definition bit_set.h:52
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
A class for representing and manipulating 2D images.
Definition image.h:48
The MeshRenderSettings class allows an easy management of render settings of a Mesh....
Definition mesh_render_settings.h:70
bool isVisible() const
Returns whether the mesh is visible.
Definition mesh_render_settings.h:199
bool setVisibility(bool b)
Sets the visibility of the mesh.
Definition mesh_render_settings.h:321
Concept that is evaluated true if a Mesh has the BoundingBox component.
Definition mesh_requirements.h:53
auto boundingBox(const PointType &p)
Compute the bounding box of a single point.
Definition bounding_box.h:59