NDEVR
API Documentation
ModelMaterialEditor.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: ModelMaterialEditor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Editor.h>
34#include <NDEVR/Model.h>
35#include <QWidget>
36namespace Ui
37{
38 class ModelMaterialEditorUI;
39}
40namespace NDEVR
41{
46 class NDEVR_API ModelMaterialEditor : public Editor
47 {
48 Q_OBJECT
49 public:
60
65 ModelMaterialEditor(const DynamicPointer<QTDesignObject>& model, QWidget *parent = Q_NULLPTR);
74 void setOutlineMode(const OutlineMode& mode);
78 virtual void updateValues() final override;
79 private:
84 void createAndShowMaterial(PopupInfo info);
89 void clearSubMaterials(PopupInfo info);
94 void setMaterialMode(Model::MaterialMode option);
100 void setMaterial(const Buffer<UUID>& ids, PopupInfo info);
106 void setupMaterialGallery(DesignObjectGallery* gallery, bool fill_with_children);
111 void updateMaterialGallery(DesignObjectGallery* gallery);
116 void showMaterialDialog(UUID material);
117 protected:
118 Ui::ModelMaterialEditorUI* ui;
119 bool m_ignore_toggle = false;
120 };
121}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Shows a series of Buttons with large icons that represent DesignObjects that allow the user to choose...
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Editor(QWidget *parent=nullptr)
Constructs an Editor with no design object target.
ModelMaterialEditor(const DynamicPointer< QTDesignObject > &model, QWidget *parent=Q_NULLPTR)
Constructs the material editor for the given model design object.
OutlineMode
Outline rendering modes for the material display.
@ e_grid
Grid pattern rendering.
@ e_wireframe
Wireframe-only rendering.
@ e_bold_edges
Solid fill with bold edge outlines.
@ e_solid
Solid fill rendering.
void setOutlineMode(const OutlineMode &mode)
Sets the outline rendering mode for material preview.
bool m_ignore_toggle
Flag to suppress toggle callbacks during programmatic updates.
virtual void updateValues() final override
Updates all UI values from the current target model and its materials.
Ui::ModelMaterialEditorUI * ui
The auto-generated UI form.
~ModelMaterialEditor()
Destroys the material editor and releases resources.
A core class that represents a node on model hierarchy.
Definition Model.h:292
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.
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition PopupInfo.h:16