NDEVR
API Documentation
MaterialWidget.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: MaterialWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/PropertiesButton.h>
34#include <NDEVR/ColorChannelCombo.h>
35#include <NDEVR/QTDesignObject.h>
36#include <NDEVR/ColorChooserButton.h>
37#include <NDEVR/ColorChooserButton.h>
38#include <NDEVR/QCustomComboBox.h>
39#include <NDEVR/Material.h>
40#include <QWidget>
41namespace NDEVR
42{
46 class NDEVR_API MaterialWidget : public QWidget
47 {
48 Q_OBJECT
49 public:
54 MaterialWidget(QWidget* parent = nullptr);
60 MaterialWidget(const DynamicPointer<QTDesignObject>& material, QWidget* parent = nullptr);
66 signals:
79 protected:
83 void setup();
89 void updateFromMaterial(const Model& model, const Material& mat);
94 private slots:
98 void updateFromTargetSlot();
99
100 protected:
107 };
108}
Allows the user to select a method to color a particular channel.
A button that pops up a ColorChooserDialog and changes background color based on the color chosen.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
DynamicPointer< QTDesignObject > m_target
The currently targeted design object.
void computedColorChosenSignal()
Emitted when a computed color mode is selected.
ColorChannelCombo * m_color_channel_combo
Combo box for selecting a vertex color channel.
MaterialWidget(const DynamicPointer< QTDesignObject > &material, QWidget *parent=nullptr)
Constructs a MaterialWidget bound to the given design object.
TimeSpan m_animation_time
The animation time used for color transitions.
ColorChooserButton * m_color_chooser_button
Button for choosing a solid color.
MaterialWidget(QWidget *parent=nullptr)
Constructs a MaterialWidget with no initial target.
PropertiesButton * m_properties_button
Button to open the full material properties editor.
void updateFromMaterial(const Model &model, const Material &mat)
Updates the widget state from the given model and material.
QCustomComboBox * m_color_combo
Combo box for selecting the color mode (solid, channel, computed).
void colorChannelChosenSignal()
Emitted when a color channel mode is selected.
void solidColorChosenSignal()
Emitted when a solid color mode is selected.
void setup()
Sets up the internal UI layout and child widgets.
void updateFromColor()
Updates the widget state based on the current color selection.
void setTarget(const DynamicPointer< QTDesignObject > &target)
Sets the design object target for this widget.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:153
A core class that represents a node on model hierarchy.
Definition Model.h:292
A button that opens the properties dialog for a given design object when clicked.
A compact way to present a list of options to the user.
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
The primary namespace for the NDEVR SDK.