NDEVR
API Documentation
CollimatorLogic

Handles logic for managing collimators in the NDEVR environment, including setup, settings, and dialogs. More...

Inheritance diagram for CollimatorLogic:
[legend]
Collaboration diagram for CollimatorLogic:
[legend]

Public Member Functions

virtual bool canBeHandledBySelectionWidget () const override
 Determines if the logic can be handled by a selection widget.
bool createdCollimators () const
 Checks if collimators have been created.
virtual void finishReadingINI (INIFactory &) override
 Finalizes reading INI settings.
void getINI (INIFactory &factory) override
 Reads INI settings into the given factory.
void initCollimatorSettings ()
 Initializes the settings for all collimators.
virtual void prepareForINI (INIFactory &) override
 Prepares the logic for reading or writing INI settings.
const CollimatorSettingssettings () const
 Retrieves the settings for the collimators.
void setupCollimators ()
 Sets up collimators by initializing their settings and configurations.
void setupStation ()
 Sets up the station model associated with the collimators, which all collimators will be children of.
Public Member Functions inherited from CustomModelLogic
virtual const UUIDid () const
 Returns the unique identifier for this custom model logic instance.
virtual void registerAll ()
 Registers all callbacks (context menu, tree widgets, dialog, NDV) with the manager.
const Buffer< String > & typeNames () const
 Returns the type names handled by this custom model logic.
Public Member Functions inherited from INIInterface
 INIInterface ()
 Constructs an INIInterface with no default INI file.
 INIInterface (const File &default_ini)
 Constructs an INIInterface with the specified default INI file.
virtual ~INIInterface ()
 Virtual destructor for safe polymorphic cleanup.
virtual bool readINIOptions ()
 Reads INI options from the default INI file.
virtual bool readINIOptions (File &ini_file)
 Reads INI options from the specified INI file.
virtual bool saveINIOptions (bool multithead=false)
 Saves INI options to the default INI file.
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 Saves INI options to the specified INI file.
void setDefaultINIFile (const File &file)
 Sets the default INI file path used for reading and writing options.
