2#include "BuildActions.h"
3#include "BuildActionWidget.h"
4#include "BuildActionItemsWidget.h"
5#include "BuildActionUISetupWidget.h"
6#include <NDEVR/CustomModelLogic.h>
7#include <NDEVR/QTWindowManager.h>
8#include <NDEVR/SceneTreeWidget.h>
9#include <NDEVR/Ribbon.h>
10#include <NDEVR/RibbonSubGroup.h>
11#include <NDEVR/RibbonGroup.h>
12#include <NDEVR/NDEVRRibbon.h>
13#include <NDEVR/SceneTree.h>
14#include <NDEVR/DesignObjectDialog.h>
15#include <NDEVR/QTIconManager.h>
16#include <NDEVR/Button.h>
17#include <NDEVR/QTTools.h>
37 if (parent_a == parent_b && parent_a.
isValid())
51 , [definition,
this](
Button* b)
53 ShowPropertiesSettings settings(definition.get<NDPO::guid>(), b);
54 m_window_manager->showModelProperties(settings);
86 if (group.size() == 0)
91 if (sub_group.size() == 0)
92 sub_group =
"General";
108 switch (definition.
action())
195 switch (definition.
action())
The equivelent of std::vector but with a bit more control.
void add(t_type &&object)
Adds object to the end of the buffer.
A Model subclass that defines a single build action or workflow step, holding its action type,...
BuildActionUIDefinition uiDefinition() const
Returns the UI definition for this action.
void executeThreaded(const void *lock_ptr, LogPtr log=nullptr)
Executes this action on a background thread.
String defaultLogName() const
Returns the default log name for this action.
BuildActionDefinition createChildBuildDefinition()
Creates a new child build action definition under this one.
BuildAction action() const
Returns the build action type.
static constexpr StringView TypeName()
Returns the type name used for model registration.
void executeMenuItems(Model &model, QTModelManager *manager, QAction *action, const Buffer< UUID > &, const SelectionInfo &, PopupInfo info) override
Override to handle execution of custom context menu actions.
Dictionary< UUID, Buffer< QPointer< Button > > > m_buttons
Maps action UUIDs to their UI buttons.
Button * m_create_child_button
Create-child button for the tree widget.
virtual void addMenuItems(Model &model, QTModelManager *, QMenu &menu, const Buffer< UUID > &, const SelectionInfo &) override
Override to add custom context menu items when a model of this type is selected.
BuildActionProgramLogic(QTWindowManager *window_manager, QTModelManager *manager)
Constructs the build action program logic.
void createAndShowChildDefinition(Model &model, PopupInfo info)
Creates a child build action definition under the given model and shows its editor.
Button * m_play_button
Play button for the tree widget.
virtual void setupModel(Model &model) override
Override to perform setup when a model of this type is read from an NDV file.
virtual void setupPropertiesDialog(DesignObjectDialog *dialog, const DynamicPointer< QTDesignObject > &object) override
Override to customize property dialogs when objects of this type are created.
QAction * m_create_child_action
Context menu action to create a child action.
void setupUI(const BuildActionDefinition &definition)
Sets up ribbon and tree buttons for the given build action definition.
QAction * m_run_menu_action
Context menu action to run the build action.
bool canBeHandledBySelectionWidget() const override
Returns whether this model type can be handled by the generic selection widget.
QAction * m_create_new_action_before
Context menu action to insert an action before.
QTWindowManager * m_window_manager
The window manager for UI operations.
QAction * m_create_new_action_after
Context menu action to insert an action after.
Model m_last_model
The most recently selected model.
Button * createButton(const BuildActionDefinition &definition)
Creates a button that opens the property dialog for the given build action.
virtual void setTreeWidgetsForSelection(const Model &model, Buffer< QWidget * > &widgets, SceneTree *tree) override
Override to provide custom tree widgets shown when the model is selected.
QTModelManager * m_manager
The model manager providing data context.
void setSorter(const std::function< bool(const Model &a, const Model &b)> &sort_function)
Sets a custom sorting function for models of this type.
CustomModelLogic(QTModelManager *manager, const StringView &type_name)
Constructs a CustomModelLogic for a single model type name.
A popup dialog for showing options or information to the user for a particular DesignObject.
void addTabDialog(QWidget *editor, uint04 index=Constant< uint04 >::Invalid)
Adds a generic widget as a tab in the dialog.
const void * lockPtr() const
Returns a raw pointer to the internal lock primitive.
WLock writeLock() const
Acquires an exclusive write lock on the design object store.
constexpr decltype(auto) get(t_property_type property) const
Retrieves a property value from the database, cast to the requested type.
void set(t_property_type property, const t_type &value)
Sets a property value in the database.
bool isValid() const
Checks whether this design object has a valid index into the database.
bool is(t_property_type property, const StringView &value) const
Checks whether a string property matches the given StringView value.
StringView getIcon() const
Retrieves the icon identifier string associated with this design object.
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
InfoPipe * getLog(const StringView &log_name) const
Retrieves the log pipe associated with the given name.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
A core class that represents a node on model hierarchy.
void updateModifiedTime(Time time=Time::SystemTime())
Updates the modified timestamp for this model.
TranslatedString displayName() const
Returns the translated display name for this model.
Model getParent() const
Returns the parent model of this model.
Model createChild()
Creates a new child model and appends it to this model's child list.
uint04 getChildIndex(uint04 child) const
Returns the database index of the child at the given slot.
static QIcon GetIconResourceBlocking(const StringView &icon, QIcon::Mode mode=QIcon::Mode::Normal)
Synchronously fetches an icon resource using the current theme.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
virtual void ShowProperties(const ShowPropertiesSettings &settings)
Shows a properties dialog for a design object.
virtual LogManager * logManager() const override
Retrieves the log manager used for diagnostic output.
virtual void addModel(Model object) override
Adds a model to the manager and emits appropriate signals.
Manages all windows and logic surrounding dialogs and views for displaying and managing a 3D environm...
Represents the "Tab" of a widget.
Represents a sub-section of "Tab" of a ribbon representing a grouping of buttons or widgets within a ...
Button * addButton(Button *button, uint04 index=Constant< uint04 >::Invalid, bool update_layout=false)
Adds a button to this sub-group at the specified index.
Shows all objects in a QTModelManager in a tree hierarchy view that allows for user interaction.
QTModelManager * manager() const
Retrieves the model manager used by this tree.
Responsible for turning a user interaction into a selection within a DesignObjectLookup.
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Used to lock a particular variable for writing.
The primary namespace for the NDEVR SDK.
@ type
The type identifier string for this model node.
@ model_color
The color assigned directly to this model node.
@ e_process_files
Processes files with child actions.
@ e_workflow
A container action that executes child actions sequentially.
@ e_variable_loop
Loops over a set of variable values.
@ e_file_loop
Loops over files matching a pattern.
@ e_index_loop
Loops over a range of integer indices.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ creation_time
Timestamp when the object was created.
@ guid
A 128-bit globally unique identifier for the object.
@ application_locked
Whether the application has locked this object from editing.
@ e_object_creation
Dialog for creating a new object.
Describes how a build action should be presented in the application UI, including ribbon and tree pla...
String ribbon_sub_group
The ribbon sub-group name.
bool show_on_ribbon
Whether to show a button on the ribbon.
String ribbon_group
The ribbon group name to place the action in.
bool show_at_bottom_of_tree
Whether to show the action at the bottom of the tree.
Stores settings for setting up and displaying a DesignObjectDialog such as whether the dialog is part...