API Documentation
Loading...
Searching...
No Matches
DesignObjectDialog.h
Go to the documentation of this file.
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: DesignObjectDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QTDesignObject.h>
35#include <NDEVR/ShowPropertiesSettings.h>
36#include <NDEVR/QCustomDockWidget.h>
37#include <NDEVR/Pointer.h>
38#include <NDEVR/UnitManager.h>
39#include <QWidget>
40
41class QTabWidget;
42namespace NDEVR
43{
44 class Editor;
45 class ContainerWidgetBase;
46 class BasicThread;
47 class Button;
48 class QCustomTableWidget;
49 class DesignObjectDialog;
50 class QCustomTabWidget;
51 /**--------------------------------------------------------------------------------------------------
52 \brief Allows extended functionality to DesignObjectDialogs by adding callbacks that can be
53 used primarily to add tabs to the dialog.
54 **/
56 {
57 protected:
59 : generic_creation_callbacks(10)
60 {}
61 public:
63 void setupDialog(const String& type_name, const DynamicPointer<QTDesignObject>& object, DesignObjectDialog* dialog);
64 void addSetupCallback(const String& type, const std::function<void(DesignObjectDialog*, const DynamicPointer<QTDesignObject>&)>& callback);
65 void addSetupCallback(const std::function<void(DesignObjectDialog*, const DynamicPointer<QTDesignObject>&)>& callback);
68 };
69 /**--------------------------------------------------------------------------------------------------
70 \brief A popup dialog for showing options or information to the user for a particular DesignObject.
71 A DesignObjectDialog stores multiple Editors which are used to edit or modify the target Model, Material
72 or Geometry.
73 **/
74 class NDEVR_API DesignObjectDialog : public QWidget
75 {
76 Q_OBJECT
77 public:
80 QSize sizeHint() const;
81 void setType(const String& type);
82 void updateGUI();
86 void setHorizontal(bool horizontal);
88 void addTabDialog(QWidget* editor, uint04 index = Constant<uint04>::Invalid);
90 const DynamicPointer<QTDesignObject>& designObjectPtr() { return m_design_object; }
91 virtual bool fullscreenTouch() const;
92 virtual bool allowDocking() const;
93 virtual void enablePrint(bool enable_print);
94 void setCustomTitle(const TranslatedString& title);
96 String icon() const;
98 const UnitManager& dialogUnits() const;
99 public:
100 //Find the dialog of type t_type and display it
101 template<class t_type>
103 {
104 for (uint04 i = 0; i < m_editors.size(); i++)
105 {
106 if (dynamic_cast<t_type*>(m_editors[i]))
107 {
108 showCurrentIndex(i);
109 return true;
110 }
111 }
112 return false;
113 }
114 signals:
121 protected slots:
126 protected:
134 Button* m_save_button = nullptr;
135 Button* m_accept_button = nullptr;
136 Button* m_cancel_button = nullptr;
137 Button* m_print_button = nullptr;
138 Button* m_zoom_button = nullptr;
139 Button* m_units_button = nullptr;
141 };
142};
#define NDEVR_API
Definition DLLInfo.h:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core widget that allows the user to click one of many button types.
Definition Button.h:66
Allows extended functionality to DesignObjectDialogs by adding callbacks that can be used primarily t...
Definition DesignObjectDialog.h:56
void setupDialog(const String &type_name, const DynamicPointer< QTDesignObject > &object, DesignObjectDialog *dialog)
Dictionary< String, Buffer< std::function< void(DesignObjectDialog *, const DynamicPointer< QTDesignObject > &)> > > creation_callbacks
Definition DesignObjectDialog.h:66
void addSetupCallback(const String &type, const std::function< void(DesignObjectDialog *, const DynamicPointer< QTDesignObject > &)> &callback)
static DesignObjectDialogFactory & DefaultInstance()
Buffer< std::function< void(DesignObjectDialog *, const DynamicPointer< QTDesignObject > &)> > generic_creation_callbacks
Definition DesignObjectDialog.h:67
void addSetupCallback(const std::function< void(DesignObjectDialog *, const DynamicPointer< QTDesignObject > &)> &callback)
DesignObjectDialogFactory()
Definition DesignObjectDialog.h:58
A popup dialog for showing options or information to the user for a particular DesignObject....
Definition DesignObjectDialog.h:75
TranslatedString getTitle() const
DynamicPointer< QTDesignObject > m_design_object
Definition DesignObjectDialog.h:131
const UnitManager & dialogUnits() const
void addTabDialog(QWidget *editor, uint04 index=Constant< uint04 >::Invalid)
Buffer< Editor * > m_editors
Definition DesignObjectDialog.h:128
void addEditor(Editor *editor, uint04 index=Constant< uint04 >::Invalid)
const QTDesignObject & designObject() const
void setType(const String &type)
virtual bool fullscreenTouch() const
ShowPropertiesSettings m_settings
Definition DesignObjectDialog.h:133
Buffer< QWidget * > m_tabs
Definition DesignObjectDialog.h:129
bool showSubDialog()
Definition DesignObjectDialog.h:102
TranslatedString m_custom_title
Definition DesignObjectDialog.h:127
void setCustomTitle(const TranslatedString &title)
DesignObjectDialog(const DynamicPointer< QTDesignObject > &object, const ShowPropertiesSettings &style)
UnitManager m_dialog_units
Definition DesignObjectDialog.h:140
virtual void enablePrint(bool enable_print)
void setHorizontal(bool horizontal)
SectionWidget * m_target_widget
Definition DesignObjectDialog.h:130
virtual bool allowDocking() const
void showCurrentIndex(uint04 index)
const DynamicPointer< QTDesignObject > & designObjectPtr()
Definition DesignObjectDialog.h:90
virtual Buffer< QWidget * > printableWidgets()
TranslatedString title() const
QCustomTabWidget * m_tab_menu
Definition DesignObjectDialog.h:132
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A base class for displaying options for editing a single DesignObject, typically a Model.
Definition Editor.h:48
A tab widget provides a tab area and a "page area" that is used to display pages related to each tab....
Definition QCustomTabWidget.h:45
A pointer to a DesignObject within a QTModelManager that recieves and emits update signals based on t...
Definition QTDesignObject.h:88
SectionWidget manages multiple instances of SectionContent. It displays a title TAB,...
Definition SectionWidget.h:55
Software Service Managers take a Software service to modify the behavior of the software.
Definition SoftwareService.h:15
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Handles a grouping of units that can describe any number of data categories.
Definition UnitManager.h:143
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Stores settings for setting up and displaying a DesignObjectDialog such as whether the dialog is part...
Definition ShowPropertySettings.h:25