virtual void writeToLog (const StringView &title, LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log with a title.
virtual void writeToLog (LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log.

Static Public Member Functions

static CollimatorLogic * Default ()
 Retrieves the default instance of CollimatorLogic.
static CollimatorLogic * Default (QTModelManager *manager)
 Retrieves the default instance of CollimatorLogic for a specific manager.
static void SetEnabled (bool is_enabled, QTModelManager *manager)
 Enables or disables collimator logic.

Protected Member Functions

virtual void setupPropertiesDialog (DesignObjectDialog *dialog, const DynamicPointer< QTDesignObject > &object) override
 Modifies property dialogs when objects are created.
Protected Member Functions inherited from CustomModelLogic
 CustomModelLogic (QTModelManager *manager, const Buffer< String > &type_names)
 Constructs a CustomModelLogic for multiple model type names.
 CustomModelLogic (QTModelManager *manager, const StringView &type_name)
 Constructs a CustomModelLogic for a single model type name.
virtual ~CustomModelLogic ()
 Destructor.
virtual void addMenuItems (Model &, QTModelManager *, QMenu &, const Buffer< UUID > &, const SelectionInfo &)
 Override to add custom context menu items when a model of this type is selected.
ContextMenuCallbackcontextMenuCallback ()
 Returns the context menu callback for this model logic.
CustomDesignObjectDialogSetupCallback * dialogSetupCallback ()
 Returns the dialog setup callback for this model logic.
virtual void executeMenuItems (Model &, QTModelManager *, QAction *, const Buffer< UUID > &, const SelectionInfo &, PopupInfo)
 Override to handle execution of custom context menu actions.
NDVSetupCallbackndvFileReadLogic ()
 Returns the NDV file read setup callback for this model logic.
void setSorter (const std::function< bool(const Model &a, const Model &b)> &sort_function)
 Sets a custom sorting function for models of this type.
virtual void setTreeWidgetsForSelection (const Model &, Buffer< QWidget * > &, SceneTree *)
 Override to provide custom tree widgets shown when the model is selected.
virtual void setupModel (Model &)
 Override to perform setup when a model of this type is read from an NDV file.
virtual void setupUI (WindowManager *)
 Override to set up custom UI elements for this model type.
CustomTreeWidgetstreeWidgetCallback ()
 Returns the tree widget callback for this model logic.

Additional Inherited Members

Protected Attributes inherited from CustomModelLogic
ContextMenuCallbackm_custom_context_menu = nullptr
 Callback for custom context menu actions.
CustomDesignObjectDialogSetupCallback * m_dialog_callback = nullptr
 Callback for customizing property dialogs.
UUID m_id
 The unique identifier for this logic instance.
QTModelManagerm_manager
 The model manager providing data context.
NDVSetupCallbackm_ndv_setup_callback = nullptr
 Callback for NDV file read setup.
CustomModelSorter * m_sorter = nullptr
 Custom sorting logic for the model type.
CustomTreeWidgetsm_tree_button_menu = nullptr
 Callback for custom tree selection widgets.
Buffer< Stringm_type_names
 The model type names handled by this logic.
Protected Attributes inherited from INIInterface
File m_default_ini
 The default file path used for reading and writing INI options.

Detailed Description

Handles logic for managing collimators in the NDEVR environment, including setup, settings, and dialogs.

This class extends CustomModelLogic to provide collimator-specific functionality and integrates with the INI system for configuration management.

Definition at line 40 of file CollimatorLogic.h.

Member Function Documentation

◆ canBeHandledBySelectionWidget()

virtual bool CollimatorLogic::canBeHandledBySelectionWidget ( ) const
inlineoverridevirtual

Determines if the logic can be handled by a selection widget.

Returns
Always returns false for this class.

Reimplemented from CustomModelLogic.

Definition at line 77 of file CollimatorLogic.h.

◆ createdCollimators()

bool CollimatorLogic::createdCollimators ( ) const

Checks if collimators have been created.

Returns
True if collimators have been created, false otherwise.

◆ Default() [1/2]

CollimatorLogic * CollimatorLogic::Default ( )
static

Retrieves the default instance of CollimatorLogic.

Returns
Pointer to the default CollimatorLogic instance.

◆ Default() [2/2]

CollimatorLogic * CollimatorLogic::Default ( QTModelManager * manager)
static

Retrieves the default instance of CollimatorLogic for a specific manager.

Parameters
managerPointer to the QTModelManager instance.
Returns
Pointer to the default CollimatorLogic instance.

◆ finishReadingINI()

virtual void CollimatorLogic::finishReadingINI ( INIFactory & )
overridevirtual

Finalizes reading INI settings.

Parameters
factoryReference to the INIFactory instance.

Reimplemented from INIInterface.

◆ getINI()

void CollimatorLogic::getINI ( INIFactory & factory)
overridevirtual

Reads INI settings into the given factory.

Parameters
factoryReference to the INIFactory instance.

Implements INIInterface.

◆ prepareForINI()

virtual void CollimatorLogic::prepareForINI ( INIFactory & )
overridevirtual

Prepares the logic for reading or writing INI settings.

Parameters
factoryReference to the INIFactory instance.

Reimplemented from INIInterface.

◆ SetEnabled()

void CollimatorLogic::SetEnabled ( bool is_enabled,
QTModelManager * manager )
static

Enables or disables collimator logic.

Parameters
is_enabledTrue to enable, false to disable.
managerPointer to the QTModelManager instance used to store the setup callbacks.

◆ settings()

const CollimatorSettings * CollimatorLogic::settings ( ) const
inline

Retrieves the settings for the collimators.

Returns
Pointer to the array of CollimatorSettings.

Definition at line 108 of file CollimatorLogic.h.

◆ setupPropertiesDialog()

virtual void CollimatorLogic::setupPropertiesDialog ( DesignObjectDialog * dialog,
const DynamicPointer< QTDesignObject > & object )
overrideprotectedvirtual

Modifies property dialogs when objects are created.

Parameters
dialogPointer to the DesignObjectDialog instance.
objectDynamic pointer to the QTDesignObject being modified.

Reimplemented from CustomModelLogic.


The documentation for this class was generated from the following file: