Visual Computing Library  devel
Loading...
Searching...
No Matches
drawable_object_item.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2026 *
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_QT_GUI_DRAWABLE_OBJECT_ITEM_H
24#define VCL_QT_GUI_DRAWABLE_OBJECT_ITEM_H
25
26#include <vclib/render/drawable/abstract_drawable_mesh.h>
27
28#include <QTreeWidgetItem>
29
30namespace vcl::qt {
31
32class DrawableObjectItem : public QTreeWidgetItem
33{
34public:
35 using IconFunction =
36 std::function<std::pair<QIcon, std::string>(const DrawableObject&)>;
37
38private:
39 std::shared_ptr<DrawableObject> mObj;
40 IconFunction mIconFunction;
41
42public:
43 explicit DrawableObjectItem(
44 const std::shared_ptr<DrawableObject>& obj,
45 IconFunction iconFunction,
46 QTreeWidget* parent = nullptr);
47
48 std::shared_ptr<DrawableObject> drawableObject() const;
49
50private:
51 void addMeshItem();
52
53 void addMeshInfoItem(const AbstractDrawableMesh& mesh);
54 void addTransformMatrixItem(const AbstractDrawableMesh& mesh);
55 void addMaterialsItem(const AbstractDrawableMesh& mesh);
56 void addMaterialData(
57 const AbstractDrawableMesh& mesh,
58 const Material& material,
59 QTreeWidgetItem* parent);
60
61 static void makeItemNotSelectable(QTreeWidgetItem* item);
62};
63
64} // namespace vcl::qt
65
66#endif // VCL_QT_GUI_DRAWABLE_OBJECT_ITEM_H
The AbstractDrawableMesh class is the base class for all the drawable meshes in the VCLib render syst...
Definition abstract_drawable_mesh.h:41
The DrawableObject class is the base class for all the objects that can be drawn in a 3D viewer.
Definition drawable_object.h:57
Represents a Physically-Based Rendering (PBR) material.
Definition material.h:45
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41
Definition drawable_object_item.h:33