API Documentation
Loading...
Searching...
No Matches
MaterialPropertySlider.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/QTDesignObject.h>
4#include <NDEVR/DesignObjectWidgetInterface.h>
5#include <NDEVR/QCustomSlider.h>
6namespace NDEVR
7{
8 /**--------------------------------------------------------------------------------------------------
9 \brief Can adjust the properties of a material using a QCustomSlider widget.
10 **/
12 {
13 public:
14 MaterialPropertySlider(const DynamicPointer<QTDesignObject>& object, Material::MaterialProperties property, QWidget* parent = nullptr);
15 MaterialPropertySlider(Material::MaterialProperties property, QWidget* parent = nullptr);
16
17 void addTarget(const DynamicPointer<QTDesignObject>& object) override
18 {
19 DesignObjectWidgetInterface::addTarget(object);
20 }
21 void removeTarget(const DynamicPointer<QTDesignObject>& object) override
22 {
23 DesignObjectWidgetInterface::removeTarget(object);
24 }
25
27 {
28 fltp08 thickness = mat.getMaterialProperty<fltp08>(m_property);
29 QCustomSlider::setValue(thickness);
30 }
31
32 void onTargetUpdated(UUID id) override;
34 {
36 }
37 protected:
38 void init();
39 protected:
41 };
42 /**--------------------------------------------------------------------------------------------------
43 \brief Can adjust the pixel thickness of a material using a QCustomSlider widget.
44 **/
46 {
47 public:
48 PixelThicknessSlider(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
49 : MaterialPropertySlider(object, Material::e_pixel_thickness, parent)
50 {}
51 PixelThicknessSlider(QWidget* parent = nullptr)
52 : MaterialPropertySlider(Material::e_pixel_thickness, parent)
53 {}
54 };
55 /**--------------------------------------------------------------------------------------------------
56 \brief Can adjust the opacity of a material using a QCustomSlider widget.
57 **/
59 {
60 public:
61 OpacitySlider(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
62 : MaterialPropertySlider(object, Material::e_opacity, parent)
63 {}
64 OpacitySlider(QWidget* parent = nullptr)
65 : MaterialPropertySlider(Material::e_opacity, parent)
66 {}
67 };
68 /**--------------------------------------------------------------------------------------------------
69 \brief Can adjust the depth offset of a material using a QCustomSlider widget.
70 **/
72 {
73 public:
74 DepthBiasSlider(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
75 : MaterialPropertySlider(object, Material::e_depth_bias, parent)
76 {}
77 DepthBiasSlider(QWidget* parent = nullptr)
78 : MaterialPropertySlider(Material::e_depth_bias, parent)
79 {}
80 };
81}
#define NDEVR_API
Definition DLLInfo.h:50
Can adjust the depth offset of a material using a QCustomSlider widget.
Definition MaterialPropertySlider.h:72
DepthBiasSlider(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Definition MaterialPropertySlider.h:74
DepthBiasSlider(QWidget *parent=nullptr)
Definition MaterialPropertySlider.h:77
A base class for interacting with one or more DesignObjects.
Definition DesignObjectWidgetInterface.h:11
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
t_type getMaterialProperty(MaterialProperties mat_index) const
Definition Material.h:174
MaterialProperties
Definition Material.h:114
Can adjust the properties of a material using a QCustomSlider widget.
Definition MaterialPropertySlider.h:12
void addTarget(const DynamicPointer< QTDesignObject > &object) override
Definition MaterialPropertySlider.h:17
void onObjectDeletedSlot()
Definition MaterialPropertySlider.h:33
MaterialPropertySlider(const DynamicPointer< QTDesignObject > &object, Material::MaterialProperties property, QWidget *parent=nullptr)
MaterialPropertySlider(Material::MaterialProperties property, QWidget *parent=nullptr)
void removeTarget(const DynamicPointer< QTDesignObject > &object) override
Definition MaterialPropertySlider.h:21
void onTargetUpdated(UUID id) override
void refreshFromMaterial(const Material &mat)
Definition MaterialPropertySlider.h:26
Material::MaterialProperties m_property
Definition MaterialPropertySlider.h:40
Can adjust the opacity of a material using a QCustomSlider widget.
Definition MaterialPropertySlider.h:59
OpacitySlider(QWidget *parent=nullptr)
Definition MaterialPropertySlider.h:64
OpacitySlider(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Definition MaterialPropertySlider.h:61
Can adjust the pixel thickness of a material using a QCustomSlider widget.
Definition MaterialPropertySlider.h:46
PixelThicknessSlider(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Definition MaterialPropertySlider.h:48
PixelThicknessSlider(QWidget *parent=nullptr)
Definition MaterialPropertySlider.h:51
The slider is the classic widget for controlling a bounded value. It lets the user move a slider hand...
Definition QCustomSlider.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149