Visual Computing Library
Loading...
Searching...
No Matches
abstract_drawable_mesh.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_RENDER_DRAWABLE_ABSTRACT_DRAWABLE_MESH_H
24#define VCL_RENDER_DRAWABLE_ABSTRACT_DRAWABLE_MESH_H
25
26#include "drawable_object.h"
27#include "mesh/mesh_render_settings.h"
28
29namespace vcl {
30
32{
33protected:
35
36public:
37 AbstractDrawableMesh() = default;
38
40
41 template<MeshConcept MeshType>
42 AbstractDrawableMesh(const MeshType& m) : mMRS(m)
43 {
44 }
45
46 const MeshRenderSettings& renderSettings() const { return mMRS; }
47
48 virtual void updateBuffers(
50 MeshRenderInfo::BUFFERS_ALL) = 0;
51
52 virtual void setRenderSettings(const MeshRenderSettings& rs) { mMRS = rs; }
53
54 // DrawableObject implementation
55
56 inline bool isVisible() const { return mMRS.isVisible(); }
57
58 inline void setVisibility(bool vis) { mMRS.setVisibility(vis); }
59
60protected:
61 void swap(AbstractDrawableMesh& other)
62 {
63 using std::swap;
65 swap(mMRS, other.mMRS);
66 }
67};
68
69} // namespace vcl
70
71#endif // VCL_RENDER_DRAWABLE_ABSTRACT_DRAWABLE_MESH_H
Definition abstract_drawable_mesh.h:32
void setVisibility(bool vis)
This member function is used to set the visibility of the object.
Definition abstract_drawable_mesh.h:58
bool isVisible() const
This member function is used to check if the object is visible.
Definition abstract_drawable_mesh.h:56
The BitSet class allows to treat an integral type as an array of booleans of a guaranteed size.
Definition bit_set.h:53
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:55
void swap(DrawableObject &other)
Utility swap function that allows to swap the content of two DrawableObject instances.
Definition drawable_object.h:185
The MeshRenderSettings class allows an easy management of render settings of a Mesh....
Definition mesh_render_settings.h:71
bool isVisible() const
Returns whether the mesh is visible.
Definition mesh_render_settings.h:200
bool setVisibility(bool b)
Sets the visibility of the mesh.
Definition mesh_render_settings.h:322
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43