NDEVR
API Documentation
MaterialPropertySlider.h
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{
11 class NDEVR_API MaterialPropertySlider : public QCustomSlider, public DesignObjectWidgetInterface
12 {
13 public:
20 MaterialPropertySlider(const DynamicPointer<QTDesignObject>& object, NDPM property, QWidget* parent = nullptr);
26 MaterialPropertySlider(NDPM property, QWidget* parent = nullptr);
27
32 void addTarget(const DynamicPointer<QTDesignObject>& object) override
33 {
35 }
36
44
50 {
51 if (!mat.isValid())
52 return;
55 }
56
61 void onTargetUpdated(UUID id) override;
69 protected:
73 void init();
74 protected:
76 };
77
81 {
82 public:
88 PixelThicknessSlider(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
90 {}
91
95 PixelThicknessSlider(QWidget* parent = nullptr)
97 {}
98 };
99
102 class NDEVR_API OpacitySlider : public MaterialPropertySlider
103 {
104 public:
110 OpacitySlider(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
111 : MaterialPropertySlider(object, NDPM::opacity, parent)
112 {}
113
117 OpacitySlider(QWidget* parent = nullptr)
119 {}
120 };
121
125 {
126 public:
132 DepthBiasSlider(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
133 : MaterialPropertySlider(object, NDPM::depth_bias, parent)
134 {}
135
139 DepthBiasSlider(QWidget* parent = nullptr)
141 {}
142 };
143}
DepthBiasSlider(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Constructs a depth bias slider bound to a design object.
DepthBiasSlider(QWidget *parent=nullptr)
Constructs an unbound depth bias slider.
virtual void removeTarget(const DynamicPointer< QTDesignObject > &object)
Removes a specific target design object.
void setTarget(const DynamicPointer< QTDesignObject > &object)
Sets a single target design object, replacing any existing targets.
virtual void addTarget(const DynamicPointer< QTDesignObject > &object)
Adds a design object to the set of targets.
constexpr decltype(auto) get(t_property_type property) const
Retrieves a property value from the database, cast to the requested type.
bool isValid() const
Checks whether this design object has a valid index into the database.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
void removeTarget(const DynamicPointer< QTDesignObject > &object) override
Removes a design object from the editing targets.
void onTargetUpdated(UUID id) override
Called when the target design object is updated, refreshes the slider value.
void addTarget(const DynamicPointer< QTDesignObject > &object) override
Adds a design object as an additional editing target.
void onObjectDeletedSlot()
Slot called when the target object is deleted, clearing the current target.
void refreshFromMaterial(const Material &mat)
Updates the slider value from the given material's property.
MaterialPropertySlider(const DynamicPointer< QTDesignObject > &object, NDPM property, QWidget *parent=nullptr)
Constructs a slider bound to a specific material property of a design object.
void init()
Initializes slider range and connections based on the material property.
NDPM m_property
The material property controlled by this slider.
MaterialPropertySlider(NDPM property, QWidget *parent=nullptr)
Constructs an unbound slider for a specific material property.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:153
OpacitySlider(QWidget *parent=nullptr)
Constructs an unbound opacity slider.
OpacitySlider(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Constructs an opacity slider bound to a design object.
PixelThicknessSlider(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Constructs a pixel thickness slider bound to a design object.
PixelThicknessSlider(QWidget *parent=nullptr)
Constructs an unbound pixel thickness slider.
void setValue(fltp08 value)
Sets the slider value from a floating-point percent.
QCustomSlider(Qt::Orientation orientation, QWidget *parent=nullptr)
Constructs a slider with the specified orientation.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
NDPM
NDPM - NDEVR Design Property Material: Values stored in the material database.
Definition Material.h:53
@ pixel_thickness
Thickness in pixels for line and point rendering.
Definition Material.h:62
@ opacity
The overall opacity of the material (0.0 = fully transparent, 1.0 = fully opaque).
Definition Material.h:56
@ depth_bias
Bias applied to depth values to prevent z-fighting.
Definition Material.h:78
double fltp08
Defines an alias representing an 8 byte floating-point number.
@ thickness
The thickness value applied to geometry rendering.
Definition Geometry.h:58