Visual Computing Library
Loading...
Searching...
No Matches
drawable_object_vector.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_DRAWABLE_OBJECT_VECTOR_H
24#define VCL_RENDER_DRAWABLE_DRAWABLE_OBJECT_VECTOR_H
25
26#include "drawable_object.h"
27
28#include <vclib/space/core/box.h>
29#include <vclib/space/core/vector/polymorphic_object_vector.h>
30
31namespace vcl {
32
34 public PolymorphicObjectVector<DrawableObject>,
35 public DrawableObject
36{
38
39 bool mVisible = true;
40
41public:
42 DrawableObjectVector() = default;
43
44 // DrawableObject interface
45 void init();
46 void draw(uint viewId) const;
47 Box3d boundingBox() const;
48 std::shared_ptr<DrawableObject> clone() const&;
49 std::shared_ptr<DrawableObject> clone() &&;
50 bool isVisible() const;
51 void setVisibility(bool vis);
52
53private:
54 uint firstVisibleObject() const;
55};
56
57} // namespace vcl
58
59#endif // VCL_RENDER_DRAWABLE_DRAWABLE_OBJECT_VECTOR_H
Definition drawable_object_vector.h:36
std::shared_ptr< DrawableObject > clone() const &
This member function is used to create a new copy of the DrawableObject. Each derived class must impl...
Definition drawable_object_vector.cpp:59
bool isVisible() const
This member function is used to check if the object is visible.
Definition drawable_object_vector.cpp:69
void init()
This member function is called after the initialization of the Context. It must initialize and bind d...
Definition drawable_object_vector.cpp:27
Box3d boundingBox() const
This member function is used to find a good camera position to render object. It should return the th...
Definition drawable_object_vector.cpp:44
void setVisibility(bool vis)
This member function is used to set the visibility of the object.
Definition drawable_object_vector.cpp:74
void draw(uint viewId) const
This member function must draw the object. It will be called at every frame.
Definition drawable_object_vector.cpp:34
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:55
The PolymorphicObjectVector class is a container that stores a collection of polymorphic objects,...
Definition polymorphic_object_vector.h:66
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43